mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
parent
90ed23f64d
commit
b6ecae6a35
41 changed files with 1239 additions and 61 deletions
17
app/models/action.rb
Normal file
17
app/models/action.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue