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

Defined in:
lib/sequel/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.


897
898
899
900
# File 'lib/sequel/lib/sequel/model/associations.rb', line 897

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