spec/integration/associations_spec.rb in pg_search-2.0.1 vs spec/integration/associations_spec.rb in pg_search-2.1.0
- old
+ new
@@ -281,11 +281,11 @@
model do
include PgSearch
belongs_to :another_model, :class_name => 'AssociatedModel'
- pg_search_scope :with_associated, :associated_against => {:another_model => [:title, :author]}
+ pg_search_scope :with_associated, :associated_against => {:another_model => %i[title author]}
end
end
it "should only do one join" do
included = [
@@ -327,18 +327,18 @@
end
with_model :Model do
table do |t|
t.integer 'number'
- t.belongs_to 'another_model'
+ t.belongs_to 'another_model', index: false
end
model do
include PgSearch
- belongs_to :another_model, :class_name => 'AssociatedModel'
+ belongs_to :another_model, class_name: 'AssociatedModel'
- pg_search_scope :with_associated, :associated_against => {:another_model => :number}
+ pg_search_scope :with_associated, associated_against: {another_model: :number}
end
end
it "should cast the columns to text" do
associated = AssociatedModel.create!(:number => 123)
@@ -452,11 +452,11 @@
t.belongs_to :company
end
model do
include PgSearch
- pg_search_scope :search, :against => :title, :using => [:tsearch, :trigram]
+ pg_search_scope :search, :against => :title, :using => %i[tsearch trigram]
end
end
# https://github.com/Casecommons/pg_search/issues/106
it "should handle numbers in a trigram query properly" do
@@ -493,10 +493,10 @@
t.belongs_to :company
end
model do
include PgSearch
- pg_search_scope :search, :against => :title, :using => [:tsearch, :trigram]
+ pg_search_scope :search, :against => :title, :using => %i[tsearch trigram]
end
end
# https://github.com/Casecommons/pg_search/issues/106
it "should handle numbers in a trigram query properly" do