update spec models

This commit is contained in:
Bilal Catic
2020-02-11 13:34:49 +01:00
parent 94767d2b24
commit c7ae81a533

View File

@@ -5,6 +5,12 @@ class VectorModel < ActiveRecord::Base
pg_search fields: %i[vector_models.id vector_models.name vector_models.value], cache: :search_cache
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
self.table_name = :vector_models
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
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
self.table_name = :vector_models
include PgSearchable
@@ -72,7 +72,7 @@ end
class DynamicModelWithTagValues < ActiveRecord::Base
self.table_name = :dynamic_models
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
end