Hi
    One more thing is ,in order to show validates_associated error 
message than the regular message "is invalid" I am using the hack in 
environment.rb like

module ActiveRecord::Validations::ClassMethods
  def validates_associated(*associations)
      associations.each do |association|
        class_eval do
          validates_each(associations) do |record, associate_name, 
value|
            associates = record.send(associate_name)
            associates = [associates] unless 
associates.respond_to?('each')
            associates.each do |associate|
              if associate && !associate.valid?
                associate.errors.each do |key, value|
                  record.errors.add(key, value)
                end
              end
            end
          end
        end
      end
  end
end
-- 
Posted via http://www.ruby-forum.com/.

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

Reply via email to