Permalink
Browse files

fix for bug undefined method 'belongs_to' for Impression:Class

  • Loading branch information...
1 parent 7a93fff commit 00e658b28d35dd82357da987257aea2c2fc3d73f Michael Elfassy committed Oct 10, 2012
View
1 app/models/impression.rb
@@ -1,3 +1,2 @@
class Impression
- belongs_to :impressionable, :polymorphic=>true
end
View
2 lib/impressionist/models/active_record/impression.rb
@@ -3,6 +3,8 @@ class Impression < ActiveRecord::Base
:controller_name, :action_name, :view_name, :request_hash, :ip_address,
:session_hash, :message, :referrer
+ belongs_to :impressionable, :polymorphic=>true
+
after_save :update_impressions_counter_cache
private
View
2 lib/impressionist/models/mongo_mapper/impression.rb
@@ -13,4 +13,6 @@ class Impression
key :message, String
key :referrer, String
timestamps!
+
+ belongs_to :impressionable, :polymorphic=>true
end

0 comments on commit 00e658b

Please sign in to comment.