SHOW:
|
|
- or go back to the newest paste.
| 1 | class Company < ActiveRecord::Base | |
| 2 | - | has_one :logo_attachment, as: :attachable |
| 2 | + | has_one :logo, as: :attachable |
| 3 | ||
| 4 | ... | |
| 5 | ||
| 6 | def logo_url | |
| 7 | - | attachment = logo_attachment |
| 7 | + | logo ? logo.file.url : "" |
| 8 | - | attachment ? attachment.file.url : '' |
| 8 | + | |
| 9 | end |