Sha256: 820b4f52d20fed95de5779ef944d40f5d2961024fbd94f5c5b0e806ee2f52af7

Contents?: true

Size: 1.35 KB

Versions: 6

Compression:

Stored size: 1.35 KB

Contents

class Subject < ActiveRecord::Base
  attr_accessible :parent_id, :use_term_id, :term, :term_transcription,
    :subject_type_id, :note, :required_role_id, :subject_heading_type_id

  belongs_to :manifestation
  belongs_to :subject_type
  belongs_to :subject_heading_type
  belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id'

  validates_associated :subject_type, :subject_heading_type
  validates_presence_of :term, :subject_type_id, :subject_heading_type_id

  searchable do
    text :term
    time :created_at
    integer :required_role_id
  end

  normalize_attributes :term

  paginates_per 10
end

# == Schema Information
#
# Table name: subjects
#
#  id                      :integer          not null, primary key
#  parent_id               :integer
#  use_term_id             :integer
#  term                    :string(255)
#  term_transcription      :text
#  subject_type_id         :integer          not null
#  scope_note              :text
#  note                    :text
#  required_role_id        :integer          default(1), not null
#  lock_version            :integer          default(0), not null
#  created_at              :datetime
#  updated_at              :datetime
#  deleted_at              :datetime
#  url                     :string(255)
#  manifestation_id        :integer
#  subject_heading_type_id :integer
#

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enju_subject-0.1.0.pre25 app/models/subject.rb
enju_subject-0.1.0.pre24 app/models/subject.rb
enju_subject-0.1.0.pre23 app/models/subject.rb
enju_subject-0.1.0.pre22 app/models/subject.rb
enju_subject-0.1.0.pre21 app/models/subject.rb
enju_subject-0.1.0.pre20 app/models/subject.rb