mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
16 lines
390 B
Ruby
16 lines
390 B
Ruby
module UserEvents
|
|
extend ActiveSupport::Concern
|
|
|
|
def cr_id
|
|
if versions.first.object.nil?
|
|
cr_registrar_id =versions.first.object_changes['registrar_id'].second
|
|
else
|
|
# untested, expected never to execute
|
|
cr_registrar_id = versions.first.object['registrar_id']
|
|
end
|
|
if cr_registrar_id.present?
|
|
Registrar.find(cr_registrar_id).code
|
|
end
|
|
end
|
|
|
|
end
|