Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:if should not fire on validations when not in context with :on #344

Closed
wants to merge 2 commits into from
Closed

:if should not fire on validations when not in context with :on #344

wants to merge 2 commits into from

Conversation

asanghi
Copy link
Contributor

@asanghi asanghi commented Apr 28, 2011

Related to Issue#341

#341

validates :title, :presence => true, :if => Proc.new do |x|
    #expensive action
 end, :on => :update

The validation should not call the Proc above during :create

The bug above states that as the problem. This patch fixes it.

/cc @josevalim @jwkpiano1

@josevalim
Copy link
Contributor

Merged!

@josevalim josevalim closed this Apr 29, 2011
martinploeger pushed a commit to martinploeger/rails that referenced this pull request Apr 29, 2011
:if should not fire on validations when not in context with :on
matthewd added a commit that referenced this pull request Apr 24, 2018
…gresql

{Matches,DoesNotMatch} support the ESCAPE clause with PostgreSQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants