Skip to content

Instantly share code, notes, and snippets.

View lachie's full-sized avatar

Lachie Cox lachie

View GitHub Profile
if memo[/notification/]
Notifications.send_receipt = false
Notifications.deliver_recruitment(params['recruitment'])
Notifications.send_receipt = false
Notifications.deliver_notification_for_resourcing(params['recruitment'])
end
require File.dirname(__FILE__) + '/../spec_helper'
require File.dirname(__FILE__) + '/../../app/models/notifications'
class Notifications
def self.spec_new(method_name,*parameters)
n = self.allocate
n.__send__ :initialize_defaults, method_name
yield(n) if block_given?
n.__send__(method_name, *parameters)
return n
class Date
def to_words
today = Date.today
case self
when today
"Today"
when today - 1
"Yesterday"
when today + 1
def self.next(username)
list = find(:all,:order => 'last_name')
list[list.index {|u| u.username == username}+1]
end
.note
This information comes from LDAP. To edit it,
=link_to 'please click here', 'http://people.rsp.com.au'
named_scope :with_group, lambda {|group|
{:conditions => {:group_id => group.id, :group_type => group.class.base_class.name.to_s}}
}
class User < ActiveRecord::Base
has_many :contracts
...
end
class Contract < ActiveRecord::Base
end
/´¯/)
,/¯ /
/ /
/´¯/' '/´¯¯`·¸
/'/ / / /¨¯\
('( ´ ´ ¯~/' ')
\ ' /
'' \ _ ·´
\ (
\ \
<% if RAILS_ENV == 'production' %>
<%= javascript_include_tag 'console_stub'
<% end %>
def load_rails_plugin(name)
Merb::BootLoader.before_app_loads do
root = Merb.root / "lib" / name
puts "root: #{root}"
$: << (root / 'lib')
Dependencies.load_paths << (root / 'lib')
require root / "init.rb"
end