dasil003
2010-Jan-05 19:29 UTC
Multiple independent sets of validations with validation_scopes gem
Being able to have groups of validations, partial validations, or validations that don''t prevent saving an object are common needs w/ ActiveRecord. Last week I did an exhaustive search of the available plugins, and I wasn''t able to find anything that satisfactorily solved all the problems. Either things were too verbose, too limiting, too specific, or I just didn''t like the API. Enter validation_scopes. I wrote this plugin to solve my problems while still being able to harness the full power of ActiveRecord validation. http://github.com/dasil003/validation_scopes If you have interest in such a thing please give it a try. At less than 50 lines, I think it''s a sustainable approach that will port well to Rails 3, but it''s also very dense meta-programming, so I want to get more people using it to shake out bugs around the edge cases. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marli
2010-Jan-05 20:47 UTC
Re: Multiple independent sets of validations with validation_scopes gem
Just a general question after quickly looking over it, can you create new scopes that won''t let you save? or would this be accomplished through something like f.save if f.no_warnings? Thanks, Marli On Jan 5, 2:29 pm, dasil003 <gabrie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Being able to have groups of validations, partial validations, or > validations that don''t prevent saving an object are common needs w/ > ActiveRecord. Last week I did an exhaustive search of the available > plugins, and I wasn''t able to find anything that satisfactorily solved > all the problems. Either things were too verbose, too limiting, too > specific, or I just didn''t like the API. > > Enter validation_scopes. I wrote this plugin to solve my problems > while still being able to harness the full power of ActiveRecord > validation. > > http://github.com/dasil003/validation_scopes > > If you have interest in such a thing please give it a try. At less > than 50 lines, I think it''s a sustainable approach that will port well > to Rails 3, but it''s also very dense meta-programming, so I want to > get more people using it to shake out bugs around the edge cases.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
dasil003
2010-Jan-05 22:25 UTC
Re: Multiple independent sets of validations with validation_scopes gem
Sadly no, that wasn''t really in my use case. You might like this one thought: http://github.com/freetwix/validation_scenarios On Jan 5, 12:47 pm, Marli <marli.baum...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Just a general question after quickly looking over it, can you create > new scopes that won''t let you save? or would this be accomplished > through something like f.save if f.no_warnings? > > Thanks, > Marli > > On Jan 5, 2:29 pm, dasil003 <gabrie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Being able to have groups of validations, partial validations, or > > validations that don''t prevent saving an object are common needs w/ > > ActiveRecord. Last week I did an exhaustive search of the available > > plugins, and I wasn''t able to find anything that satisfactorily solved > > all the problems. Either things were too verbose, too limiting, too > > specific, or I just didn''t like the API. > > > Enter validation_scopes. I wrote this plugin to solve my problems > > while still being able to harness the full power of ActiveRecord > > validation. > > >http://github.com/dasil003/validation_scopes > > > If you have interest in such a thing please give it a try. At less > > than 50 lines, I think it''s a sustainable approach that will port well > > to Rails 3, but it''s also very dense meta-programming, so I want to > > get more people using it to shake out bugs around the edge cases.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marli
2010-Jan-06 03:04 UTC
Re: Multiple independent sets of validations with validation_scopes gem
Thanks for the reference, your plugin looks pretty good, I''ll try to give you some feedback if I end up using it. -- Marli On Jan 5, 5:25 pm, dasil003 <gabrie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Sadly no, that wasn''t really in my use case. You might like this one > thought:http://github.com/freetwix/validation_scenarios > > On Jan 5, 12:47 pm, Marli <marli.baum...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Just a general question after quickly looking over it, can you create > > new scopes that won''t let you save? or would this be accomplished > > through something like f.save if f.no_warnings? > > > Thanks, > > Marli > > > On Jan 5, 2:29 pm, dasil003 <gabrie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Being able to have groups of validations, partial validations, or > > > validations that don''t prevent saving an object are common needs w/ > > > ActiveRecord. Last week I did an exhaustive search of the available > > > plugins, and I wasn''t able to find anything that satisfactorily solved > > > all the problems. Either things were too verbose, too limiting, too > > > specific, or I just didn''t like the API. > > > > Enter validation_scopes. I wrote this plugin to solve my problems > > > while still being able to harness the full power of ActiveRecord > > > validation. > > > >http://github.com/dasil003/validation_scopes > > > > If you have interest in such a thing please give it a try. At less > > > than 50 lines, I think it''s a sustainable approach that will port well > > > to Rails 3, but it''s also very dense meta-programming, so I want to > > > get more people using it to shake out bugs around the edge cases.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.