Skip to content

Commit

Permalink
use Rails.root
Browse files Browse the repository at this point in the history
  • Loading branch information
Frazer Horn authored and Angelines Tomas committed Jan 7, 2011
1 parent 7ca65d6 commit f7e3e47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/escargot.rake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace :escargot do

task :load_all_models do
models = ActiveRecord::Base.send(:subclasses)
Dir["#{RAILS_ROOT}/app/models/*.rb", "#{RAILS_ROOT}/app/models/*/*.rb"].each do |file|
Dir["#{Rails.root}/app/models/*.rb", "#{Rails.root}/app/models/*/*.rb"].each do |file|
model = File.basename(file, ".*").classify
unless models.include?(model)
require file
Expand Down
3 changes: 1 addition & 2 deletions rails/init.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'elasticsearch'
require 'escargot'

ActiveRecord::Base.class_eval do
Expand All @@ -13,7 +12,7 @@
include Escargot::AdminIndexVersions
end

unless File.exists?(RAILS_ROOT + "/config/elasticsearch.yml")
unless File.exists?(Rails.root + "/config/elasticsearch.yml")
Rails.logger.warn "No config/elastic_search.yaml file found, connecting to localhost:9200"
$elastic_search_client = ElasticSearch.new("localhost:9200")
else
Expand Down

0 comments on commit f7e3e47

Please sign in to comment.