hensei-api/app/models/job_accessory.rb
Justin Edmund 0ff7e7a8dd Add JobAccessory model and add type to schema
We need type because we don't want to hardcode job ids in scripts
2023-01-23 20:52:06 -08:00

37 lines
788 B
Ruby

# frozen_string_literal: true
class JobAccessory < ApplicationRecord
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 blueprint
JobAccessoryBlueprint
end
def display_resource(skill)
skill.name_en
end
def ==(other)
self.class == other.class && id == other.id
end
end