activator 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5ceab0bce92373bd8b8f1ac5252585a5e37648e
4
- data.tar.gz: 590698a2c749e83003fb12f3af656855d69e6bfa
3
+ metadata.gz: a0144188c149944e489bf8bf884a87076dee9f3d
4
+ data.tar.gz: 30cb7237b762860a06654aa483d98f1805adeb7a
5
5
  SHA512:
6
- metadata.gz: c473b58d0ee8a0237ddc69e7155ffab29ff0e976b31d209702058712ac012d68ed489aec44521e329cfc26f82d2d1e8081e9d32a1fb0746b64b31cbf1e581d04
7
- data.tar.gz: 51d23d069b2669ae4bce44b61405f6694e8c1294c92ce582411861b4ea6cf384f5705535b4e4d40dd834ce8a8e84de066224184baa742fbb8a78d3dca8aebefa
6
+ metadata.gz: 2d13af8c4792d556bd7b92fdc3b6e019eeaba771bf9e19b469ec0c6fe6100de810c304f199a6f79341c2adee37e61485ef38a53a2bc9e3fcf697db73258f73ca
7
+ data.tar.gz: cb358f86dd945ef01d36cd9b1e35f8530ba4de27b15d31edf46587f2da07474439833108021a4e0a0c2ecb4effc1b6e927bfdabfc2586b40fd2ef939b13a7cae
@@ -1,3 +1,5 @@
1
+ require 'activator/railtie' if defined?(Rails)
2
+
1
3
  module Activator
2
4
  extend ActiveSupport::Concern
3
5
 
@@ -32,5 +34,3 @@ module Activator
32
34
  end
33
35
  end
34
36
  end
35
-
36
- ActiveRecord::Base.send :include, Activator
@@ -0,0 +1,9 @@
1
+ module Activator
2
+ class Railtie < Rails::Railtie
3
+ initializer 'attached.initialize' do
4
+ ActiveSupport.on_load(:active_record) do
5
+ ActiveRecord::Base.send :include, Activator
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Activator
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -50,3 +50,12 @@ Migrating to CreateUsers (20140425024510)
50
50
   (0.1ms) SELECT version FROM "schema_migrations"
51
51
   (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140425024510')
52
52
   (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140424234705')
53
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
54
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
55
+  (0.9ms) CREATE TABLE "projects" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "active" boolean, "created_at" datetime, "updated_at" datetime) 
56
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)
57
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
58
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
59
+  (0.1ms) SELECT version FROM "schema_migrations"
60
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140425024510')
61
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140424234705')
@@ -1658,3 +1658,297 @@ ActivatorTest: test_it_shouldnt_have_deactivation_methods_if_not_an_activator
1658
1658
  SQL (0.6ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 25 Apr 2014 03:04:24 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:04:24 UTC +00:00]]
1659
1659
   (0.1ms) RELEASE SAVEPOINT active_record_1
1660
1660
   (0.6ms) rollback transaction
