Skip to content

Commit

Permalink
alter name
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeyhogarth committed Jan 20, 2016
1 parent dbd6669 commit 159ced4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/chewy/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class Index
#
def self.index_name(suggest = nil)
if suggest
@index_name = build_index_name(suggest, prefix: prefix)
@index_name = build_index_name(suggest, prefix: default_prefix)
else
@index_name ||= begin
build_index_name(
name.sub(/Index\Z/, '').demodulize.underscore,
prefix: Chewy.configuration[:prefix]
prefix: default_prefix
) if name
end
end
Expand All @@ -44,7 +44,7 @@ def self.index_name(suggest = nil)

# Prefix to use
#
def self.prefix
def self.default_prefix
Chewy.configuration[:prefix]
end

Expand Down
4 changes: 2 additions & 2 deletions spec/chewy/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
end
end

describe '.prefix' do
describe '.default_prefix' do
before { allow(Chewy).to receive_messages(configuration: {prefix: 'testing'}) }
specify { expect(Class.new(Chewy::Index).prefix).to eq('testing') }
specify { expect(Class.new(Chewy::Index).default_prefix).to eq('testing') }
end

describe '.define_type' do
Expand Down

0 comments on commit 159ced4

Please sign in to comment.