Skip to content

Instantly share code, notes, and snippets.

View brandonmikeska's full-sized avatar

Brandon Mikeska brandonmikeska

  • Genesys
  • Houston
View GitHub Profile
/**
* Class TriggerFactory
*
* Used to instantiate and execute Trigger Handlers associated with sObjects.
*/
public with sharing class TriggerFactory
{
// Generate unique executionId for debuging execution results
private static String executionId;
def validate_code!(code)
if BCrypt::Password.new(code) == hashed_code
self.activated_at = Time.now
save
else
false
end
end
def validate_code!(code)
if BCrypt::Password.new(code) == hashed_code
self.activated_at = DateTime.now
save
else
false
end
end
def validate_code!(code, ip, user_agent)
if BCrypt::Password.new(hashed_code) == code
self.activated_at = DateTime.now
save
else
false
end
end
def activate_session!(code, ip, user_agent)
if BCrypt::Password.new(hashed_code) == code
self.activated_at = DateTime.now
self.ip = ip
self.user_agent = user_agent
save
else
false
end
end