Skip to content

Conversation

senny
Copy link
Member

@senny senny commented Mar 9, 2013

This is a follow up to #5321 and follows the general direction in AR to make things lazy evaluated.

Open points:

  • Do we need a deprecation for the old syntax?
  • Do we need to support the old syntax?

@senny
Copy link
Member Author

senny commented Mar 9, 2013

@carlosantoniodasilva as discussed.

@josevalim
Copy link
Contributor

👍

A deprecation would be nice, since it seems easy to support both formats.

@senny
Copy link
Member Author

senny commented Mar 9, 2013

thanks @josevalim, I'll update to support both formats and issue a deprecation on the old style.

@senny
Copy link
Member Author

senny commented Mar 9, 2013

I added a deprecation warning for the old syntax but it is still supported.

/cc @josevalim @carlosantoniodasilva

@carlosantoniodasilva
Copy link
Member

@josevalim This feature was added to rails master only, so I think there's no need to deprecate. Sorry to make you undo the work @senny :)


validates_uniqueness_of :title, conditions: -> { where('approved = ?', true) }

*Yves Senn*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@senny I think the feature itself doesn't have a changelog entry, so perhaps you could make this the official one and put both yours and the other author names, wdyt?

This is a follow up to rails#5321 and follows the general direction in
AR to make things lazy evaluated.
carlosantoniodasilva added a commit that referenced this pull request Mar 9, 2013
Uniqueness validation uses a proc to specify the `:conditions` option.

This is a follow up to #5321 and follows the general direction in
AR to make things lazy evaluated.
@carlosantoniodasilva carlosantoniodasilva merged commit bbc87db into rails:master Mar 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants