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

suggested chang to fix issue #20 (https://github.com/PRX/apn_on_rails/issues#issue/20) #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andreasmueller
Copy link

As suggested, the code now uses only one query (rather than a query per device) to get all notifications. I have tested the code only locally, so please review carefully ..

Rather than making a query for each device, we can get all unsent
notifications for a given app with one SQL query.

The change also required a slight update of the app_spec.
The APN::Notification.find call returned read-only ActiveRecords, which
can be prevented by specifying :select.

-> see http://stackoverflow.com/questions/639171/what-is-causing-this-activerecordreadonlyrecord-error
@stuartkhall
Copy link

Please merge this :)

@jeffday
Copy link

jeffday commented Oct 17, 2013

👍

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.

3 participants