20 lines
406 B
Ruby
20 lines
406 B
Ruby
class ImageActuAlbum < ActiveRecord::Base
|
|
belongs_to :image_file
|
|
|
|
has_many :image_actu_album_langs, dependent: :destroy
|
|
|
|
accepts_nested_attributes_for :image_actu_album_langs
|
|
|
|
has_many :image_actus, :dependent => :destroy
|
|
|
|
|
|
def lang(locale)
|
|
self.image_actu_album_langs.find_by_lang_site_id(LangSite.find_by_slug(locale).id)
|
|
end
|
|
|
|
|
|
def name
|
|
self.lang("fr").name
|
|
end
|
|
end
|