Class: Paperclip::HasAttachedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/paperclip/has_attached_file.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, name, options) ⇒ HasAttachedFile

Returns a new instance of HasAttachedFile.



7
8
9
10
11
# File 'lib/paperclip/has_attached_file.rb', line 7

def initialize(klass, name, options)
  @klass = klass
  @name = name
  @options = options
end

Class Method Details

.define_on(klass, name, options) ⇒ Object



3
4
5
# File 'lib/paperclip/has_attached_file.rb', line 3

def self.define_on(klass, name, options)
  new(klass, name, options).define
end

Instance Method Details

#defineObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/paperclip/has_attached_file.rb', line 13

def define
  define_flush_errors
  define_getters
  define_setter
  define_query
  register_new_attachment
  add_active_record_callbacks
  add_paperclip_callbacks
  add_required_validations
end