Class: ShipmentNoteDAO

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/shipping_backup_client/models/shipment_note_dao.rb

Overview

Schema Information

Table name: shipment_notes

id                         :integer          not null, primary key
shipment_id                :integer          not null
note_type                  :string(255)
note                       :string(255)
shipment_status_history_id :integer
created_at                 :datetime
updated_at                 :datetime

Defined Under Namespace

Modules: Types

Class Method Summary collapse

Class Method Details

.by_type(type) ⇒ Object



29
30
31
# File 'lib/shipping_backup_client/models/shipment_note_dao.rb', line 29

def self.by_type(type)
  ShipmentNoteDAO.where(:note_type => type)
end

.by_types(types) ⇒ Object



33
34
35
# File 'lib/shipping_backup_client/models/shipment_note_dao.rb', line 33

def self.by_types(types)
  ShipmentNoteDAO.where("note_type IN (#{types.map{|type| "'#{type}'"}.join(',')})")
end

.matching_shipment_id(shipment_id) ⇒ Object



25
26
27
# File 'lib/shipping_backup_client/models/shipment_note_dao.rb', line 25

def self.matching_shipment_id(shipment_id)
  ShipmentNoteDAO.find_by_shipment_id(shipment_id)
end