Class: Wallaby::ActiveRecord::ModelDecorator::FieldsBuilder::AssociationBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/adaptors/wallaby/active_record/model_decorator/fields_builder/association_builder.rb

Overview

To build the metadata for associations

Instance Method Summary collapse

Instance Method Details

#update(metadata, reflection) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/adaptors/wallaby/active_record/model_decorator/fields_builder/association_builder.rb', line 7

def update(, reflection)
  type = reflection.macro
  [:is_association] = true
  [:is_through] = through?(reflection)
  [:has_scope] = scope?(reflection)
  [:foreign_key] = foreign_key_for(reflection, type)
end