spec/integration/associations_spec.rb in pg_search-1.0.6 vs spec/integration/associations_spec.rb in pg_search-2.0.0
- old
+ new
@@ -10,11 +10,11 @@
end
with_model :ModelWithoutAgainst do
table do |t|
t.string "title"
- t.belongs_to :another_model
+ t.belongs_to :another_model, :index => false
end
model do
include PgSearch
belongs_to :another_model, :class_name => 'AssociatedModel'
@@ -47,11 +47,11 @@
end
with_model :ModelWithBelongsTo do
table do |t|
t.string 'title'
- t.belongs_to 'another_model'
+ t.belongs_to 'another_model', index: false
end
model do
include PgSearch
belongs_to :another_model, :class_name => 'AssociatedModel'
@@ -77,11 +77,11 @@
context "through a has_many association" do
with_model :AssociatedModelWithHasMany do
table do |t|
t.string 'title'
- t.belongs_to 'ModelWithHasMany'
+ t.belongs_to 'ModelWithHasMany', index: false
end
end
with_model :ModelWithHasMany do
table do |t|
@@ -142,26 +142,24 @@
context "across multiple associations" do
context "on different tables" do
with_model :FirstAssociatedModel do
table do |t|
t.string 'title'
- t.belongs_to 'ModelWithManyAssociations'
+ t.belongs_to 'ModelWithManyAssociations', index: false
end
- model {}
end
with_model :SecondAssociatedModel do
table do |t|
t.string 'title'
end
- model {}
end
with_model :ModelWithManyAssociations do
table do |t|
t.string 'title'
- t.belongs_to 'model_of_second_type'
+ t.belongs_to 'model_of_second_type', index: false
end
model do
include PgSearch
@@ -209,14 +207,13 @@
context "on the same table" do
with_model :DoublyAssociatedModel do
table do |t|
t.string 'title'
- t.belongs_to 'ModelWithDoubleAssociation'
- t.belongs_to 'ModelWithDoubleAssociation_again'
+ t.belongs_to 'ModelWithDoubleAssociation', index: false
+ t.belongs_to 'ModelWithDoubleAssociation_again', index: false
end
- model {}
end
with_model :ModelWithDoubleAssociation do
table do |t|
t.string 'title'
@@ -277,11 +274,11 @@
end
end
with_model :ModelWithAssociation do
table do |t|
- t.belongs_to 'another_model'
+ t.belongs_to 'another_model', index: false
end
model do
include PgSearch
belongs_to :another_model, :class_name => 'AssociatedModel'
@@ -404,10 +401,10 @@
end
with_model :AssociatedModel do
table do |t|
t.string :content
- t.belongs_to :model_with_association
+ t.belongs_to :model_with_association, index: false
end
model do
include PgSearch
belongs_to :model_with_association