freelancing-god-thinking-sphinx 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/thinking_sphinx/search.rb +2 -2
- data/lib/thinking_sphinx.rb +1 -1
- data/spec/lib/thinking_sphinx/search_spec.rb +10 -10
- metadata +1 -1
@@ -495,8 +495,8 @@ module ThinkingSphinx
|
|
495
495
|
{
|
496
496
|
:latitude => options[:geo] ? options[:geo].first : options[:lat],
|
497
497
|
:longitude => options[:geo] ? options[:geo].last : options[:lng],
|
498
|
-
:latitude_attribute => latitude_attr,
|
499
|
-
:longitude_attribute => longitude_attr
|
498
|
+
:latitude_attribute => latitude_attr.to_s,
|
499
|
+
:longitude_attribute => longitude_attr.to_s
|
500
500
|
}
|
501
501
|
end
|
502
502
|
|
data/lib/thinking_sphinx.rb
CHANGED
@@ -563,8 +563,8 @@ describe ThinkingSphinx::Search do
|
|
563
563
|
:classes => [Alpha]
|
564
564
|
).first
|
565
565
|
|
566
|
-
@client.anchor[:latitude_attribute].should ==
|
567
|
-
@client.anchor[:longitude_attribute].should ==
|
566
|
+
@client.anchor[:latitude_attribute].should == 'lat'
|
567
|
+
@client.anchor[:longitude_attribute].should == 'lng'
|
568
568
|
end
|
569
569
|
|
570
570
|
it "should detect lat and lon attributes on the given model" do
|
@@ -573,8 +573,8 @@ describe ThinkingSphinx::Search do
|
|
573
573
|
:classes => [Beta]
|
574
574
|
).first
|
575
575
|
|
576
|
-
@client.anchor[:latitude_attribute].should ==
|
577
|
-
@client.anchor[:longitude_attribute].should ==
|
576
|
+
@client.anchor[:latitude_attribute].should == 'lat'
|
577
|
+
@client.anchor[:longitude_attribute].should == 'lon'
|
578
578
|
end
|
579
579
|
|
580
580
|
it "should detect latitude and longitude attributes on the given model" do
|
@@ -583,8 +583,8 @@ describe ThinkingSphinx::Search do
|
|
583
583
|
:classes => [Person]
|
584
584
|
).first
|
585
585
|
|
586
|
-
@client.anchor[:latitude_attribute].should ==
|
587
|
-
@client.anchor[:longitude_attribute].should ==
|
586
|
+
@client.anchor[:latitude_attribute].should == 'latitude'
|
587
|
+
@client.anchor[:longitude_attribute].should == 'longitude'
|
588
588
|
end
|
589
589
|
|
590
590
|
it "should accept manually defined latitude and longitude attributes" do
|
@@ -595,8 +595,8 @@ describe ThinkingSphinx::Search do
|
|
595
595
|
:longitude_attr => :leftright
|
596
596
|
).first
|
597
597
|
|
598
|
-
@client.anchor[:latitude_attribute].should ==
|
599
|
-
@client.anchor[:longitude_attribute].should ==
|
598
|
+
@client.anchor[:latitude_attribute].should == 'updown'
|
599
|
+
@client.anchor[:longitude_attribute].should == 'leftright'
|
600
600
|
end
|
601
601
|
|
602
602
|
it "should accept manually defined latitude and longitude attributes in the given model" do
|
@@ -605,8 +605,8 @@ describe ThinkingSphinx::Search do
|
|
605
605
|
:classes => [Friendship]
|
606
606
|
).first
|
607
607
|
|
608
|
-
@client.anchor[:latitude_attribute].should ==
|
609
|
-
@client.anchor[:longitude_attribute].should ==
|
608
|
+
@client.anchor[:latitude_attribute].should == 'person_id'
|
609
|
+
@client.anchor[:longitude_attribute].should == 'person_id'
|
610
610
|
end
|
611
611
|
|
612
612
|
it "should accept geo array for geo-position values" do
|