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

deprecation warning clarifies which field value is invalid #19956

Merged
merged 1 commit into from
May 4, 2015

Conversation

alexch
Copy link

@alexch alexch commented Apr 29, 2015

This deprecation warning currently says "You attempted to assign a value which is not explicitly true or false to a boolean column" but doesn't say which column or value is the culprit. This patch makes it easier to track down mistakes and correct them by clearly saying what value was not found in the list of acceptable TRUE and FALSE values.

(Unfortunately it doesn't know which field was being set, just what value, but it's much better than it was.)

This deprecation warning currently says "You attempted to assign a value which is not explicitly `true` or `false` to a boolean column" but doesn't say *which* column or value is the culprit. This patch makes it easier to track down mistakes and correct them by clearly saying what value was not found in the list of acceptable TRUE and FALSE values. 

(Unfortunately it doesn't know which *field* was being set, just what *value*, but it's much better than it was.)
@harlantwood
Copy link

+1

@zzak
Copy link
Member

zzak commented Apr 29, 2015

So value is only going to be true or false in this case, we don't know the column at the time. We can get the column lazily, but that may mean executing a sql query.

@alexch
Copy link
Author

alexch commented Apr 30, 2015

Nope. value is the entered value. Trust me, I hacked my gem and it showed me I was trying to set a boolean to "Oil Change" :-)

rafaelfranca added a commit that referenced this pull request May 4, 2015
deprecation warning clarifies which field value is invalid
@rafaelfranca rafaelfranca merged commit 0a67cf0 into rails:4-2-stable May 4, 2015
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

4 participants