1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

For belongs_to reify, use correct foreign_key

This commit is contained in:
Luke Underwood 2017-03-16 02:44:57 -07:00
parent 7332d5cc87
commit cec9e0ab58

View file

@ -6,7 +6,7 @@ module PaperTrail
class << self class << self
# @api private # @api private
def reify(assoc, model, options, transaction_id) def reify(assoc, model, options, transaction_id)
id = model.send(assoc.association_foreign_key) id = model.send(assoc.foreign_key)
version = load_version(assoc, id, transaction_id, options[:version_at]) version = load_version(assoc, id, transaction_id, options[:version_at])
record = load_record(assoc, id, options, version) record = load_record(assoc, id, options, version)
model.send("#{assoc.name}=".to_sym, record) model.send("#{assoc.name}=".to_sym, record)