Module: RailsUploads::ActiveRecord::Base::ClassMethods
- Defined in:
- lib/rails_uploads/active_record/base.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
58 59 60 |
# File 'lib/rails_uploads/active_record/base.rb', line 58 def end |
Class Method Details
.extended(base) ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'lib/rails_uploads/active_record/base.rb', line 60 def self.extended(base) [:file, :image].each do |type| base.send(:define_singleton_method, "attached_#{type}") do |*args| = args. [:type] = type *args.append() end end end |
Instance Method Details
#inherited(subclass) ⇒ Object
70 71 72 73 |
# File 'lib/rails_uploads/active_record/base.rb', line 70 def inherited(subclass) subclass.instance_variable_set(:@attachments, ) super end |
#is_attachable? ⇒ Boolean
75 76 77 |
# File 'lib/rails_uploads/active_record/base.rb', line 75 def is_attachable? .present? end |