spec/integration/associations_spec.rb in pg_search-2.2.0 vs spec/integration/associations_spec.rb in pg_search-2.3.0
- old
+ new
@@ -16,11 +16,11 @@
t.string "title"
t.belongs_to :another_model, index: false
end
model do
- include PgSearch
+ include PgSearch::Model
belongs_to :another_model, class_name: 'AssociatedModel'
pg_search_scope :with_another, associated_against: { another_model: :title }
end
end
@@ -53,11 +53,11 @@
t.string 'title'
t.belongs_to 'another_model', index: false
end
model do
- include PgSearch
+ include PgSearch::Model
belongs_to :another_model, class_name: 'AssociatedModel'
pg_search_scope :with_associated, against: :title, associated_against: { another_model: :title }
end
end
@@ -89,11 +89,11 @@
table do |t|
t.string 'title'
end
model do
- include PgSearch
+ include PgSearch::Model
has_many :other_models, class_name: 'AssociatedModelWithHasMany', foreign_key: 'ModelWithHasMany_id'
pg_search_scope :with_associated, against: [:title], associated_against: { other_models: :title }
end
end
@@ -161,11 +161,11 @@
t.string 'title'
t.belongs_to 'model_of_second_type', index: false
end
model do
- include PgSearch
+ include PgSearch::Model
has_many :models_of_first_type,
class_name: 'FirstAssociatedModel',
foreign_key: 'ModelWithManyAssociations_id'
@@ -220,11 +220,11 @@
table do |t|
t.string 'title'
end
model do
- include PgSearch
+ include PgSearch::Model
has_many :things,
class_name: 'DoublyAssociatedModel',
foreign_key: 'ModelWithDoubleAssociation_id'
@@ -280,11 +280,11 @@
table do |t|
t.belongs_to 'another_model', index: false
end
model do
- include PgSearch
+ include PgSearch::Model
belongs_to :another_model, class_name: 'AssociatedModel'
pg_search_scope :with_associated, associated_against: { another_model: %i[title author] }
end
end
@@ -333,11 +333,11 @@
t.integer 'number'
t.belongs_to 'another_model', index: false
end
model do
- include PgSearch
+ include PgSearch::Model
belongs_to :another_model, class_name: 'AssociatedModel'
pg_search_scope :with_associated, associated_against: { another_model: :number }
end
end
@@ -364,11 +364,11 @@
t.text :name
end
model do
has_many :children
- include PgSearch
+ include PgSearch::Model
pg_search_scope :search_name, against: :name
end
end
with_model :Child do
@@ -407,11 +407,11 @@
t.string :content
t.belongs_to :model_with_association, index: false
end
model do
- include PgSearch
+ include PgSearch::Model
belongs_to :model_with_association
pg_search_scope :search_content, against: :content
end
end
@@ -453,11 +453,11 @@
t.string :title
t.belongs_to :company
end
model do
- include PgSearch
+ include PgSearch::Model
pg_search_scope :search, against: :title, using: %i[tsearch trigram]
end
end
# https://github.com/Casecommons/pg_search/issues/106
@@ -494,10 +494,10 @@
t.string :title
t.belongs_to :company
end
model do
- include PgSearch
+ include PgSearch::Model
pg_search_scope :search, against: :title, using: %i[tsearch trigram]
end
end
# https://github.com/Casecommons/pg_search/issues/106