Changeset 1239

Show
Ignore:
Timestamp:
07/24/08 17:31:32 (6 months ago)
Author:
alban
Message:

Merge des liquid_methods

Files:

Legend:

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

    r1201 r1239  
    11class Image < ActiveRecord::Base 
     2 
     3  liquid_methods :width, :height 
     4 
    25  belongs_to :show 
    36  has_attachment :storage => :file_system, :max_size => 300.kilobytes, :content_type => :image, :thumbnails => { :normal => '200>', :thumb => '75' } 
    47  validates_as_attachment 
    58end 
     9 
     10class Image::LiquidDropClass 
     11 
     12  def url_for 
     13    view.image_path @object.public_filename(:normal) 
     14  end 
     15 
     16  def url_for_thumb 
     17    view.image_path @object.public_filename(:thumb) 
     18  end 
     19 
     20  def tag 
     21    view.image_tag @object.public_filename(:normal) 
     22  end 
     23 
     24  def tag_for_thumb 
     25    view.image_tag @object.public_filename(:thumb) 
     26  end 
     27 
     28end 
  • trunk/app/models/show.rb

    r1236 r1239  
    44  belongs_to :template 
    55 
    6   liquid_methods :name, :description, :episodes 
     6  liquid_methods :name, :description, :episodes, :logo 
    77 
    88  def after_initialize