1661
+  (0.2ms) begin transaction
1662
+ ------------------------------------------------
1663
+ ActivatorTest: test_it_can_find_the_active_items
1664
+ ------------------------------------------------
1665
+  (0.0ms) SAVEPOINT active_record_1
1666
+ SQL (1.8ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1667
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1668
+  (0.0ms) SAVEPOINT active_record_1
1669
+ SQL (0.9ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1670
+ Project Load (0.2ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1671
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1672
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."active" = 't' LIMIT 1
1673
+  (1.0ms) rollback transaction
1674
+  (0.1ms) begin transaction
1675
+ --------------------------------------------------------------------------
1676
+ ActivatorTest: test_it_deactivates_old_items_when_creating_new_active_ones
1677
+ --------------------------------------------------------------------------
1678
+  (0.0ms) SAVEPOINT active_record_1
1679
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1680
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 1) AND "projects"."active" = 't'
1681
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1682
+  (0.0ms) SAVEPOINT active_record_1
1683
+ SQL (0.4ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1684
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1685
+ SQL (0.3ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", false], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1686
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1687
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1688
+  (0.5ms) rollback transaction
1689
+  (0.0ms) begin transaction
1690
+ ----------------------------------------------------------------------------------
1691
+ ActivatorTest: test_it_deactivates_other_items_when_setting_another_item_to_active
1692
+ ----------------------------------------------------------------------------------
1693
+  (0.1ms) SAVEPOINT active_record_1
1694
+ SQL (0.4ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1695
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1696
+  (0.0ms) SAVEPOINT active_record_1
1697
+ SQL (0.4ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1698
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1699
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1700
+  (0.1ms) SAVEPOINT active_record_1
1701
+ SQL (0.2ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", true], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1702
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 1) AND "projects"."active" = 't'
1703
+ SQL (0.1ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 2 [["active", false], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1704
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1705
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1706
+ Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 2]]
1707
+  (0.4ms) rollback transaction
1708
+  (0.0ms) begin transaction
1709
+ -----------------------------------------------------------------------------------
1710
+ ActivatorTest: test_it_shouldnt_have_an_active_class_method_if_its_not_an_activator
1711
+ -----------------------------------------------------------------------------------
1712
+  (0.1ms) rollback transaction
1713
+  (0.0ms) begin transaction
1714
+ -----------------------------------------------------------------------------
1715
+ ActivatorTest: test_it_shouldnt_have_deactivation_methods_if_not_an_activator
1716
+ -----------------------------------------------------------------------------
1717
+  (0.0ms) SAVEPOINT active_record_1
1718
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:18:35 UTC +00:00]]
1719
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1720
+  (0.4ms) rollback transaction
1721
+  (0.2ms) begin transaction
1722
+ ------------------------------------------------
1723
+ ActivatorTest: test_it_can_find_the_active_items
1724
+ ------------------------------------------------
1725
+  (0.0ms) SAVEPOINT active_record_1
1726
+ SQL (1.9ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1727
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1728
+  (0.0ms) SAVEPOINT active_record_1
1729
+ SQL (0.7ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1730
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1731
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1732
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."active" = 't' LIMIT 1
1733
+  (1.1ms) rollback transaction
1734
+  (0.1ms) begin transaction
1735
+ --------------------------------------------------------------------------
1736
+ ActivatorTest: test_it_deactivates_old_items_when_creating_new_active_ones
1737
+ --------------------------------------------------------------------------
1738
+  (0.1ms) SAVEPOINT active_record_1
1739
+ SQL (0.4ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1740
+ Project Load (0.2ms) SELECT "projects".* FROM "projects" WHERE (id <> 1) AND "projects"."active" = 't'
1741
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1742
+  (0.1ms) SAVEPOINT active_record_1
1743
+ SQL (0.5ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1744
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1745
+ SQL (0.2ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", false], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1746
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1747
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1748
+  (0.5ms) rollback transaction
1749
+  (0.0ms) begin transaction
1750
+ ----------------------------------------------------------------------------------
1751
+ ActivatorTest: test_it_deactivates_other_items_when_setting_another_item_to_active
1752
+ ----------------------------------------------------------------------------------
1753
+  (0.0ms) SAVEPOINT active_record_1
1754
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1755
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1756
+  (0.0ms) SAVEPOINT active_record_1
1757
+ SQL (0.2ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1758
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1759
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1760
+  (0.0ms) SAVEPOINT active_record_1
1761
+ SQL (0.1ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", true], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1762
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 1) AND "projects"."active" = 't'
1763
+ SQL (0.1ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 2 [["active", false], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1764
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1765
+ Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1766
+ Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 2]]
1767
+  (0.4ms) rollback transaction
1768
+  (0.0ms) begin transaction
1769
+ -----------------------------------------------------------------------------------
1770
+ ActivatorTest: test_it_shouldnt_have_an_active_class_method_if_its_not_an_activator
1771
+ -----------------------------------------------------------------------------------
1772
+  (0.1ms) rollback transaction
1773
+  (0.1ms) begin transaction
1774
+ -----------------------------------------------------------------------------
1775
+ ActivatorTest: test_it_shouldnt_have_deactivation_methods_if_not_an_activator
1776
+ -----------------------------------------------------------------------------
1777
+  (0.1ms) SAVEPOINT active_record_1
1778
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:31:19 UTC +00:00]]
1779
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1780
+  (0.5ms) rollback transaction
1781
+  (0.3ms) begin transaction
1782
+ ------------------------------------------------
1783
+ ActivatorTest: test_it_can_find_the_active_items
1784
+ ------------------------------------------------
1785
+  (0.0ms) SAVEPOINT active_record_1
1786
+ SQL (2.0ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1787
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1788
+  (0.0ms) SAVEPOINT active_record_1
1789
+ SQL (1.0ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1790
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1791
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1792
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."active" = 't' LIMIT 1
1793
+  (1.2ms) rollback transaction
1794
+  (0.1ms) begin transaction
1795
+ --------------------------------------------------------------------------
1796
+ ActivatorTest: test_it_deactivates_old_items_when_creating_new_active_ones
1797
+ --------------------------------------------------------------------------
1798
+  (0.0ms) SAVEPOINT active_record_1
1799
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1800
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 1) AND "projects"."active" = 't'
1801
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1802
+  (0.0ms) SAVEPOINT active_record_1
1803
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1804
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1805
+ SQL (0.2ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", false], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1806
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1807
+ Project Load (0.2ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1808
+  (0.5ms) rollback transaction
1809
+  (0.0ms) begin transaction
1810
+ ----------------------------------------------------------------------------------
1811
+ ActivatorTest: test_it_deactivates_other_items_when_setting_another_item_to_active
1812
+ ----------------------------------------------------------------------------------
1813
+  (0.0ms) SAVEPOINT active_record_1
1814
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1815
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1816
+  (0.0ms) SAVEPOINT active_record_1
1817
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1818
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1819
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1820
+  (0.0ms) SAVEPOINT active_record_1
1821
+ SQL (0.1ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", true], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1822
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 1) AND "projects"."active" = 't'
1823
+ SQL (0.1ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 2 [["active", false], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1824
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1825
+ Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1826
+ Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 2]]
1827
+  (0.4ms) rollback transaction
1828
+  (0.1ms) begin transaction
1829
+ -----------------------------------------------------------------------------------
1830
+ ActivatorTest: test_it_shouldnt_have_an_active_class_method_if_its_not_an_activator
1831
+ -----------------------------------------------------------------------------------
1832
+  (0.1ms) rollback transaction
1833
+  (0.0ms) begin transaction
1834
+ -----------------------------------------------------------------------------
1835
+ ActivatorTest: test_it_shouldnt_have_deactivation_methods_if_not_an_activator
1836
+ -----------------------------------------------------------------------------
1837
+  (0.0ms) SAVEPOINT active_record_1
1838
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 03:39:03 UTC +00:00]]
1839
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1840
+  (0.3ms) rollback transaction
1841
+  (1.9ms) CREATE TABLE "projects" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "active" boolean, "created_at" datetime, "updated_at" datetime) 
1842
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)
1843
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
1844
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1845
+  (0.1ms) SELECT version FROM "schema_migrations"
1846
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140425024510')
1847
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140424234705')
1848
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1849
+  (0.3ms) begin transaction
1850
+ ------------------------------------------------
1851
+ ActivatorTest: test_it_can_find_the_active_items
1852
+ ------------------------------------------------
1853
+  (0.1ms) rollback transaction
1854
+  (0.1ms) begin transaction
1855
+ --------------------------------------------------------------------------
1856
+ ActivatorTest: test_it_deactivates_old_items_when_creating_new_active_ones
1857
+ --------------------------------------------------------------------------
1858
+  (0.1ms) SAVEPOINT active_record_1
1859
+ SQL (4.1ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00]]
1860
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1861
+  (0.0ms) SAVEPOINT active_record_1
1862
+ SQL (0.8ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00]]
1863
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1864
+ Project Load (0.2ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1865
+  (0.5ms) rollback transaction
1866
+  (0.0ms) begin transaction
1867
+ ----------------------------------------------------------------------------------
1868
+ ActivatorTest: test_it_deactivates_other_items_when_setting_another_item_to_active
1869
+ ----------------------------------------------------------------------------------
1870
+  (0.0ms) SAVEPOINT active_record_1
1871
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00]]
1872
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1873
+  (0.0ms) SAVEPOINT active_record_1
1874
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00]]
1875
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1876
+  (0.0ms) SAVEPOINT active_record_1
1877
+ SQL (0.2ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", true], ["updated_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00]]
1878
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1879
+ Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1880
+ Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 2]]
1881
+  (0.4ms) rollback transaction
1882
+  (0.1ms) begin transaction
1883
+ -----------------------------------------------------------------------------------
1884
+ ActivatorTest: test_it_shouldnt_have_an_active_class_method_if_its_not_an_activator
1885
+ -----------------------------------------------------------------------------------
1886
+  (0.1ms) rollback transaction
1887
+  (0.1ms) begin transaction
1888
+ -----------------------------------------------------------------------------
1889
+ ActivatorTest: test_it_shouldnt_have_deactivation_methods_if_not_an_activator
1890
+ -----------------------------------------------------------------------------
1891
+  (0.0ms) SAVEPOINT active_record_1
1892
+ SQL (0.7ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:41:33 UTC +00:00]]
1893
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1894
+  (0.5ms) rollback transaction
1895
+  (0.3ms) begin transaction
1896
+ ------------------------------------------------
1897
+ ActivatorTest: test_it_can_find_the_active_items
1898
+ ------------------------------------------------
1899
+  (0.1ms) SAVEPOINT active_record_1
1900
+ SQL (2.6ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1901
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1902
+  (0.0ms) SAVEPOINT active_record_1
1903
+ SQL (0.7ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1904
+ Project Load (0.2ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1905
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1906
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."active" = 't' LIMIT 1
1907
+  (0.4ms) rollback transaction
1908
+  (0.1ms) begin transaction
1909
+ --------------------------------------------------------------------------
1910
+ ActivatorTest: test_it_deactivates_old_items_when_creating_new_active_ones
1911
+ --------------------------------------------------------------------------
1912
+  (0.0ms) SAVEPOINT active_record_1
1913
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1914
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 1) AND "projects"."active" = 't'
1915
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1916
+  (0.0ms) SAVEPOINT active_record_1
1917
+ SQL (1.9ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1918
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1919
+ SQL (0.2ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", false], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1920
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1921
+ Project Load (0.2ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1922
+  (0.4ms) rollback transaction
1923
+  (0.1ms) begin transaction
1924
+ ----------------------------------------------------------------------------------
1925
+ ActivatorTest: test_it_deactivates_other_items_when_setting_another_item_to_active
1926
+ ----------------------------------------------------------------------------------
1927
+  (0.0ms) SAVEPOINT active_record_1
1928
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", false], ["created_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1929
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1930
+  (0.0ms) SAVEPOINT active_record_1
1931
+ SQL (0.3ms) INSERT INTO "projects" ("active", "created_at", "updated_at") VALUES (?, ?, ?) [["active", true], ["created_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1932
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 2) AND "projects"."active" = 't'
1933
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1934
+  (0.1ms) SAVEPOINT active_record_1
1935
+ SQL (0.1ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 1 [["active", true], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1936
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE (id <> 1) AND "projects"."active" = 't'
1937
+ SQL (0.2ms) UPDATE "projects" SET "active" = ?, "updated_at" = ? WHERE "projects"."id" = 2 [["active", false], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1938
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1939
+ Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 1]]
1940
+ Project Load (0.0ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", 2]]
1941
+  (0.4ms) rollback transaction
1942
+  (0.1ms) begin transaction
1943
+ -----------------------------------------------------------------------------------
1944
+ ActivatorTest: test_it_shouldnt_have_an_active_class_method_if_its_not_an_activator
1945
+ -----------------------------------------------------------------------------------
1946
+  (0.1ms) rollback transaction
1947
+  (0.0ms) begin transaction
1948
+ -----------------------------------------------------------------------------
1949
+ ActivatorTest: test_it_shouldnt_have_deactivation_methods_if_not_an_activator
1950
+ -----------------------------------------------------------------------------
1951
+  (0.1ms) SAVEPOINT active_record_1
1952
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00], ["updated_at", Fri, 25 Apr 2014 11:42:59 UTC +00:00]]
1953
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1954
+  (0.4ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jelmer Snoeck
@@ -45,9 +45,9 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - lib/activator/railtie.rb
48
49
  - lib/activator/version.rb
49
50
  - lib/activator.rb
50
- - lib/tasks/activator_tasks.rake
51
51
  - MIT-LICENSE
52
52
  - Rakefile
53
53
  - test/activator_test.rb
@@ -96,7 +96,7 @@ files:
96
96
  - test/dummy/test/models/project_test.rb
97
97
  - test/dummy/test/models/user_test.rb
98
98
  - test/test_helper.rb
99
- homepage: ''
99
+ homepage: https://github.com/jelmersnoeck/activator
100
100
  licenses: []
101
101
  metadata: {}
102
102
  post_install_message:
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.0.2
118
+ rubygems_version: 2.1.11
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Mark one model as active
@@ -166,4 +166,3 @@ test_files:
166
166
  - test/dummy/test/models/project_test.rb
167
167
  - test/dummy/test/models/user_test.rb
168
168
  - test/test_helper.rb
169
- has_rdoc:
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :activator do
3
- # # Task goes here
4
- # end