May 13th, 2008 by ymendel 2 comments »
That title sucks. Sorry.
First and foremost, a shout-out goes to “Intense” Chris Bailey for being, as far as I know, one of the few people who care about and use Object Daddy, or at least he talks about it. Thanks to his interest, some problems got shaken out and some behavior tightened up.
Thanks to GitHub’s social networking-ness, Chris probably already knows about this, but it’s worth telling the whole world (as I refer to blogicx readership): Object Daddy has some updates to talk about.
generate! no longer have this weird difference of one just making the object and the other saving as well as raising an exception if something went wrong. A new method,
spawn, was made to handle the case of making a new object (analogous to
generate! are now like
A. It was mentioned before that STI and inheritance work nicely with generators, subclasses inheriting generators from parent classes but being able to define their own overrides. Well, that had a bug that relied on the classes being loaded in a certain order. That’s been fixed.
א. Generating an object through an association now works as expected. Take the following Category and Item models.
class Category < ActiveRecord::Base has_many :items end class Item < ActiveRecord::Base belongs_to :category validates_presence_of :category end
No longer will
some_category.items.generate create a new item that belongs to a new category. No, that item will belong to
Kudos and cheers all around, and keep on, uh, Daddying.