Merbies:

I am experimenting with wolfmanblog, and I got stuck on fixtures. Here's some 
of 
his Post model:

   class Post < Sequel::Model
     many_to_many :tags

And here's an attempt at fixtures, in posts.rb:

   fixture_for Post, :risen do
     self.body      = "Joan Crawford has risen"
     self.title     = "From the Grave"
     self.author    = "Blue Oyster Cult"
     self.permalink = "http://botablog.cz";
     self.tags      = [:progressive, :rock]
   end

   %w(progressive, rock).each do |tag_name|
     fixture_for(Tag, :tag_name.to_sym){ self.name = tag_name }
   end

That gives:

...wolfmanblog/spec/fixtures/posts.rb:8: undefined method `tags=' for 
#<Post:0x2affe3fc36a0> (NoMethodError)
         from 
...gems/merb-fixtures-0.9.5/lib/merb-fixtures/shared/kernel.rb:25:in 
`instance_eval'
         from 
...gems/merb-fixtures-0.9.5/lib/merb-fixtures/shared/kernel.rb:25:in 
`fixture_for'

This result seems to disagree with the documentation for merb-fixtures (one of 
them!), at http://github.com/botanicus/merb-fixtures/tree/master

   fixture_for(Author, :botanicus) do
     self.first_name = "Jakub"
     self.last_name  = "Šťastný"
     self.nickname   = "Botanicus"
     self.homepage   = "http://botablog.cz";
     self.posts      = [ ... ]
   end

Note the documentation does not exactly reveal what goes in the ellipses...

Should the 0.9.5 version number concern me? (I built it last weekend from a 
fresh git clone...)

Should I use the other merb-fixtures, by gogolok?

-- 
   Phlip

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to