Sha256: dad4e590660e22f63b64cd611e2a71da5d9007531348f5177e19c6fa46f8535c

Contents?: true

Size: 686 Bytes

Versions: 1

Compression:

Stored size: 686 Bytes

Contents

##
# Occupation ζ˜―θŒδΈšγ€‚

class Unidom::Position::Occupation < Unidom::Position::ApplicationRecord

  self.table_name = 'unidom_occupations'

  include Unidom::Common::Concerns::ModelExtension

  validates :name, presence: true, length: { in: 2..self.columns_hash['name'].limit }

  belongs_to :scheme, polymorphic: true

  has_many :positions, class_name: 'Unidom::Position::Position'
  has_many :posts,     through:    :positions, source: :posts

  scope :scheme_is,      ->(scheme)      { where scheme:      scheme      }
  scope :scheme_id_is,   ->(scheme_id)   { where scheme_id:   scheme_id   }
  scope :scheme_type_is, ->(scheme_type) { where scheme_type: scheme_type }

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-position-1.4.4 app/models/unidom/position/occupation.rb