Method: JSONAPI::Relationship::ToMany#allow_include?
- Defined in:
- lib/jsonapi/relationship.rb
#allow_include?(context = nil) ⇒ Boolean
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/jsonapi/relationship.rb', line 214 def allow_include?(context = nil) strategy = if @allow_include.nil? JSONAPI.configuration.default_allow_include_to_many else @allow_include end if !!strategy == strategy #check for boolean return strategy elsif strategy.is_a?(Symbol) || strategy.is_a?(String) parent_resource.send(strategy, context) else strategy.call(context) end end |