Skip to content

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
esbanarango committed Dec 16, 2015
1 parent bf9c300 commit 3597616
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/acts_as_inheritable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def has_parent?
# relations defined on `INHERITABLE_ASSOCIATIONS`. For each instance on
# each relation it re-creates it.
def inherit_relations(model_parent = send(:parent), current = self)
if model_parent && model_parent.class.method_defined?(:inheritable_configuration) && model_parent.class.inheritable_configuration[:associations]
model_parent.class.inheritable_configuration[:associations].each do |relation|
if model_parent && current.class.method_defined?(:inheritable_configuration) && current.class.inheritable_configuration[:associations]
current.class.inheritable_configuration[:associations].each do |relation|
parent_relation = model_parent.send(relation)
relation_instances = parent_relation.respond_to?(:each) ? parent_relation : [parent_relation].compact
relation_instances.each do |relation_instance|
Expand Down

0 comments on commit 3597616

Please sign in to comment.