Class: ActiveRecord::Mlang::Lang
- Inherits:
-
Base
- Object
- Base
- ActiveRecord::Mlang::Lang
- Includes:
- ActiveRecord::Mlang
- Defined in:
- lib/active_record/mlang/lang.rb
Class Method Summary collapse
Methods included from ActiveRecord::Mlang
Class Method Details
.[](locale_or_lang_id) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/active_record/mlang/lang.rb', line 6 def self.[] locale_or_lang_id if locale_or_lang_id.kind_of? Integer self.find_by(id: locale_or_lang_id) else self.find_by(code: locale_or_lang_id) end end |