Displaying 1 result from an estimated 1 matches for "recently_viewed_products".
2008 May 21
2
Replacing ActiveRecordStore::Session with a custom model
...ord::Base
has_many :product_viewings, :dependent => :destroy
has_many :products, :through => :product_viewings, :limit =>
10, :include => :image
belongs_to :order
belongs_to :user
end
In my controller I would like to do something like
session.model.user = @user
and
@recently_viewed_products = session.model.products
Because I cannot replace ActiveRecordStore::Session with my session
class above I have to do instead:
session.model.user_id = @user.id
and
@recently_viewed_products =
Session.find_by_session_id(session.session_id).products
I don''t think it''s unreaso...