Add Registrant API contact update action

Closes #849
This commit is contained in:
Artur Beljajev 2018-08-20 17:19:54 +03:00
parent 90ed23f64d
commit b6ecae6a35
41 changed files with 1239 additions and 61 deletions

17
app/models/action.rb Normal file
View file

@ -0,0 +1,17 @@
class Action < ActiveRecord::Base
belongs_to :user
belongs_to :contact
validates :operation, inclusion: { in: proc { |action| action.class.valid_operations } }
class << self
def valid_operations
%w[update]
end
end
def notification_key
raise 'Action object is missing' unless contact
"contact_#{operation}".to_sym
end
end