Skip to content

Commit

Permalink
index_definition_path -> indices_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert L. Carpenter committed Aug 10, 2016
1 parent f4655c2 commit 0b4775f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/chewy/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Config

# Where Chewy expects to find index definitions
# within a Rails app folder.
:index_definition_path
:indices_path

def self.delegated
public_instance_methods - self.superclass.public_instance_methods - Singleton.public_instance_methods
Expand All @@ -53,7 +53,7 @@ def initialize
@root_strategy = :base
@request_strategy = :atomic
@use_after_commit_callbacks = true
@index_definition_path = 'app/chewy'
@indices_path = 'app/chewy'
end

def transport_logger= logger
Expand Down
4 changes: 2 additions & 2 deletions lib/chewy/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def migrate(*args)
app.config.middleware.insert_after(Rails::Rack::Logger, RequestStrategy)
end

initializer 'chewy.add_index_definition_path' do |app|
initializer 'chewy.add_indices_path' do |app|
Chewy::Railtie.all_engines.each do |engine|
engine.paths.add Chewy.configuration[:index_definition_path]
engine.paths.add Chewy.configuration[:indices_path]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/chewy/rake_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def subscribed_task_stats(&block)
end

def eager_load_chewy!
dirs = Chewy::Railtie.all_engines.map { |engine| engine.paths[ Chewy.configuration[:index_definition_path] ] }.compact.map(&:existent).flatten.uniq
dirs = Chewy::Railtie.all_engines.map { |engine| engine.paths[ Chewy.configuration[:indices_path] ] }.compact.map(&:existent).flatten.uniq

dirs.each do |dir|
Dir.glob(File.join(dir, '**/*.rb')).each do |file|
Expand Down
2 changes: 1 addition & 1 deletion spec/chewy/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
its(:root_strategy) { should == :base }
its(:request_strategy) { should == :atomic }
its(:use_after_commit_callbacks) { should == true }
its(:index_definition_path) { should == 'app/chewy' }
its(:indices_path) { should == 'app/chewy' }

describe '#transport_logger=' do
let(:logger) { Logger.new('/dev/null') }
Expand Down

0 comments on commit 0b4775f

Please sign in to comment.