Created
August 4, 2014 12:06
-
-
Save DriesS/e95ba093d36b5f87a52f to your computer and use it in GitHub Desktop.
Cache problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product < StatisticsModel | |
has_one :active_sale, :class_name => 'Sale', :foreign_key => 'product_id', :conditions => ["sales.start_date <= ? AND (sales.end_date IS NULL OR sales.end_date > ?)", Time.zone.now, Time.zone.now], :order => "sales.start_date desc" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductStatistic < ActiveRecord::Base | |
attr_protected | |
belongs_to :product | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment