This may come in handy:
validate_uniqueness_of :column_name
Max
On 8/18/06, Stephan Wehner <stephan@buckmaster.ca>
wrote:> if (Modelname.find_by_columnname(..value_to_check..))
> # another entry exists with columnname === value to check
> else
> # no other entry exists with columnname === value to check
> end
>
> vincent vega wrote:
> > hi!
> >
> > as the subject says, :P how can i check if a value is already in a
> > table??
> >
> > ty!!
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>