heylium_app/app/models/gallery_image.rb
Nicolas Bally 8e18de4077 initial
2016-08-03 00:22:29 +02:00

19 lines
391 B
Ruby
Executable File

# -*- encoding : utf-8 -*-
class GalleryImage < ActiveRecord::Base
belongs_to :image_file
belongs_to :big_image_file, :class_name => "ImageFile"
belongs_to :gallery
belongs_to :gallery_content
validates :title, :presence => true
def tags_class
to_r = []
self.tags.to_s.split(",").each do |tag|
to_r << tag.to_slug
end
to_r = to_r.join(" ")
end
end