This repository was archived by the owner on Mar 18, 2025. It is now read-only.
File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ def self.table_name_prefix
221
221
class Namespaced ::Model < ActiveRecord ::Base
222
222
include AlgoliaSearch
223
223
224
- algoliasearch :synchronous => true do
224
+ algoliasearch :synchronous => true , :index_name => safe_index_name ( algolia_index_name ( { } ) ) do
225
225
attribute :customAttr do
226
226
40 + another_private_value
227
227
end
@@ -637,18 +637,18 @@ class SerializedObject < ActiveRecord::Base
637
637
end
638
638
639
639
it "should have an index name without :: hierarchy" do
640
- Namespaced ::Model . index_name . should == "Namespaced_Model"
640
+ ( Namespaced ::Model . index_name . end_with? ( "Namespaced_Model" ) ) . should == true
641
641
end
642
642
643
643
it "should use the block to determine attribute's value" do
644
- m = Namespaced ::Model . new ( another_private_value : 2 )
644
+ m = Namespaced ::Model . new ( :another_private_value => 2 )
645
645
attributes = Namespaced ::Model . algoliasearch_settings . get_attributes ( m )
646
646
attributes [ 'customAttr' ] . should == 42
647
647
attributes [ 'myid' ] . should == m . id
648
648
end
649
649
650
650
it "should always update when there is no custom _changed? function" do
651
- m = Namespaced ::Model . create! ( another_private_value : 2 )
651
+ m = Namespaced ::Model . create! ( :another_private_value => 2 )
652
652
results = Namespaced ::Model . search ( 42 )
653
653
expect ( results . size ) . to eq ( 1 )
654
654
expect ( results [ 0 ] . id ) . to eq ( m . id )
You can’t perform that action at this time.
0 commit comments