hensei-api/app/models/job_skill.rb
2022-12-21 00:22:47 -08:00

35 lines
752 B
Ruby

# frozen_string_literal: true
class JobSkill < ApplicationRecord
alias eql? ==
include PgSearch::Model
belongs_to :job
pg_search_scope :en_search,
against: :name_en,
using: {
tsearch: {
prefix: true,
dictionary: 'simple'
}
}
pg_search_scope :jp_search,
against: :name_jp,
using: {
tsearch: {
prefix: true,
dictionary: 'simple'
}
}
def display_resource(skill)
skill.name_en
end
def ==(other)
self.class == other.class && id == other.id
end
end