From 159ced45fde5edef4ab40b27b2defa2943cf7a3d Mon Sep 17 00:00:00 2001 From: Mikey Hogarth Date: Wed, 20 Jan 2016 08:32:44 +0000 Subject: [PATCH] alter name --- lib/chewy/index.rb | 6 +++--- spec/chewy/index_spec.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/chewy/index.rb b/lib/chewy/index.rb index e46c167af..95cb8378d 100644 --- a/lib/chewy/index.rb +++ b/lib/chewy/index.rb @@ -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 @@ -44,7 +44,7 @@ def self.index_name(suggest = nil) # Prefix to use # - def self.prefix + def self.default_prefix Chewy.configuration[:prefix] end diff --git a/spec/chewy/index_spec.rb b/spec/chewy/index_spec.rb index e2c7ef1c1..a03453351 100644 --- a/spec/chewy/index_spec.rb +++ b/spec/chewy/index_spec.rb @@ -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