Today I released a new version of the Sham gem (version 1.0.0). This new version is not backwards compatible, hence the major version release. I highly recommend upgrading - this new version has some cool goodies included in it.
Here's a quick sample using the new definition syntax:
Sham.config(Item){ |c| c.empty }
Sham.config(Item, :small) do |c|
c.attributes do
{ :weight => 10.0 }
end
end
Sham.config(Item, :large) do |c|
c.attributes do
{ :weight => 100.0 }
end
end
Item.sham!
Item.sham!(:small, :quantity => 100)
Item.sham!(:large, :build, :quantity => 0)
Enjoy!