Module: Bulldog::HasAttachment
- Defined in:
- lib/bulldog/has_attachment.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Instance Method Summary collapse
-
#has_attachment(name, &block) ⇒ Object
Declare that this model has an attachment.
Instance Method Details
#has_attachment(name, &block) ⇒ Object
Declare that this model has an attachment.
TODO: example that shows all the options.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bulldog/has_attachment.rb', line 8 def (name, &block) unless include?(InstanceMethods) extend ClassMethods include InstanceMethods end reflection = [name] || Reflection.new(self, name) reflection.configure(&block) unless .key?(name) [name] = reflection (reflection.name) (reflection.name) end end |