Module: Sequel::Model::Associations::InstanceMethods

Defined in:
lib/sequel/model/associations.rb

Overview

Private instance methods used to implement the associations support.

Instance Method Summary collapse

Instance Method Details

#pk_or_nilObject

Used internally by the associations code, like pk but doesn’t raise an Error if the model has no primary key.



840
841
842
843
# File 'lib/sequel/model/associations.rb', line 840

def pk_or_nil
  key = primary_key
  key.is_a?(Array) ? key.map{|k| @values[k]} : @values[key]
end