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

syntax error for null column.type_cast_code #229

Closed
wants to merge 1 commit into from
Closed

syntax error for null column.type_cast_code #229

wants to merge 1 commit into from

Conversation

damianham
Copy link

In activerecord/lib/active_record/attribute_methods/read.rb define_read_method() if column.type_cast_code('v') returns nil then you get a syntax error when the code is evaluated because the resulting access_code ends with "&& ;"

@tenderlove
Copy link
Member

type_case_code should never return nil. Are you using mysql2 with edge rails by chance?

@damianham
Copy link
Author

yes I am

@tenderlove
Copy link
Member

If you're working against edge rails, please use edge mysql2. We've moved the database adapter from mysql2 in to rails master. That should fix this problem! :-)

@tenderlove tenderlove closed this Mar 17, 2011
@damianham
Copy link
Author

well I hate to be a pedant but this wasn't helpful. I am not a rails core committer - just a rails user that hit a problem that others will hit and tried to be helpful with a 1 line fix. Going by this quote from the Rails 3 release notes at http://guides.rubyonrails.org/3_0_release_notes.html

"On top of all that, we’ve tried our best to deprecate the old APIs with nice warnings. That means that you can move your existing application to Rails 3 without immediately rewriting all your old code to the latest best practices."

I don't think it unreasonable to expect to be able to use the mysql2 gem with my rails 3 application. I found zero info when searching for various combinations of "use edge mysql2". So how do I how "use edge mysql2" with edge rails ? and wouldn't it be better to include this simple 1 line fix that tests for this case rather than just blow up if things aren't the exact way you want them ?

@damianham damianham reopened this Mar 18, 2011
@tenderlove
Copy link
Member

The Rails Gemfile in master clearly works against the unreleased version of the mysql2 gem. If you are going to work against edge rails, you need to work against the dependencies listed in our Gemfile.

@tenderlove tenderlove closed this Mar 18, 2011
matthewd pushed a commit that referenced this pull request Apr 24, 2018
Remove README inaccuracy, where does not allow multiple arguments
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