AppScreenshotレールhas_manyの範囲
class AppScreenshot < ActiveRecord::Base include Cacheable belongs_to :app model_cache do with_key end scope :available , where(["state > ? and is_icon = ? ",0,0]) end
アプリケーション:
class App < ActiveRecord::Base include Cacheable #acts_as_cached :ttl => 30.minutes has_many :apk_files has_many :app_screenshots.available end
なぜhas_many :app_screenshots.available
?