Skip to content

Commit

Permalink
User association reflection to resolve active_record class. #21
Browse files Browse the repository at this point in the history
  • Loading branch information
LTe committed Jan 1, 2012
1 parent 9bcaa91 commit e88ab9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/acts-as-messageable/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def acts_as_messageable(options = {})
end

def resolve_active_record_ancestor
ancestors_classes = (ancestors - included_modules)
ancestors_classes[ancestors_classes.index(ActiveRecord::Base)-1]
self.reflect_on_association(:received_messages_relation).active_record
end

end
Expand Down

1 comment on commit e88ab9d

@aagrawal2001
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Thanks for resolving it.

Please sign in to comment.