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

This commit is contained in:
Michael Elfassy 2012-10-10 12:03:18 -04:00
parent 7a93fff255
commit 00e658b28d
3 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,2 @@
class Impression class Impression
belongs_to :impressionable, :polymorphic=>true
end end

View File

@ -3,6 +3,8 @@ class Impression < ActiveRecord::Base
:controller_name, :action_name, :view_name, :request_hash, :ip_address, :controller_name, :action_name, :view_name, :request_hash, :ip_address,
:session_hash, :message, :referrer :session_hash, :message, :referrer
belongs_to :impressionable, :polymorphic=>true
after_save :update_impressions_counter_cache after_save :update_impressions_counter_cache
private private

View File

@ -13,4 +13,6 @@ class Impression
key :message, String key :message, String
key :referrer, String key :referrer, String
timestamps! timestamps!
belongs_to :impressionable, :polymorphic=>true
end end