have the ability now to update a row of direct deposit information as well as leverage the encryption routine to introduce a serious flaw
This commit is contained in:
@@ -1,5 +1,25 @@
|
||||
class Pay < ActiveRecord::Base
|
||||
|
||||
# mass-assignable attributes
|
||||
attr_accessible :bank_account_num, :bank_routing_num, :percent_of_deposit
|
||||
|
||||
# Associations
|
||||
belongs_to :user
|
||||
|
||||
# Validations
|
||||
validates :bank_account_num, presence: true
|
||||
validates :bank_routing_num, presence: true
|
||||
validates :percent_of_deposit, presence: true
|
||||
|
||||
# actions
|
||||
before_save :encrypt_bank_account_num
|
||||
|
||||
def as_json
|
||||
super(only: [:bank_account_num, :bank_routing_num, :percent_of_deposit])
|
||||
end
|
||||
|
||||
def encrypt_bank_account_num
|
||||
self.bank_account_num = Encryption.encrypt_sensitive_value(self.bank_account_num)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user