Changeset 1268

Show
Ignore:
Timestamp:
07/28/08 15:11:57 (5 months ago)
Author:
alban
Message:

Mise en place de show.(not_)broadcasted_episodes dans le LiquidDrop? de Show. Refs #12

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/models/episode.rb

    r1261 r1268  
    11class Episode < ActiveRecord::Base 
    22  acts_as_taggable 
     3 
     4  named_scope :broadcasted, lambda { {:conditions => ["broadcasted_at < ?", Time.now] } } 
     5  named_scope :not_broadcasted, lambda { {:conditions => ["broadcasted_at > ?", Time.now] } } 
    36 
    47  liquid_methods :show, :title, :description, :image, :contents, :broadcasted_at 
  • trunk/app/models/show.rb

    r1239 r1268  
    4444class Show::LiquidDropClass 
    4545 
     46  def broadcasted_episodes 
     47    @object.episodes.broadcasted 
     48  end 
     49 
     50  def not_broadcasted_episodes 
     51    @object.episodes.not_broadcasted 
     52  end 
     53 
    4654  def url_for 
    4755    view.url_for_show(@object)