You don't need to return explicitly!
Ruby returns the value of the last line executed.
Don't do this:
def foo
value = Foo.first(:conditions => { :label => "bar" })
return value
end
Do this instead:
def foo
Foo.first(:conditions => { :label => "bar" })
end
Disagree? Found a typo? Got a question? Email me at craig@barkingiguana.com.