diff --git a/Gemfile b/Gemfile index 1edc6c2..6d69f9e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ source "http://rubygems.org" -gem 'configatron' gem 'json' group :development do diff --git a/gcm_on_rails.gemspec b/gcm_on_rails.gemspec index 5fc23ee..f7ffe5b 100644 --- a/gcm_on_rails.gemspec +++ b/gcm_on_rails.gemspec @@ -47,20 +47,17 @@ Gem::Specification.new do |s| s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 0"]) s.add_runtime_dependency(%q, [">= 0"]) s.add_development_dependency(%q, ["~> 3.12"]) s.add_development_dependency(%q, ["~> 1.0.0"]) s.add_development_dependency(%q, ["~> 1.8.4"]) else - s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, ["~> 3.12"]) s.add_dependency(%q, ["~> 1.0.0"]) s.add_dependency(%q, ["~> 1.8.4"]) end else - s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, ["~> 3.12"]) s.add_dependency(%q, ["~> 1.0.0"]) diff --git a/lib/gcm_on_rails/app/models/gcm/device.rb b/lib/gcm_on_rails/app/models/gcm/device.rb index 165aeaa..ea604af 100644 --- a/lib/gcm_on_rails/app/models/gcm/device.rb +++ b/lib/gcm_on_rails/app/models/gcm/device.rb @@ -11,8 +11,6 @@ class Gcm::Device < Gcm::Base self.table_name = "gcm_devices" - attr_accessible :registration_id - has_many :notifications, :class_name => 'Gcm::Notification', :dependent => :destroy validates_presence_of :registration_id validates_uniqueness_of :registration_id diff --git a/lib/gcm_on_rails/app/models/gcm/notification.rb b/lib/gcm_on_rails/app/models/gcm/notification.rb index 8b144ac..e79edfd 100644 --- a/lib/gcm_on_rails/app/models/gcm/notification.rb +++ b/lib/gcm_on_rails/app/models/gcm/notification.rb @@ -30,11 +30,7 @@ class << self # def send_notifications(notifications = Gcm::Notification.all(:conditions => {:sent_at => nil}, :joins => :device, :readonly => false)) - if configatron.gcm_on_rails.delivery_format and configatron.gcm_on_rails.delivery_format == 'plain_text' - format = "plain_text" - else - format = "json" - end + format = "json" unless notifications.nil? || notifications.empty? api_key = Gcm::Connection.open diff --git a/lib/gcm_on_rails/gcm_on_rails.rb b/lib/gcm_on_rails/gcm_on_rails.rb index 9db5d55..bc9c963 100644 --- a/lib/gcm_on_rails/gcm_on_rails.rb +++ b/lib/gcm_on_rails/gcm_on_rails.rb @@ -1,4 +1,3 @@ -require 'configatron' require 'uri' module Gcm @@ -85,4 +84,4 @@ def initialize(message) ActiveSupport::Dependencies.autoload_paths << path ActiveSupport::Dependencies.autoload_once_paths.delete(path) end -end \ No newline at end of file +end diff --git a/lib/gcm_on_rails/libs/connection.rb b/lib/gcm_on_rails/libs/connection.rb index c240329..7813b7a 100644 --- a/lib/gcm_on_rails/libs/connection.rb +++ b/lib/gcm_on_rails/libs/connection.rb @@ -24,7 +24,7 @@ def send_notification(notification, api_key, format) data = "#{extra_data}#{post_data}" end - url_string = configatron.gcm_on_rails.api_url + url_string = CONFIG[:api_url] url = URI.parse url_string http = Net::HTTP.new(url.host, url.port) http.use_ssl = true @@ -36,7 +36,7 @@ def send_notification(notification, api_key, format) end def open - configatron.gcm_on_rails.api_key + CONFIG[:api_key] end end end