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

Version Path
globalize3-0.1.0 lib/globalize/versioning/vestal_versions.rb
globalize3-0.1.0.beta2 lib/globalize/versioning/vestal_versions.rb
globalize3-jovoto-0.1.0.beta lib/globalize/versioning/vestal_versions.rb
globalize3-0.1.0.beta lib/globalize/versioning/vestal_versions.rb
globalize3-0.0.11 lib/globalize/versioning/vestal_versions.rb
globalize3-0.0.10 lib/globalize/versioning/vestal_versions.rb
globalize3-0.0.9 lib/globalize/versioning/vestal_versions.rb
globalize3-0.0.7 lib/globalize/versioning/vestal_versions.rb
globalize3-0.0.5 lib/globalize/versioning/vestal_versions.rb