Is ActiveRecord considered best practice in the model / should validates_presence_of be used when validates_presence_of is also used?
For instance:
class Company < ActiveRecord::Base validates_presence_of :name validates_length_of :name, :in => 5..30 end
To me this seems redundant. A length of 5 to 30 means the attribute is also present, but I see that it is used everywhere. It also means that users receive two error messages regarding the same missing attribute when only one is really needed.
Am I missing something, or are people overly diligent when checking data?
source share