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

Problem when model field name is a reserved keyword #1

Open
phuongnd08 opened this issue Jun 15, 2010 · 3 comments
Open

Problem when model field name is a reserved keyword #1

phuongnd08 opened this issue Jun 15, 2010 · 3 comments

Comments

@phuongnd08
Copy link

When file name is a reserved keyword (for example sql) then the insertion will failed.

@theAlmanac
Copy link
Owner

Are the field names reserved in Rails or in SQL? If they're reserved in SQL, then I'm not sure how they can be field names in the first place ... perhaps a more specific example of the code you'd like to use? Thanks!

@phuongnd08
Copy link
Author

Reserved in SQL.
Try create a model that have a field name sql, then try insert using normal ActiveRecord operation and Crewait, you will see that Crewait fails while ActiveRecord succeed.

@syntheticLife
Copy link

it is easy to fix, the names in the sql string has to be enclosed in back ticks, that is what rails does, I ran in to this problem with a table called references and i am forking to make a patch

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

No branches or pull requests

3 participants