Class: ReturnItem

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/return_item.rb

Overview

Schema Information

Table name: return_items

id                      :integer(4)      not null, primary key
return_authorization_id :integer(4)      not null
order_item_id           :integer(4)      not null
return_condition_id     :integer(4)
return_reason_id        :integer(4)
returned                :boolean(1)      default(FALSE)
updated_by              :integer(4)
created_at              :datetime
updated_at              :datetime

Instance Method Summary (collapse)

Instance Method Details

- (Object) mark_returned!

validates :return_authorization_id, :presence => true



31
32
33
34
35
# File 'app/models/return_item.rb', line 31

def mark_returned!
  self.returned = true
  self.order_item.return!
  save
end