Displaying 3 results from an estimated 3 matches for "validate_presence".
Did you mean:
validates_presence
2008 May 15
0
partial_updates feature in rails 2.1, failing to save because of validate_presence _of on other attributes in the table
I am trying to use the new partial_updates feature in rails 2.1,
http://dev.rubyonrails.org/changeset/9157
but it is failing by trying to use all validations in the model
instead of just the changed attributes. The model works as I can
successfully .save(false) but if I try a regular .save I get an error
saying that it could not save because of validations problems. I want
to use this to get
2006 Jan 08
22
Putting it all in one place with Schemas
I''m still relatively new to ROR, but I like what I see with the
database-neutral approach of Schemas. In the spirit of keeping it
simple and minimizing the number of files and location of information,
does ActiveState currently allow me to go ahead and place other low
level model information such as validation requirements and associations
inside the schema rather than putting it in
2006 May 23
11
putting the schema in the model files
...ActiveRecord::Base
has_many :posts
attribute :name, :string
attribute :email, :string do |a|
a.validate_format :with => /regex/
end
end
class Post < ActiveRecord::Base
belongs_to :author # automatically adds author_id to the table
attribute :title, :string do |a|
a.validate_presence
a.validate_length :in => 3..100
end
attribute :summary, :text
attribute :content, :text
end
---------------------
[from: http://lists.rubyonrails.org/pipermail/rails/2006-January/011325.html]
Then Jon Smirl comes up with a list of what needs to be done to make
migrations play along s...