Sha256: 9cb6beac933ef0929e3d59d5aaff901a891a927b574fb8e947ec089c96202fe1

Contents?: true

Size: 798 Bytes

Versions: 14

Compression:

Stored size: 798 Bytes

Contents

class CarrierType < ActiveRecord::Base
  attr_accessible :name, :display_name, :note
  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

14 entries across 14 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre5 app/models/carrier_type.rb
enju_biblio-0.1.0.pre4 app/models/carrier_type.rb
enju_biblio-0.1.0.pre3 app/models/carrier_type.rb
enju_biblio-0.1.0.pre2 app/models/carrier_type.rb
enju_biblio-0.1.0.pre app/models/carrier_type.rb
enju_biblio-0.0.9 app/models/carrier_type.rb
enju_biblio-0.0.8 app/models/carrier_type.rb
enju_biblio-0.0.7 app/models/carrier_type.rb
enju_biblio-0.0.6 app/models/carrier_type.rb
enju_biblio-0.0.5 app/models/carrier_type.rb
enju_biblio-0.0.4 app/models/carrier_type.rb
enju_biblio-0.0.3 app/models/carrier_type.rb
enju_biblio-0.0.2 app/models/carrier_type.rb
enju_biblio-0.0.1 app/models/carrier_type.rb