app/models/item.rb in enju_biblio-0.1.0.pre59 vs app/models/item.rb in enju_biblio-0.1.0.pre60
- old
+ new
@@ -10,12 +10,12 @@
:checkout_type_id, :shelf_id, :include_supplements, :note, :url, :price,
:acquired_at, :bookstore_id, :missing_since, :budget_type_id, :lock_version,
:manifestation_id, :library_id, :required_role_id,
:binding_item_identifier, :binding_call_number, :binded_at
scope :on_shelf, -> { where('shelf_id != 1') }
- scope :on_web, -> { where(:shelf_id => 1) }
- delegate :display_name, :to => :shelf, prefix: true
+ scope :on_web, -> { where(shelf_id: 1) }
+ delegate :display_name, to: :shelf, prefix: true
has_many :owns
has_many :agents, through: :owns
has_many :donates
has_many :donors, through: :donates, source: :agent
has_one :resource_import_result
@@ -28,10 +28,10 @@
validates :manifestation_id, presence: true
validates :item_identifier, allow_blank: true, uniqueness: true,
format: {with: /\A[0-9A-Za-z_]+\Z/}
validates :binding_item_identifier, allow_blank: true,
format: {with: /\A[0-9A-Za-z_]+\Z/}
- validates :url, url: true, allow_blank: true, length: {:maximum => 255}
+ validates :url, url: true, allow_blank: true, length: { maximum: 255 }
validates_date :acquired_at, allow_blank: true
normalize_attributes :item_identifier, :binding_item_identifier,
:call_number, :binding_call_number, :url