Class: Localization
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Localization
- Defined in:
- app/models/localization.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.locales ⇒ Object
7 8 9 |
# File 'app/models/localization.rb', line 7 def locales order("locale ASC").pluck(Arel.sql("DISTINCT locale")) end |
.names ⇒ Object
11 12 13 |
# File 'app/models/localization.rb', line 11 def names order("name ASC").pluck(Arel.sql("DISTINCT name")) end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'app/models/localization.rb', line 16 def to_s value || "" end |
#translate(locale) ⇒ Object
22 23 24 |
# File 'app/models/localization.rb', line 22 def translate(locale) localizable.localizations.find_by(name: name, locale: locale) end |