Module: PageAttachmentAssociations::InstanceMethods
- Defined in:
- app/models/page_attachment_associations.rb
Instance Method Summary collapse
-
#attachment(name) ⇒ Object
Currently recursive, but could be simplified with some SQL.
Instance Method Details
#attachment(name) ⇒ Object
Currently recursive, but could be simplified with some SQL
15 16 17 18 |
# File 'app/models/page_attachment_associations.rb', line 15 def (name) att = .find(:first, :conditions => ["filename LIKE ?", name.to_s]) att.blank? ? ((parent.(name) if parent) or nil) : att end |