Class: Specify::Model::RecordSetItem

Inherits:
Object
  • Object
show all
Defined in:
lib/specify/models/record_set_item.rb

Overview

RecordSetItems are orderd items in a Specify::Model::RecordSet.

A RecordSetItem represents instances of Specify::Model classes that are contained in a Specify::Model::RecordSet. The only class currently supported is Specify::Model::CollectionObject.

Instance Method Summary collapse

Instance Method Details

#before_createObject

Sequel hook that sets #order_number for newly created records.



17
18
19
20
# File 'lib/specify/models/record_set_item.rb', line 17

def before_create
  self[:OrderNumber] = record_set.next_order_number
  super
end

#order_numberObject

Returns the index (an Integer) that marks the position of self in a Specify::Model::RecordSet.



24
25
26
# File 'lib/specify/models/record_set_item.rb', line 24

def order_number
  self[:OrderNumber]
end