Sha256: e4a4942f38d3f8392ce5f21fcd3352b05fa7aba98eb508e1401fa2d4c6185b4e

Contents?: true

Size: 809 Bytes

Versions: 5

Compression:

Stored size: 809 Bytes

Contents

class CarrierType < ActiveRecord::Base
  attr_accessible :name, :display_name, :note, :position
  include MasterModel
  default_scope :order => "carrier_types.position"
  has_many :manifestations
  if defined?(EnjuCirculation)
    has_many :carrier_type_has_checkout_types, :dependent => :destroy
    has_many :checkout_types, :through => :carrier_type_has_checkout_types
  end

  def mods_type
    case name
    when 'print'
      'text'
    else
      # TODO: その他のタイプ
      'software, multimedia'
    end
  end
end

# == Schema Information
#
# Table name: carrier_types
#
#  id           :integer         not null, primary key
#  name         :string(255)     not null
#  display_name :text
#  note         :text
#  position     :integer
#  created_at   :datetime
#  updated_at   :datetime
#

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre10 app/models/carrier_type.rb
enju_biblio-0.1.0.pre9 app/models/carrier_type.rb
enju_biblio-0.1.0.pre8 app/models/carrier_type.rb
enju_biblio-0.1.0.pre7 app/models/carrier_type.rb
enju_biblio-0.1.0.pre6 app/models/carrier_type.rb