21 May '12, 4pm

Been using a Proc with an :if or :unless a lot lately in my validations:

Database constraints and/or stored procedures make the validation mechanisms database-dependent and can make testing and maintenance more difficult. However, if your database is used by other applications, it may be a good idea to use some constraints at the database level. Additionally, database-level validations can safely handle some things (such as uniqueness in heavily-used tables) that can be difficult to implement otherwise. Client-side validations can be useful, but are generally unreliable if used alone. If they are implemented using JavaScript, they may be bypassed if JavaScript is turned off in the user’s browser. However, if combined with other techniques, client-side validation can be a convenient way to provide users with immediate feedback as they use your site. Controller-level validations can be tempting to use, but often become unwieldy and difficult to t...

Full article: http://guides.rubyonrails.org/active_record_validations_c...

Tweets

Ruby on Rails Guides: Active Record Query Inter...

guides.rubyonrails.org 20 May '12, 3pm

But this approach becomes increasingly impractical as the table size increases, since User.all.each instructs Active Recor...

Ruby on Rails Guides: Active Record Query Inter...

guides.rubyonrails.org 20 May '12, 3pm

But this approach becomes increasingly impractical as the table size increases, since User.all.each instructs Active Recor...

Was I dreaming, or is there an ActiveModel modu...

railscasts.com 16 May '12, 2pm

In Rails 3 the non-database functionality of Active Record is extracted out into Active Model. This allows you to cleanly ...

@fowlduck You can get a link to a method, but r...

api.rubyonrails.org 17 May '12, 10pm

Encapsulates the pattern of wanting to validate a password or email address field with a confirmation. For example: Model:...

Rails Casts - #219 Active Model:

railscasts.com 24 May '12, 6am

When you’re thinking of doing something like this it’s always a good idea to first consider your requirements and make sur...