This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn gateway-fn | |
"Retrieves a function given it's full name" | |
[gateway access method] | |
{:post [(not (nil? %))]} | |
(let [sym (symbol (str "project-namespace." (name gateway) "." (name access) "/" (name method)))] | |
(resolve sym))) | |
(defn gateway-call | |
"Dispatches to a function on the given provider" | |
[access method & args] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn save! | |
"Persists an account" | |
[account] | |
(common/gateway-call :account-gateway :save! account)) | |
(defn find-by-id | |
"Find account by given id" | |
[id] | |
(common/gateway-call :account-gateway :find-by-id id)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<shipping> | |
<date>19/12/2013</date> | |
<due_date>19/12/2013</due_date> | |
<loaded_at>10/10/2050</loaded_at> | |
<license_plate>00-AA-11</license_plate> | |
<client> | |
<name>Joao</name> | |
<code>Jony123</code> | |
<email>[email protected]</email> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Updater | |
def self.update_total_points(employee) | |
employee.total_points = employee.rocket_actions.sum(:points) | |
gateway.persist_employee_total(employee) | |
end | |
def gateway | |
if defined? Rails | |
rails gateway |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//top of steps file or in seperate factory file | |
require 'factory_girl' | |
Factory.define :user do |u| | |
u.login 'the_login' | |
u.email '[email protected]' | |
u.password 'password' | |
u.password_confirmation 'password' | |
# u.activated_at 'active' | |
end |
NewerOlder