Class: Graphiti::Adapters::ActiveRecord::BelongsToSideload
- Inherits:
-
Sideload::BelongsTo
- Object
- Sideload
- Sideload::BelongsTo
- Graphiti::Adapters::ActiveRecord::BelongsToSideload
- Includes:
- Inference
- Defined in:
- lib/graphiti/adapters/active_record/belongs_to_sideload.rb
Constant Summary
Constants inherited from Sideload
Sideload::HOOK_ACTIONS, Sideload::TYPES
Instance Attribute Summary
Attributes inherited from Sideload
#group_name, #link, #name, #parent, #parent_resource_class, #polymorphic_as
Instance Method Summary collapse
Methods included from Inference
Methods inherited from Sideload::BelongsTo
#base_filter, #ids_for_parents, #infer_foreign_key, #initialize, #load_params, #type
Methods inherited from Sideload
after_save, #always_include_resource_ids?, assign, #assign, assign_each, #assign_each, #associate, #associate_all, #association_name, #base_scope, #build_resource_proxy, #clear_resources, #create_remote_resource, #description, #disassociate, #errors, #fire_hooks!, #foreign_key, hooks, #ids_for_parents, #infer_foreign_key, #initialize, link, #link?, #link_extra_fields, #link_filter, #load, #load_params, params, #parent_resource, #performant_assign?, #polymorphic_child?, #polymorphic_has_many?, #polymorphic_has_one?, #polymorphic_parent?, pre_load, #primary_key, #readable?, #remote?, #resolve, #resource, #resource_class, #resource_class_loaded?, scope, #shared_remote?, #single?, #type, #writable?
Constructor Details
This class inherits a constructor from Graphiti::Sideload::BelongsTo
Instance Method Details
#default_base_scope ⇒ Object
4 5 6 |
# File 'lib/graphiti/adapters/active_record/belongs_to_sideload.rb', line 4 def default_base_scope resource_class.model.all end |
#scope(parent_ids) ⇒ Object
8 9 10 |
# File 'lib/graphiti/adapters/active_record/belongs_to_sideload.rb', line 8 def scope(parent_ids) base_scope.where(primary_key => parent_ids) end |