git clean -fd
Wednesday, March 30, 2011
Sunday, March 6, 2011
Delegate getting name attribute of associations
# Instead of
def guest_name
guest.try(:name)
end
# Use delegate
delegate :name, :to => :guest, :allow_nil => true
Subscribe to:
Posts (Atom)