notifiable-rails 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/notifiable/{notifications_controller.rb → notification_statuses_controller.rb} +9 -13
  3. data/config/routes.rb +1 -1
  4. data/db/migrate/20131210115649_create_notifiable_device_tokens.rb +1 -0
  5. data/db/migrate/20131210115650_create_notifiable_notifications.rb +0 -10
  6. data/db/migrate/20131210115651_create_notifiable_localized_notifications.rb +22 -0
  7. data/db/migrate/{20131210115651_create_notifiable_statuses.rb → 20131210115652_create_notifiable_statuses.rb} +1 -1
  8. data/lib/generators/notifiable/install/templates/initializer.rb +1 -1
  9. data/lib/notifiable/device_token.rb +1 -0
  10. data/lib/notifiable/localized_notification.rb +14 -0
  11. data/lib/notifiable/notification.rb +12 -3
  12. data/lib/notifiable/notification_status.rb +6 -1
  13. data/lib/notifiable/notifier_base.rb +6 -2
  14. data/lib/notifiable/version.rb +1 -1
  15. data/lib/notifiable.rb +5 -1
  16. data/spec/controllers/device_tokens_controller_spec.rb +1 -1
  17. data/spec/controllers/{notifications_controller_spec.rb → notification_statuses_controller_spec.rb} +14 -14
  18. data/spec/model/device_token_spec.rb +16 -0
  19. data/spec/model/localized_notification_spec.rb +38 -0
  20. data/spec/model/notifiable_spec.rb +3 -3
  21. data/spec/model/notification_spec.rb +21 -30
  22. data/spec/spec_helper.rb +4 -0
  23. data/spec/support/factories.rb +17 -6
  24. data/spec/test_app/db/development.sqlite3 +0 -0
  25. data/spec/test_app/db/migrate/{20131210115652_create_users.rb → 20131210115660_create_users.rb} +0 -0
  26. data/spec/test_app/db/schema.rb +11 -3
  27. data/spec/test_app/db/test.sqlite3 +0 -0
  28. data/spec/test_app/log/development.log +57 -0
  29. data/spec/test_app/log/test.log +38505 -0
  30. metadata +14 -8
@@ -1646753,3 +1646753,60 @@ Migrating to CreateUsers (20131210115652)
1646753
1646753
  FROM sqlite_temp_master
1646754
1646754
  WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
1646755
1646755
 
1646756
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
1646757
+  (0.1ms) select sqlite_version(*)
1646758
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1646759
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646760
+ Migrating to CreateNotifiableApps (20131210115648)
1646761
+  (0.1ms) begin transaction
1646762
+  (0.3ms) CREATE TABLE "notifiable_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "configuration" text, "created_at" datetime, "updated_at" datetime)
1646763
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115648"]]
1646764
+  (0.6ms) commit transaction
1646765
+ Migrating to CreateNotifiableDeviceTokens (20131210115649)
1646766
+  (0.0ms) begin transaction
1646767
+  (0.3ms) CREATE TABLE "notifiable_device_tokens" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "token" varchar(255), "provider" varchar(255), "locale" varchar(255), "is_valid" boolean DEFAULT 't', "user_id" integer, "app_id" integer, "created_at" datetime, "updated_at" datetime)
1646768
+  (0.7ms) CREATE UNIQUE INDEX "index_notifiable_device_tokens_on_token" ON "notifiable_device_tokens" ("token")
1646769
+  (0.1ms) SELECT sql
1646770
+ FROM sqlite_master
1646771
+ WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
1646772
+ UNION ALL
1646773
+ SELECT sql
1646774
+ FROM sqlite_temp_master
1646775
+ WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
1646776
+
1646777
+  (0.1ms) CREATE INDEX "index_notifiable_device_tokens_on_user_id" ON "notifiable_device_tokens" ("user_id")
1646778
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115649"]]
1646779
+  (0.6ms) commit transaction
1646780
+ Migrating to CreateNotifiableNotifications (20131210115650)
1646781
+  (0.0ms) begin transaction
1646782
+  (0.3ms) CREATE TABLE "notifiable_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "message" text, "params" text, "app_id" integer, "sent_count" integer DEFAULT 0, "gateway_accepted_count" integer DEFAULT 0, "opened_count" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime) 
1646783
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115650"]]
1646784
+  (0.5ms) commit transaction
1646785
+ Migrating to CreateNotifiableStatuses (20131210115651)
1646786
+  (0.0ms) begin transaction
1646787
+  (0.2ms) CREATE TABLE "notifiable_statuses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "notification_id" integer, "device_token_id" integer, "status" integer, "created_at" datetime) 
1646788
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115651"]]
1646789
+  (0.5ms) commit transaction
1646790
+ Migrating to CreateUsers (20131210115652)
1646791
+  (0.0ms) begin transaction
1646792
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL) 
1646793
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115652"]]
1646794
+  (0.5ms) commit transaction
1646795
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646796
+  (0.1ms)  SELECT sql
1646797
+ FROM sqlite_master
1646798
+ WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
1646799
+ UNION ALL
1646800
+ SELECT sql
1646801
+ FROM sqlite_temp_master
1646802
+ WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
1646803
+ 
1646804
+  (0.1ms) SELECT sql
1646805
+ FROM sqlite_master
1646806
+ WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
1646807
+ UNION ALL
1646808
+ SELECT sql
1646809
+ FROM sqlite_temp_master
1646810
+ WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
1646811
+
1646812
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"