Method: JsonApiResource::Associations::Base#initialize
- Defined in:
- lib/json_api_resource/associations/base.rb
#initialize(associated_class, name, opts = {}) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/json_api_resource/associations/base.rb', line 7 def initialize(associated_class, name, opts = {}) self.name = name.to_sym self.root = associated_class @opts = opts.merge( skip_pagination: true ) self.action = @opts.delete :action do default_action end self.key = @opts.delete :foreign_key do server_key end self.key = self.key.try :to_sym end |