Skip to content

Commit 3330e77

Browse files
committed
Fix to_many allow_include?
1 parent b6a05fb commit 3330e77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/jsonapi/relationship.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ class Relationship
55
:parent_resource, :eager_load_on_include, :custom_methods,
66
:inverse_relationship, :allow_include
77

8+
attr_writer :allow_include
9+
810
def initialize(name, options = {})
911
@name = name.to_s
1012
@options = options
@@ -134,7 +136,7 @@ def initialize(name, options = {})
134136

135137
def allow_include?(context = nil)
136138
strategy = if @allow_include.nil?
137-
JSONAPI.configuration.default_allow_include_to_one
139+
JSONAPI.configuration.default_allow_include_to_many
138140
else
139141
@allow_include
140142
end

0 commit comments

Comments
 (0)