Sha256: d320d81be3917a9930357cce670b751bc0e555052241af7756308d57c7a612de

Contents?: true

Size: 850 Bytes

Versions: 5

Compression:

Stored size: 850 Bytes

Contents

Dir[File.join(File.dirname(__FILE__), 'has_many_translations', '*.rb')].each{|f| require f }

require 'rtranslate'
require 'activequeue'

# The base module that gets included in ActiveRecord::Base. See the documentation for
# HasManyTranslations::ClassMethods for more useful information.
module HasManyTranslations
  
  
  def self.included(base) # :nodoc:
    base.class_eval do
      extend ClassMethods
      extend Translated
    end
  end
  
  module ClassMethods
    def translated(options = {}, &block)
      return if translated?
      
      include Options
      include TranslationJobs
      include Creation
      include Translations
      prepare_translated_options(options)
      has_many :translations, options, &block
      
    end
    
  end
  
  extend Configuration
  
end

ActiveRecord::Base.send(:include, HasManyTranslations)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
has_many_translations-0.3.8 lib/has_many_translations.rb
has_many_translations-0.3.7 lib/has_many_translations.rb
has_many_translations-0.3.6 lib/has_many_translations.rb
has_many_translations-0.3.4 lib/has_many_translations.rb
has_many_translations-0.3.3 lib/has_many_translations.rb