Sha256: bc5630590fd47657c4b0cac6410e09b79b88be560ed25e9c4820c20d75698a80

Contents?: true

Size: 981 Bytes

Versions: 1

Compression:

Stored size: 981 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)
    attr_accessible :carrier_type_has_checkout_types_attributes
    has_many :carrier_type_has_checkout_types, dependent: :destroy
    has_many :checkout_types, through: :carrier_type_has_checkout_types
    accepts_nested_attributes_for :carrier_type_has_checkout_types, allow_destroy: true, reject_if: :all_blank
  end

  def mods_type
    case name
    when 'volume'
      '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

1 entries across 1 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre63 app/models/carrier_type.rb