# order_item.rb
#
 
...

Ruby rental_has_been_refunded?

by chipcastle.myopenid.com, June 23, 2011 13:37, 3 refactorings, tagged with ruby

Looking for a more concise ...

31e2b397e15442a2d3ba42db7bd4584e Talk
def has_store_url?(user)
    user and \
    user.respond_to?(:orders) and \
...

Ruby Existence of ActiveRecord a...

by chipcastle.myopenid.com, June 16, 2011 15:18, 4 refactorings, tagged with Rails, ActiveRecord

User has_many :orders, Orde...

31e2b397e15442a2d3ba42db7bd4584e Talk

Ruby On Handling NoMethodError

by chipcastle.myopenid.com, August 13, 2010 19:15

Great ideas! If I'm follow...

31e2b397e15442a2d3ba42db7bd4584e Talk
if @user && @user.role && @user.role.eql?('user') && @user.user_group
  @group_name = @user.user_group.name
end

Ruby Handling NoMethodError

by chipcastle.myopenid.com, August 13, 2010 17:30, 4 refactorings

It seems to me that there s...

31e2b397e15442a2d3ba42db7bd4584e Talk
# Array of LDAP group names
@group_names = []

...

Ruby Refactor array of hashes

by chipcastle.myopenid.com, August 09, 2010 22:44, 1 refactoring, tagged with ruby array hash flatten select

The code below gives me wha...

31e2b397e15442a2d3ba42db7bd4584e Talk
class Rule < ActiveRecord::Base
  RULE_TYPES = [:allowed_senders, :blocked_senders, :blocked_character_set, :custom]  
end
...

Ruby Rails helper method needs r...

by chipcastle.myopenid.com, June 21, 2010 22:30, 3 refactorings, tagged with rails helper method

There has got to be a much ...

31e2b397e15442a2d3ba42db7bd4584e Talk
if ($('invoice_discount')) {
  	    this.invoice_discount = this.form.down('#invoice_discount');
		    this.invoice_discount.observe('change', this._checkFormat.bindAsEventListener(this));
...

JavaScript Need help with creating a loop

by chipcastle.myopenid.com, November 01, 2009 18:37, 5 refactorings, tagged with javascript prototype

I have the following code t...

31e2b397e15442a2d3ba42db7bd4584e Talk
document.observe('dom:loaded', function(event) {
  
  var MemberReviews = Class.create({
...

JavaScript Common unobtrusive javascri...

by chipcastle.myopenid.com, October 22, 2009 13:41, 1 refactoring, tagged with javascript unobtrusive ajax prototype rails

I have this javascript patt...

31e2b397e15442a2d3ba42db7bd4584e Talk
@subscriptions = [:free, :lite, :brisk, :jammin].inject({}) {|result, ele| result[ele] = SubscriptionType.make(ele); result }

Ruby On Hash assignment

by chipcastle.myopenid.com, August 04, 2009 01:42

Of course! inject is defin...

31e2b397e15442a2d3ba42db7bd4584e Talk
details = [{:amount=>"5.95", :subtotal=>"11.90",    :menu_label=>"Grommets",    :qty=>"2"}, 
           {:amount=>"1.25", :subtotal=>"11.25",    :menu_label=>"Stuff",       :qty=>"9"}, 
           {:amount=>"33.95", :subtotal=>"169.75",  :menu_label=>"More Stuff",  :qty=>"5"},
...

Ruby Extract specific keys from ...

by chipcastle.myopenid.com, August 04, 2009 01:40, 3 refactorings

I would like to create an a...

31e2b397e15442a2d3ba42db7bd4584e Talk
zone = <<EOS
zone #{@domain} {
  type master;
...

Ruby On Add zone in named.conf.local

by chipcastle.myopenid.com, August 03, 2009 20:32 Star_fullStar_fullStar_fullStar_full

Oops, on the last one, the ...

31e2b397e15442a2d3ba42db7bd4584e Talk
zone = %/zone #{@domain} {\n  type master;\n  file #{@zone_file_name}\n};/

Ruby On Add zone in named.conf.local

by chipcastle.myopenid.com, August 03, 2009 20:29

Does this work for you better?

31e2b397e15442a2d3ba42db7bd4584e Talk
@subscriptions  = {}
[:free, :lite, :brisk, :jammin].each { |sub_type| subscriptions[sub_type] = SubscriptionType.make(sub_type) }

Ruby Hash assignment

by chipcastle.myopenid.com, August 03, 2009 20:02, 8 refactorings

Here's the long way of writ...

31e2b397e15442a2d3ba42db7bd4584e Talk