class PaperTrailAssociationTracking::Reifiers::HasOne::FoundMoreThanOne

A more helpful error message, instead of the AssociationTypeMismatch you would get if, eg. we were to try to assign a Bicycle to the :car association (before, if there were multiple records we would just take the first and hope for the best). @api private

Constants

MESSAGE_FMT

Public Class Methods

new(base_class_name, num_records_found) click to toggle source
# File lib/paper_trail_association_tracking/reifiers/has_one.rb, line 30
def initialize(base_class_name, num_records_found)
  @base_class_name = base_class_name.to_s
  @num_records_found = num_records_found.to_i
end

Public Instance Methods

message() click to toggle source
# File lib/paper_trail_association_tracking/reifiers/has_one.rb, line 35
def message
  format(MESSAGE_FMT, @base_class_name, @num_records_found)
end