Derek Williams wrote:

> This is an issue with Sequel.

Here we go again...

Firstly, even this did not get around the 'missing id' issue:

%w(progressive rock).each_with_index do |tag_name, x|
   fixture_for Tag, :tag_name.to_sym do
     self.id = x + 10
     self.name = tag_name
   end
end

fixture_for Post, :risen do
   self.id        = 1
   self.body      = "Joan Crawford has risen"
   self.title     = "From the Grave"
   self.author    = "Blue Oyster Cult"
   self.permalink = "http://botablog.cz";
   self.tags     << Tag.fixture(:progressive)
   self.tags     << Tag.fixture(:rock)
end

Even giving everyone IDs only produced [nil, nil] in the tags.

So the ultimate answer is to use fixtures for disconnected records, and 
associate them with extra fixture code in the specs.

> The method you are using would probably work fine if you were using 
> datamapper instead. If you are still stuck, you could always try looking 
> for a fixture framework designed to use sequel more appropriately.

Until Merbists use fixtures more I doubt such work would SEO very high...

And about datamapper, what if I did this?

    merb-gen model post_too --orm datamapper

Now all I'd need to do is read post_too.rb to see how datamapper works, then 
port that over to post.rb and toss post_too.rb. Right?

Wrong! All that generated was a post_too_spec.rb, demanding I specify a 
non-existent PostToo!

Uy...

-- 
   Phlip
   http://flea.sourceforge.net/PiglegToo_1.html

--~--~---------~--~----~------------~-------~--~----~
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