Sha256: 6946b71e73d403eb93a05ba7ab2d962904a5ea34abbe9376b2e1c9343a57a817
Contents?: true
Size: 522 Bytes
Versions: 9
Compression:
Stored size: 522 Bytes
Contents
module HasManyTranslations # An extension module for the +has_many+ association with translations. module Translations # Returns all translations for given language. def by_lang(lang) all(:conditions => "#{aliased_table_name}.locale_code eq '#{lang}'") end # def by_locale(locale) # first(:conditions => { :locale => locale.to_s }) # end # # def by_locales(locales) # all(:conditions => { :locale => locales.map(&:to_s) }) # end end end
Version data entries
9 entries across 9 versions & 1 rubygems