Sha256: 11feb05c6a7b2839a587df1b191414a8cf711e07df62078e6330aa88fa010f30
Contents?: true
Size: 705 Bytes
Versions: 9
Compression:
Stored size: 705 Bytes
Contents
require 'vestal_versions' module Globalize module Versioning module VestalVersions def versioned_columns super + self.class.translated_attribute_names end end end end ActiveRecord::Base.class_eval do class << self def versioned_with_globalize(*args) versioned_without_globalize(*args) include Globalize::Versioning::VestalVersions end alias_method_chain :versioned, :globalize end end VestalVersions::Version.class_eval do before_save do |version| version.locale = Globalize.locale.to_s end class Condition def to_sql "locale = '#{Globalize.locale.to_s}'" end end default_scope(:conditions => Condition.new) end
Version data entries
9 entries across 9 versions & 2 rubygems