Add == and update search

This commit is contained in:
Justin Edmund 2022-12-02 11:20:22 -08:00
parent aa5d2451a8
commit d1eba7aed8

View file

@ -4,24 +4,28 @@ class JobSkill < ApplicationRecord
belongs_to :job belongs_to :job
pg_search_scope :en_search, pg_search_scope :en_search,
against: :name_en, against: :name_en,
using: { using: {
tsearch: { tsearch: {
prefix: true, prefix: true,
dictionary: "simple" dictionary: "simple",
} },
} }
pg_search_scope :jp_search, pg_search_scope :jp_search,
against: :name_jp, against: :name_jp,
using: { using: {
tsearch: { tsearch: {
prefix: true, prefix: true,
dictionary: "simple" dictionary: "simple",
} },
} }
def display_resource(skill) def display_resource(skill)
skill.name_en skill.name_en
end end
def ==(other)
self.class == other.class && @id == other.id
end
end end