3
4
5
6
7
8
9
10
11
12
|
# File 'lib/assigns_has_many_through_relations/model_concern.rb', line 3
def assigns_has_many_relationships_with(left_relation, right_relation)
@join_name = AssignsHasManyThroughRelations.join_name_for left_relation, right_relation
has_many @join_name.to_sym, dependent: :delete_all
has_many right_relation.to_s.pluralize.to_sym, through: @join_name.to_sym
accepts_nested_attributes_for @join_name.to_sym, allow_destroy: true
attr_accessible "#{@join_name}_attributes"
include AssignsHasManyThroughRelations::ModelInstanceMethods
end
|