Like lots of other folks, I''ve been searching for a way to scratch my fixture itches. Rathole is my extraction of a few techniques we''ve successfully applied at my day job. We''ve been using Rathole for a month or so now, but I''d really like some feedback from a wider audience. Rathole tackles: * Conflicting PK''s (no more id''s in fixture files!), * Bad belongs_to and HABTM FK''s (and join table fixtures!), * Noisy created_at/updated_at (and _on) specifications, and * Default fixture values Rathole works for me on MySQL and SQLite on Rails 1.2.5 and trunk, but YMMV. There''s more information in the README, which is available along with the current version of the plugin at: http://svn.geeksomnia.com/rathole/trunk All comments and suggestions are welcome. Thanks! ~ j. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John, Rathole looks like a great step in the right direction. I had to write a custom tool that checked all our FK''s in each of our fixture scenarios, and having Rathole in place would''ve simplified that quite a bit. Fixtures are one of the weakest parts of Rails and tools like this are sorely needed. Looking forward to more features and improvements down the road too. -Jason On Oct 21, 3:41 pm, "John Barnette" <jbarne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Like lots of other folks, I''ve been searching for a way to scratch my > fixture itches. Rathole is my extraction of a few techniques we''ve > successfully applied at my day job. > > We''ve been using Rathole for a month or so now, but I''d really like > some feedback from a wider audience. Rathole tackles: > > * Conflicting PK''s (no more id''s in fixture files!), > * Bad belongs_to and HABTM FK''s (and join table fixtures!), > * Noisy created_at/updated_at (and _on) specifications, and > * Default fixture values > > Rathole works for me on MySQL and SQLite on Rails 1.2.5 and trunk, but > YMMV. There''s more information in the README, which is available along > with the current version of the plugin at: > > http://svn.geeksomnia.com/rathole/trunk > > All comments and suggestions are welcome. Thanks! > > ~ j.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 10/21/07, jfrankov <jfrankov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> John, Rathole looks like a great step in the right direction. I had to > write a custom tool that checked all our FK''s in each of our fixture > scenarios, and having Rathole in place would''ve simplified that quite > a bit. Fixtures are one of the weakest parts of Rails and tools like > this are sorely needed. Looking forward to more features and > improvements down the road too.Thanks! I''d be interested to hear about any specific features or improvements you''d like to see, too. Rathole''s constant label --> PK generation should make it really easy to hash/watch the entire fixtures directory and only reload changed fixtures. If we keep an eye on schema_version changes as well, it should be possible to avoid fixture loading completely except when fixture files or db structure have changed. If there''s any Rathole uptake, I''ll probably start monkeying with this Real Soon Now. ~ j. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
So should this work automatically when I run rake? On Oct 21, 7:45 pm, "John Barnette" <jbarne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/21/07, jfrankov <jfran...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > John, Rathole looks like a great step in the right direction. I had to > > write a custom tool that checked all our FK''s in each of our fixture > > scenarios, and having Rathole in place would''ve simplified that quite > > a bit. Fixtures are one of the weakest parts of Rails and tools like > > this are sorely needed. Looking forward to more features and > > improvements down the road too. > > Thanks! I''d be interested to hear about any specific features or > improvements you''d like to see, too. > > Rathole''s constant label --> PK generation should make it really easy > to hash/watch the entire fixtures directory and only reload changed > fixtures. If we keep an eye on schema_version changes as well, it > should be possible to avoid fixture loading completely except when > fixture files or db structure have changed. If there''s any Rathole > uptake, I''ll probably start monkeying with this Real Soon Now. > > ~ j.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 10/23/07, Cache22 <craigknox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So should this work automatically when I run rake?Yup, it should work without any configuration. ~ j.> On Oct 21, 7:45 pm, "John Barnette" <jbarne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 10/21/07, jfrankov <jfran...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > John, Rathole looks like a great step in the right direction. I had to > > > write a custom tool that checked all our FK''s in each of our fixture > > > scenarios, and having Rathole in place would''ve simplified that quite > > > a bit. Fixtures are one of the weakest parts of Rails and tools like > > > this are sorely needed. Looking forward to more features and > > > improvements down the road too. > > > > Thanks! I''d be interested to hear about any specific features or > > improvements you''d like to see, too. > > > > Rathole''s constant label --> PK generation should make it really easy > > to hash/watch the entire fixtures directory and only reload changed > > fixtures. If we keep an eye on schema_version changes as well, it > > should be possible to avoid fixture loading completely except when > > fixture files or db structure have changed. If there''s any Rathole > > uptake, I''ll probably start monkeying with this Real Soon Now. > > > > ~ j. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Could you show some examplel of how to use namespaced models? On Oct 22, 3:41 am, "John Barnette" <jbarne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> All comments and suggestions are welcome. Thanks! >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 28, 2007, at 12:15 AM, Oceanborn wrote:> Could you show some examplel of how to use namespaced models?Namespaced models should work just like any other models: are you seeing some strange behavior? If so, can you pass along an example of something bad happening? Thanks! ~ j. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
My models: Content has_many :assigned_assets, :class_name => ''Assets::AssignedAsset'', :dependent => :destroy has_many :assets, :class_name => ''Assets::Asset'', :through => :assigned_assets Assets::Asset Assets::ImageAsset Assets::AssignedAsset belongs_to :content, :counter_cache => ''assets_count'' belongs_to :asset contents.yml: message: title: Sample type: Event assigned_assets: one assets/assigned_assets.yml one: asset: one content: message position: 1 assets/assets.yml one: content_type: image/jpeg size: 204047 file: lgis86g3.jpg dimensions: 1280x1024 type: ImageAsset Got an error: ActiveRecord::StatementInvalid: PGError: ERROR: column "assets" of relation "contents" does not exist On Oct 28, 1:54 pm, John Barnette <jbarne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Oct 28, 2007, at 12:15 AM, Oceanborn wrote: > > > Could you show some examplel of how to use namespaced models? > > Namespaced models should work just like any other models: are you > seeing some strange behavior? If so, can you pass along an example of > something bad happening? Thanks! > > ~ j.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry, I am a little wrong. In previous contents.yml "assigned_assets: one" should be removed. My problem is that contents(:message).assets always empty. What I missed?> > Namespaced models should work just like any other models: are you > > seeing some strange behavior? If so, can you pass along an example of > > something bad happening? Thanks! > > > ~ j.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
For those not using edge rails, please note that this plugin has been merged in edge rails core now. So congrats and thanks to John Barnette and others should start using this if you''re not on edge :-) On 10/21/07, John Barnette <jbarnette-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Like lots of other folks, I''ve been searching for a way to scratch my > fixture itches. Rathole is my extraction of a few techniques we''ve > successfully applied at my day job. > > We''ve been using Rathole for a month or so now, but I''d really like > some feedback from a wider audience. Rathole tackles: > > * Conflicting PK''s (no more id''s in fixture files!), > * Bad belongs_to and HABTM FK''s (and join table fixtures!), > * Noisy created_at/updated_at (and _on) specifications, and > * Default fixture values > > Rathole works for me on MySQL and SQLite on Rails 1.2.5 and trunk, but > YMMV. There''s more information in the README, which is available along > with the current version of the plugin at: > > http://svn.geeksomnia.com/rathole/trunk > > All comments and suggestions are welcome. Thanks! > > > ~ j. > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Been using this for a while now, and I don''t want to go back :) Great addition! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi John, Great plugin (well technically a core Rails feature). I think I found a small bug. If you have a has_many without an id column both rathole and foxy fixtures will try to insert an auto- generated id which fails since there is no id column. I fixed it locally by modifying your fixtures.rb to check if the column_names include the primary key name like so: if model_class # generate a primary key row[primary_key_name] = ::Fixtures.identify(label) if column_names.include? primary_key_name Also, any plans on adding support for getting rid of has_many :through fixtures files? As far as I can tell it only works with habtm correct? I could try to take a stab at it if you aren''t planning on it. Thanks, Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John Barnette wrote:> * Conflicting PK''s (no more id''s in fixture files!), > * Bad belongs_to and HABTM FK''s (and join table fixtures!), > * Noisy created_at/updated_at (and _on) specifications, and > * Default fixture values > > Rathole works for me on MySQL and SQLite on Rails 1.2.5 and trunk, but > YMMV. There''s more information in the README, which is available along > with the current version of the plugin at:Any experience using rathole with rSpec? Truth be known, I''m getting tired of mocking complex associations... I know that''s heresy. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Polymorphic association support would be fantastic. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---