mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Added general user stamping on contact
This commit is contained in:
parent
86dc8321c6
commit
8ce1875484
6 changed files with 33 additions and 1 deletions
15
app/controllers/concerns/shared/user_stamper.rb
Normal file
15
app/controllers/concerns/shared/user_stamper.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module Shared::UserStamper
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def stamp obj
|
||||
return false if obj.nil? || !obj.has_attribute?( :created_by_id && :updated_by_id )
|
||||
|
||||
if obj.new_record?
|
||||
obj.created_by_id = current_epp_user.id
|
||||
else
|
||||
obj.updated_by_id = current_epp_user.id
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
|
@ -2,6 +2,7 @@ class Epp::CommandsController < ApplicationController
|
|||
include Epp::Common
|
||||
include Epp::DomainsHelper
|
||||
include Epp::ContactsHelper
|
||||
include Shared::UserStamper
|
||||
|
||||
private
|
||||
def create
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue