Sha256: 084d2f20b8fc458e0e0679ef79b4fb9b4048b7520c767212337d15f6aa29c9ac
Contents?: true
Size: 595 Bytes
Versions: 1
Compression:
Stored size: 595 Bytes
Contents
module Elabs class Language < ApplicationRecord self.table_name = 'languages' validates :iso639_1, presence: true validates :name, presence: true has_many :albums has_many :articles has_many :notes has_many :projects has_many :uploads scope :with_content_only, -> { where.not(albums_count: 0).or(where.not(articles_count: 0)).or(where.not(notes_count: 0)).or(where.not(projects_count: 0)).or(where.not(uploads_count: 0)) } scope :available_site_translations, -> { select(:id, :name, :iso639_1).where(iso639_1: I18n.available_locales) } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
elabs-2.0.0.pre | app/models/elabs/language.rb |