Skip to content

Support arbitrary expressions in sum_cache and sum_through_many_cache #10

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

Closed
wants to merge 9 commits into from

Conversation

TSMMark
Copy link
Contributor

@TSMMark TSMMark commented May 6, 2017

Related Issue: #9

TODO:

  • Support in sum_cache
  • Support in sum_through_many_cache
  • Use Sequel.lit for table names
  • Documentation
Page not found · GitHub · GitHub
Skip to content
404 “This is not the web page you are looking for”
@TSMMark
Copy link
Contributor Author

TSMMark commented May 6, 2017

@jeremyevans all set. lmk if you need anything else

@jeremyevans
Copy link
Owner

This looks mostly good, thanks for the patch.

However, one of the rules in Sequel development is to never attempt to parse SQL, because it's basically not possible to handle even simple cases correctly. What if summed_column is :NEW or :OLD?

The correct way to handle this is to use Sequel.lit('NEW') instead of :NEW (and likewise for :OLD), and remove the gsub calls.

I don't see any documentation updates for this. I think the documentation should probably be updated to show it is possible to use expressions in addition to columns.

With those issues fixed, I'll try to test this in the next few days, and assuming no problems it will be merged and a new gem released.

@TSMMark
Copy link
Contributor Author

TSMMark commented May 8, 2017

Thanks for the quick feedback! All taken care of and documentation added. Looking forward to the new release

@jeremyevans
Copy link
Owner

I've released 1.3.0 with this these commits. I rebased this pull request to get rid of the unnecessary merge commit, which is why this didn't get closed automatically. Thanks for your work on this!

@jeremyevans jeremyevans closed this May 8, 2017
@TSMMark
Copy link
Contributor Author

TSMMark commented May 8, 2017

Don't mention it! Thanks for shipping so quickly. Really awesome

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