diff --git a/lib/apn_on_rails/app/models/apn/app.rb b/lib/apn_on_rails/app/models/apn/app.rb index 81404900..49584be9 100644 --- a/lib/apn_on_rails/app/models/apn/app.rb +++ b/lib/apn_on_rails/app/models/apn/app.rb @@ -46,7 +46,7 @@ def self.send_notifications_for_cert(the_cert, app_id) end begin APN::Connection.open_for_delivery({:cert => the_cert}) do |conn, sock| - notifications = APN::Notification.find(:all, :conditions => conditions, :joins => " INNER JOIN apn_devices ON apn_devices.id = apn_notifications.device_id") + notifications = APN::Notification.find(:all, :select => "apn_notifications.*", :conditions => conditions, :joins => " INNER JOIN apn_devices ON apn_devices.id = apn_notifications.device_id") notifications.each do |noty| conn.write(noty.message_for_sending) noty.sent_at = Time.now