On Apr 26, 2011, at 9:35 AM, Junior Grossi wrote:

> Hi all,
> 
> I am newbie in Rails and new at this group. I am with a problem with
> validation. I searched at Google but I cant see anything.
> 
> I have just one Model: User. I have 2 CRUD's (controllers and views):
> Representatives and Users... Users CRUD is ok but Representatives not.
> I have different validations rules for Representatives and Users, but
> I have to use the same table in the DB, so the same Model.
> 
> How can I make different validations in a same Model?

Look into STI (single table inheritance).  This will let you use the same 
underlying table (and share common functionality) among multiple models...

-philip

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