Method: Identifiable::Model#to_key

Defined in:
lib/identifiable/model.rb

#to_keyObject

By overriding ActiveRecord’s ‘#to_key`, this means that Rails’ helpers, such as ‘dom_id` will use the public ID instead of the regular ID when identifying the record.



127
128
129
130
131
# File 'lib/identifiable/model.rb', line 127

def to_key
  return super unless Identifiable.configuration.overwrite_to_key

  [self[self.class.identifiable_column]]
end