Module: MagicReport::Report::Reflection

Extended by:
ActiveSupport::Concern
Included in:
MagicReport::Report
Defined in:
lib/magic_report/report/reflection.rb

Class Method Summary collapse

Class Method Details

.add_field(klass, name, reflection) ⇒ Object



15
16
17
# File 'lib/magic_report/report/reflection.rb', line 15

def add_field(klass, name, reflection)
  klass._fields = klass._fields.except(name).merge!(name => reflection)
end

.add_has_many(klass, name, reflection) ⇒ Object



23
24
25
# File 'lib/magic_report/report/reflection.rb', line 23

def add_has_many(klass, name, reflection)
  klass._has_many = klass._has_many.except(name).merge!(name => reflection)
end

.add_has_one(klass, name, reflection) ⇒ Object



19
20
21
# File 'lib/magic_report/report/reflection.rb', line 19

def add_has_one(klass, name, reflection)
  klass._has_one = klass._has_one.except(name).merge!(name => reflection)
end