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

Does not work with non pluralized table names #69

Closed
rlow opened this issue Mar 13, 2016 · 1 comment
Closed

Does not work with non pluralized table names #69

rlow opened this issue Mar 13, 2016 · 1 comment

Comments

@rlow
Copy link

rlow commented Mar 13, 2016

We use singular table names in our apps by setting ActiveRecord::Base.pluralize_table_names = false in application.rb. Baked in references to "read_marks" causes SQL errors.

Would using "#{ReadMark.table_name}" in the sql strings in the scopes instead of "read_marks" fix this issue?

@ledermann
Copy link
Owner

Thanks for reporting this issue, @rlow

However, I don't like the fix, building SQL queries with LEFT JOIN, SELECT, WHERE and GROUP using ActiveRecord results in too much string interpolation. If anyone knows a cleaner way, please tell me!

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

2 participants