Thanks, that's just what I was looking for.  I'll just write my own custom
validations.

Josh

On Mon, Apr 6, 2009 at 4:19 PM, Frederick Cheung <frederick.che...@gmail.com
> wrote:

>
>
>
> On Apr 6, 9:32 pm, Josh Rachner <josh.rach...@gmail.com> wrote:
> > So, the validation is something like this...
> >
> > validate_duplicate_artist(artist_id, venue_id, event_time)
> >
> > rather than a validate_xxx_of type deal, these are more in depth
> > validations...
> >
> > does that make sense?  i figured the best place would be somewhere in the
> > model, but with the way it is set up, i figured application.rb would be
> the
> > best. it needs to be accessed in many places.
> >
> application.rb is a bit of a misnomer (in that the name makes it
> sounds like it's some sort of thing for the whole app). It just
> contains the parent class of all of your controllers, so if what
> you're doing isn't controller related (it isn't) then it doesn't
> belong there. You could stick your validations in a module and include
> that them into the models that need them or just include them into
> Active Record itself (google for adding custom validations for some
> more lengthy explanations).
>
> Fred
>
> > thanks
> >
> > On Mon, Apr 6, 2009 at 3:17 PM, Frederick Cheung <
> frederick.che...@gmail.com
> >
> > > wrote:
> >
> > > On Apr 6, 6:42 pm, "josh.rach...@gmail.com" <josh.rach...@gmail.com>
> > > wrote:
> > > > I need to put a set of validations in a place that can be accessed by
> > > > multiple controllers...
> >
> > > That doesn't entirely make sense - validations are a model thing. are
> > > you trying to share code between models ?
> >
> > > Fred
> >
> > > > do I just place them in application.rb?
> >
> > > > Thanks,
> >
> > > > Josh
> >
>

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to