Module: Regressor::Model::Relation::HasMany

Included in:
ActiveRecordModel
Defined in:
lib/model/active_record/relation/has_many.rb

Instance Method Summary collapse

Instance Method Details

#has_many_relationsObject



5
6
7
8
9
# File 'lib/model/active_record/relation/has_many.rb', line 5

def has_many_relations
  @model.constantize.reflect_on_all_associations(:has_many).map(&:name).map do |relation|
    "it { is_expected.to have_many :#{relation} }"
  end.join("\n  ") rescue nil
end