lib/magic_addresses.rb in magic_addresses-0.0.4 vs lib/magic_addresses.rb in magic_addresses-0.0.5

- old
+ new

@@ -11,11 +11,12 @@ require "app/models/magic_addresses/translator" require "app/models/magic_addresses" require "helpers/mgca_helper" -require "magic_addresses/railtie" if defined?(Rails::Railtie) +# require "magic_addresses/railtie" if defined?(Rails::Railtie) +require "magic_addresses/rails" if defined?(Rails) module MagicAddresses # models autoload :Address, "app/models/magic_addresses/address" @@ -53,27 +54,23 @@ def configure self.configuration ||= Configuration.new yield(configuration) end - end - - class Engine < ::Rails::Engine + def self.root + File.expand_path '../..', __FILE__ + end end - def self.root - File.expand_path '../..', __FILE__ - end - end ActiveSupport.on_load(:active_record) do require 'globalize' require 'geocoder' end -ActionController::Base.prepend_view_path "#{root}/app/views" +ActionController::Base.prepend_view_path "#{MagicAddresses.root}/app/views" # => ActionController::Base.append_view_path File.dirname(__FILE__) + "app/views" #require 'geocoder' ActiveRecord::Base.send :include, MagicAddresses::Association \ No newline at end of file