Sha256: 000f4db3c58bfd60d46b1582207a4936be2413fe8da67c72e604ec7169a01848
Contents?: true
Size: 586 Bytes
Versions: 63
Compression:
Stored size: 586 Bytes
Contents
module Tenon class I18nLookup def initialize(klass) @klass = klass end def fields self.class.fields[:tables][@klass.to_s.underscore.pluralize.to_sym] || [] end def self.fields @@fields ||= set_fields end def self.set_fields default = { tables: {} } if File.exist?(config_file) result = YAML.load(File.open(config_file)).recursive_symbolize_keys! result || default else default end end def self.config_file File.join(Rails.root, 'config/i18n_fields.yml') end end end
Version data entries
63 entries across 63 versions & 1 rubygems