anchor.diff:  %% @copyright 2012 Opscode, Inc.
   
   %% @doc General utility module for common functions that operate on
  -%% "Chef Objects", such as nodes, roles, etc.
  +%% "Pushy Objects", such as node_status, jobs, etc.
   -module(pushy_object).
   
   -include("pushy_sql.hrl").
  
positive.code:                Object#Rec{created_at = Now,
                            updated_at = Now, last_updated_by = ActorId}).
  
  ?MAKE_SET_CREATED(pushy_node_status).
  
  %% CHEF_COMMON CARGO_CULT
  %% chef_db:sql_date/1
  
negative.code:         set_updated(#Rec{}=Object, ActorId) ->
                 Object#Rec{updated_at = sql_date(now), last_updated_by = ActorId}).
  
  ?MAKE_SET_UPDATED(pushy_node_status);
  ?MAKE_SET_UPDATED(pushy_job).
  
  %% Similar to MAKE_SET_UPDATED, a helper for generating a set_created function that sets
  %% created_at, updated_at, and last_updated_by on any of the Chef object types.
  