update spec models
This commit is contained in:
@@ -5,6 +5,12 @@ class VectorModel < ActiveRecord::Base
|
|||||||
pg_search fields: %i[vector_models.id vector_models.name vector_models.value], cache: :search_cache
|
pg_search fields: %i[vector_models.id vector_models.name vector_models.value], cache: :search_cache
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class VectorModelWithMappings < ActiveRecord::Base
|
||||||
|
self.table_name = :vector_models
|
||||||
|
include PgSearchable
|
||||||
|
pg_search fields: %i[vector_models.id vector_models.name vector_models.value], fields_mappings: {device_id: "vector_models.id"}, cache: :search_cache
|
||||||
|
end
|
||||||
|
|
||||||
class VectorModelWithoutCallback < ActiveRecord::Base
|
class VectorModelWithoutCallback < ActiveRecord::Base
|
||||||
self.table_name = :vector_models
|
self.table_name = :vector_models
|
||||||
include PgSearchable
|
include PgSearchable
|
||||||
@@ -35,12 +41,6 @@ class SimpleVectorModel < ActiveRecord::Base
|
|||||||
pg_search fields: %i[vector_models.id vector_models.name vector_models.value], cache: :search_cache, language: :simple
|
pg_search fields: %i[vector_models.id vector_models.name vector_models.value], cache: :search_cache, language: :simple
|
||||||
end
|
end
|
||||||
|
|
||||||
class SimplePlayerModel < ActiveRecord::Base
|
|
||||||
self.table_name = :players
|
|
||||||
include PgSearchable
|
|
||||||
pg_search fields: %i[device_id name value tags], cache: :search_cache, language: :simple
|
|
||||||
end
|
|
||||||
|
|
||||||
class VectorWithoutWildcardModel < ActiveRecord::Base
|
class VectorWithoutWildcardModel < ActiveRecord::Base
|
||||||
self.table_name = :vector_models
|
self.table_name = :vector_models
|
||||||
include PgSearchable
|
include PgSearchable
|
||||||
@@ -72,7 +72,7 @@ end
|
|||||||
class DynamicModelWithTagValues < ActiveRecord::Base
|
class DynamicModelWithTagValues < ActiveRecord::Base
|
||||||
self.table_name = :dynamic_models
|
self.table_name = :dynamic_models
|
||||||
include PgSearchable
|
include PgSearchable
|
||||||
pg_search fields: %i[dynamic_models.id dynamic_models.name dynamic_models.value tags.value], joins: [:tags]
|
pg_search fields: %i[dynamic_models.id dynamic_models.name dynamic_models.value], fields_mappings: {tag: 'tags.value'}, joins: [:tags]
|
||||||
has_many :tags, as: :taggable
|
has_many :tags, as: :taggable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user