1
2
3
4
class FormMailer < ActionMailer::Base

  %w{contact_us help_request service customer_care}.each do |method_name|
...

Ruby On Action Mailer - It has to b...

by Barry Hess, March 02, 2008 04:00 Star_fullStar_fullStar_fullStar_full

You could try some meta-pro...

0218fde3a78fadbadb566bdb40d7b0dd Talk
1
2
3
4
has_many :expenses, :dependent => :destroy do
  def for_week(day)
    find(:all, :conditions => { :spent_at => day.to_time.beginning_of_week.to_date..(day.to_time.beginning_of_week.to_date + 6)})
...

Ruby Finding all in a date range...

by Barry Hess, November 02, 2007 15:15, 1 refactoring, tagged with date range, association proxy

So my User has an associati...

0218fde3a78fadbadb566bdb40d7b0dd Talk
1
2
3
# Note: Kuwait does not use DST.  
# See how the utc_offset value represents 
...

Ruby A DST-adjusted UTC offset

by Barry Hess, October 25, 2007 14:09, No refactoring

I need to get the Daylight-...

0218fde3a78fadbadb566bdb40d7b0dd Talk

JavaScript On Rails-like number_to_curren...

by Barry Hess, October 22, 2007 02:07

Thanks, Ali. So am I the o...

0218fde3a78fadbadb566bdb40d7b0dd Talk
1
2
3
4
# Merges two sets of condition options for ActiveRecord::Base find calls
def merge_conditions(base_conditions, new_conditions, boolean_operator="AND")
  return base_conditions if new_conditions.blank?
...

Ruby On Merging two sets of conditions

by Barry Hess, October 16, 2007 03:47

Thanks, all.

I really like...

0218fde3a78fadbadb566bdb40d7b0dd Talk
1
2
3
4
number_to_currency: function (number, options) {
  try {
    var options   = options || {};
...

JavaScript Rails-like number_to_curren...

by Barry Hess, October 16, 2007 03:18, 3 refactorings

This is pretty much a port ...

0218fde3a78fadbadb566bdb40d7b0dd Talk
1
2
3
4
# Merges two sets of condition options for ActiveRecord::Base find calls
def merge_conditions(base_conditions, new_conditions, boolean_operator="AND")
  return base_conditions if new_conditions.blank?
...

Ruby Merging two sets of conditions

by Barry Hess, October 15, 2007 21:10, 6 refactorings

I found myself in a situati...

0218fde3a78fadbadb566bdb40d7b0dd Talk