class JsonApiResource::Associations::HasMany

Public Instance Methods

callable?( root_instance ) click to toggle source
# File lib/json_api_resource/associations/has_many.rb, line 13
def callable?( root_instance )
  true
end
default_action() click to toggle source
# File lib/json_api_resource/associations/has_many.rb, line 4
def default_action
  :where
end
query( root_instance ) click to toggle source
# File lib/json_api_resource/associations/has_many.rb, line 17
def query( root_instance )
  { key => root_instance.id }.merge(opts)
end
server_key() click to toggle source
# File lib/json_api_resource/associations/has_many.rb, line 8
def server_key
  class_name = self.root.to_s.demodulize.underscore
  "#{class_name}_id"
end
type() click to toggle source
# File lib/json_api_resource/associations/has_many.rb, line 21
def type
  JsonApiResource::Associations::HAS_MANY
end