Sha256: 5e444c6e98b205c4fcf5c927be038f2749bc7ab39cce0d9d154deb48c8bdb07c

Contents?: true

Size: 560 Bytes

Versions: 24

Compression:

Stored size: 560 Bytes

Contents

require 'rails'
require 'ostruct'

module ActiveRecordSchema
  
  def config
    @config ||= OpenStruct.new
    @config.autoload_paths ||= [
       Rails.root.join('app', 'models', '*.rb'),
       Rails.root.join('app', 'models', '**', '*.rb') 
    ]
    @config
  end
  module_function :config
  
  def autoload_paths
    config.autoload_paths.map {|p| Dir.glob(p) }.flatten! 
  end
  module_function :autoload_paths

end

require 'active_record_schema/base'
require 'active_record_schema/railtie'

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
active_record_schema-0.2.4 lib/active_record_schema.rb
active_record_schema-0.2.2 lib/active_record_schema.rb
active_record_schema-0.2.1 lib/active_record_schema.rb
active_record_schema-0.2.0 lib/active_record_schema.rb