Module: Imagine::ModelExtensions::Image

Defined in:
lib/imagine/model_extensions/image.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(model) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/imagine/model_extensions/image.rb', line 4

def self.included(model)
  model.image_accessor :file
  model.belongs_to :album, :class_name => "Imagine::Album"
  model.validates :file, :presence => true
  model.send :extend,  ClassMethods
  model.attr_accessible :album_id, :file, :file_url
  model.send :include, InstanceMethods
end