Sha256: ac366eef954fb69a2431709d1590a332f93a1ed87a0d7d015086a8e25ac8d4cd
Contents?: true
Size: 359 Bytes
Versions: 76
Compression:
Stored size: 359 Bytes
Contents
class ReferenceObserver < ActiveRecord::Observer observe :'ActiveRecord::Base' def before_save(record) if record.respond_to?(:reference_id) and Usuario.current.present? and Usuario.current.reference_id.present? record.reference_id = Usuario.current.reference_id end end def before_validation(record) before_save(record) end end
Version data entries
76 entries across 76 versions & 1 rubygems