aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-01-07 17:12:47 +0100
committerHarald Eilertsen <haraldei@anduin.net>2018-01-07 17:12:47 +0100
commit41b0d6bc69e3b0f751290b442e2f171a0ae8090d (patch)
tree4b4059c080729e26e0ef6e7a7b64c370dfcd4e5d /vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb
parenta43ed4dcf9173a6faadf260fb1bd93aa2d391257 (diff)
downloadhmnoweb-41b0d6bc69e3b0f751290b442e2f171a0ae8090d.tar.gz
hmnoweb-41b0d6bc69e3b0f751290b442e2f171a0ae8090d.tar.bz2
hmnoweb-41b0d6bc69e3b0f751290b442e2f171a0ae8090d.zip
Split GalleryLink header into date, venue and bands.
Diffstat (limited to 'vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb')
-rw-r--r--vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb b/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb
index e275fb2..0c7a204 100644
--- a/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb
+++ b/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb
@@ -5,9 +5,14 @@ module Refinery
belongs_to :image, class_name: ::Refinery::Image
- attr_accessible :title, :url, :photographer, :description, :image_id, :position
+ attr_accessible :date, :bands, :venue, :url, :photographer, :description, :image_id, :position
- validates :title, :presence => true, :uniqueness => true
+ validates :date, :presence => true
+ validates :bands, :presence => true
+
+ def title
+ "#{date.try(:strftime, '%d/%m/%y')}: #{bands} @ #{venue}"
+ end
end
end
end