Sha256: 3eabaaa97b8d6366f2220b679241b6fb6a22c97aebb4856dc7b354c3b7002abd
Contents?: true
Size: 517 Bytes
Versions: 10
Compression:
Stored size: 517 Bytes
Contents
module Globalize module ActiveRecord class Translation < ::ActiveRecord::Base class << self def with_locales(*locales) where(:locale => locales.flatten.map(&:to_s)) end alias with_locale with_locales def translated_locales select('DISTINCT locale').map(&:locale) end end def locale read_attribute(:locale).to_sym end def locale=(locale) write_attribute(:locale, locale.to_s) end end end end
Version data entries
10 entries across 10 versions & 2 rubygems