Skip to content

Commit

Permalink
fix for bug undefined method 'belongs_to' for Impression:Class
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Elfassy committed Oct 10, 2012
1 parent 7a93fff commit 00e658b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/models/impression.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
class Impression
belongs_to :impressionable, :polymorphic=>true
end
2 changes: 2 additions & 0 deletions lib/impressionist/models/active_record/impression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/impressionist/models/mongo_mapper/impression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.