Displaying 1 result from an estimated 1 matches for "company_to_category".
2005 Aug 19
2
data validation
...e before they''re stored into the DB, but it seems,
validation doesn''t work..
my model looks like this:
class Company < ActiveRecord::Base
has_many :contacts,
:foreign_key =>''company_id''
has_and_belongs_to_many :categories, :join_table => ''company_to_category'',
:foreign_key => ''company_id'',
:association_foreign_key => ''category_id''
validates_presence_of :name
validates_uniqueness_of :name
validates_lenght_of :name, :maximum => "20" ,:message => "too...