Oct
26th
Mon
26th
Building or creating an object through a has_one association that contains conditionals will now automatically append those conditions to the newly created object, thanks to Luciano Panaro
—
-Nathaniel Bibler on the official Ruby on Rails blog.
Luciano is one of our team members and I could not be happier to see that he is being credited for assisting the furthering of rails. Opensource is something that Mark and I take very seriously and participating in the communities is such a important part of that. Big congrats from everyone on the team to Luciano!!!
The actual code is below, though sadly I have no idea what it means:)
class Blog
has_author :commit_author, :class_name =>
'Author', :conditions =>
{:name => "Luciano Panaro"}
end
@blog.build_commit_author
# => #<Author name: "Luciano Panaro" ... >
