lazy_global_record 1.1.0 → 1.2.0

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: 3312908d16be8dafcdacccc5d18284e7c182250a
4
- data.tar.gz: cb5a6fbd1da7cd51495457272fc34463a1f0da1e
3
+ metadata.gz: 24f450b220fd634dc655b6ecccd495c6421edf1e
4
+ data.tar.gz: b9fbe19cbf8cba0d42255c415c5a50e476a67b3e
5
5
  SHA512:
6
- metadata.gz: 6ad2b93a79e1190343a7e774d14ae51a09fb98a2cb3f0a37f0cbf4517b5661e2441b0f149c8e2107c5444f1dd02a091046f66ddc4195cb99b82335818e8c2b15
7
- data.tar.gz: 7e5f0fe1a9d2a5421a10874277a1d9b7d2a0d3eb8066ec6927f138fc727a5fbebbeddac0312e8e2e6a2b4d0c1a4024bd7eb6bd36ad8263c0100234ca00585f01
6
+ metadata.gz: 266752fe81a720743b91496506d910a5110b9cddb2ad644a78813583273e20147740b9183e0696995dad612a511e596dbf68ba5a1d6551f840e7f523531964e8
7
+ data.tar.gz: e043934c9789e2b8763827d57200805fd8a7418215ba2b6d847d4e33aee1d2b917ac9a4b2b2f46aa5e08a262a6faeb742fd6b5623560fc6109594c15731ae620
data/README.md CHANGED
@@ -121,3 +121,18 @@ Keep in mind anything you do here will ordinarily be cached for the life
121
121
  of the process, you need to only cache things that won't change, or
122
122
  deal with cache invalidation by calling `reset` on the LazyGlobalRecord
123
123
  where appropriate.
124
+
125
+ #### What if I want the actual AR model?
126
+
127
+ In general, it's not safe to share an AR model object between threads, so
128
+ this can be dangerous and is not hte default.
129
+
130
+ Is it okay if the model is frozen and `readonly`? Not sure, but it might be.
131
+ If you want to try, at your own risk, there's a built-in filter proc
132
+ that returns the model object itself, but frozen and marked readonly.
133
+
134
+ ~~~ruby
135
+ lazy = LazyGlobalRecord.new(
136
+ relation: -> {where(name: "master"),
137
+ filter: LazyGlobalRecord::FROZEN_MODEL
138
+ ~~~
@@ -15,6 +15,11 @@ class LazyGlobalRecord
15
15
  end
16
16
  end
17
17
 
18
+ # Filter you can use if you really want to do this -- not sure how safe
19
+ # it is for AR to share a model between threads even if it is frozen
20
+ # and readonly!, use at your own risk.
21
+ FROZEN_MODEL = ->(obj) { obj.tap { |o| o.readonly! }.tap { |o| o.freeze } }
22
+
18
23
  def initialize( relation:,
19
24
  filter: nil,
20
25
  create_with: nil,
@@ -1,3 +1,3 @@
1
1
  class LazyGlobalRecord
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -1768,3 +1768,1319 @@ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
1768
1768
  SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-03-02 18:08:03.336266"], ["updated_at", "2016-03-02 18:08:03.336266"]]
1769
1769
   (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1770
1770
   (0.3ms) rollback transaction
1771
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1772
+  (0.1ms) begin transaction
1773
+ -----------------------------------------------------------------------
1774
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
1775
+ -----------------------------------------------------------------------
1776
+  (0.0ms) SAVEPOINT active_record_1
1777
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
1778
+  (0.1ms) SAVEPOINT active_record_1
1779
+ Value Load (0.4ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "nonesuch"]]
1780
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
1781
+  (0.0ms) rollback transaction
1782
+  (0.0ms) begin transaction
1783
+ --------------------------------------------------------------------
1784
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
1785
+ --------------------------------------------------------------------
1786
+  (0.1ms) SAVEPOINT active_record_1
1787
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "three"]]
1788
+ SQL (0.9ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", "2016-08-12 15:16:28.814837"], ["updated_at", "2016-08-12 15:16:28.814837"]]
1789
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1790
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
1791
+  (0.4ms) rollback transaction
1792
+  (0.1ms) begin transaction
1793
+ ---------------------------------------------------
1794
+ LazyGlobalRecordTest: test_it_returns_id_by_default
1795
+ ---------------------------------------------------
1796
+  (0.0ms) SAVEPOINT active_record_1
1797
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:16:28.820313"], ["updated_at", "2016-08-12 15:16:28.820313"]]
1798
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1799
+  (0.0ms) SAVEPOINT active_record_1
1800
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
1801
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1802
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
1803
+  (0.4ms) rollback transaction
1804
+  (0.1ms) begin transaction
1805
+ ----------------------------------------
1806
+ LazyGlobalRecordTest: test_custom_filter
1807
+ ----------------------------------------
1808
+  (0.0ms) SAVEPOINT active_record_1
1809
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", "2016-08-12 15:16:28.823818"], ["updated_at", "2016-08-12 15:16:28.823818"]]
1810
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1811
+  (0.0ms) SAVEPOINT active_record_1
1812
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "seven"]]
1813
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1814
+  (0.4ms) rollback transaction
1815
+  (0.0ms) begin transaction
1816
+ ----------------------------------------------
1817
+ LazyGlobalRecordTest: test_FROZEN_MODEL_filter
1818
+ ----------------------------------------------
1819
+  (0.0ms) SAVEPOINT active_record_1
1820
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:16:28.826785"], ["updated_at", "2016-08-12 15:16:28.826785"]]
1821
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1822
+  (0.1ms) SAVEPOINT active_record_1
1823
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
1824
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1825
+  (0.4ms) rollback transaction
1826
+  (0.1ms) begin transaction
1827
+ -----------------------------------------------------------
1828
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
1829
+ -----------------------------------------------------------
1830
+  (0.1ms) SAVEPOINT active_record_1
1831
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:16:28.830111"], ["updated_at", "2016-08-12 15:16:28.830111"]]
1832
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1833
+  (0.0ms) SAVEPOINT active_record_1
1834
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
1835
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1836
+ SQL (0.2ms) DELETE FROM "values"
1837
+  (0.1ms) SAVEPOINT active_record_1
1838
+ SQL (0.5ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:16:28.833669"], ["updated_at", "2016-08-12 15:16:28.833669"]]
1839
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1840
+  (0.0ms) SAVEPOINT active_record_1
1841
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
1842
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1843
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
1844
+  (0.5ms) rollback transaction
1845
+  (0.1ms) begin transaction
1846
+ ---------------------------------------------------------
1847
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
1848
+ ---------------------------------------------------------
1849
+  (0.0ms) SAVEPOINT active_record_1
1850
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
1851
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:16:28.837887"], ["updated_at", "2016-08-12 15:16:28.837887"]]
1852
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
1853
+  (0.5ms) rollback transaction
1854
+  (0.1ms) begin transaction
1855
+ -------------------------------------------------------------------
1856
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
1857
+ -------------------------------------------------------------------
1858
+  (0.1ms) SAVEPOINT active_record_1
1859
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "four"]]
1860
+ SQL (0.6ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", "2016-08-12 15:16:28.841794"], ["updated_at", "2016-08-12 15:16:28.841794"]]
1861
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1862
+  (0.5ms) rollback transaction
1863
+  (0.1ms) begin transaction
1864
+ -------------------------------------------------------
1865
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
1866
+ -------------------------------------------------------
1867
+  (0.0ms) SAVEPOINT active_record_1
1868
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "six"]]
1869
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", "2016-08-12 15:16:28.845828"], ["updated_at", "2016-08-12 15:16:28.845828"]]
1870
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1871
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
1872
+  (0.3ms) rollback transaction
1873
+  (0.1ms) begin transaction
1874
+ -------------------------------------
1875
+ LazyGlobalRecordTest: test_it_reloads
1876
+ -------------------------------------
1877
+  (0.0ms) SAVEPOINT active_record_1
1878
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:16:28.847891"], ["updated_at", "2016-08-12 15:16:28.847891"]]
1879
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1880
+  (0.0ms) SAVEPOINT active_record_1
1881
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
1882
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1883
+ SQL (0.0ms) DELETE FROM "values"
1884
+  (0.0ms) SAVEPOINT active_record_1
1885
+ SQL (0.5ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:16:28.849841"], ["updated_at", "2016-08-12 15:16:28.849841"]]
1886
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1887
+  (0.0ms) SAVEPOINT active_record_1
1888
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
1889
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1890
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
1891
+  (0.5ms) rollback transaction
1892
+  (0.1ms) begin transaction
1893
+ ---------------------------------------------------------------------------
1894
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
1895
+ ---------------------------------------------------------------------------
1896
+  (0.0ms) SAVEPOINT active_record_1
1897
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "two"]]
1898
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
1899
+  (0.0ms) rollback transaction
1900
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1901
+  (0.1ms) begin transaction
1902
+ -------------------------------------------------------------------
1903
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
1904
+ -------------------------------------------------------------------
1905
+  (0.0ms) SAVEPOINT active_record_1
1906
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "four"]]
1907
+ SQL (0.5ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", "2016-08-12 15:16:47.821547"], ["updated_at", "2016-08-12 15:16:47.821547"]]
1908
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1909
+  (1.3ms) rollback transaction
1910
+  (0.1ms) begin transaction
1911
+ -----------------------------------------------------------------------
1912
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
1913
+ -----------------------------------------------------------------------
1914
+  (0.0ms) SAVEPOINT active_record_1
1915
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
1916
+  (0.0ms) SAVEPOINT active_record_1
1917
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "nonesuch"]]
1918
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
1919
+  (0.0ms) rollback transaction
1920
+  (0.0ms) begin transaction
1921
+ -------------------------------------------------------
1922
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
1923
+ -------------------------------------------------------
1924
+  (0.0ms) SAVEPOINT active_record_1
1925
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "six"]]
1926
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", "2016-08-12 15:16:47.828196"], ["updated_at", "2016-08-12 15:16:47.828196"]]
1927
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1928
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
1929
+  (0.4ms) rollback transaction
1930
+  (0.0ms) begin transaction
1931
+ -----------------------------------------------------------
1932
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
1933
+ -----------------------------------------------------------
1934
+  (0.0ms) SAVEPOINT active_record_1
1935
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:16:47.831514"], ["updated_at", "2016-08-12 15:16:47.831514"]]
1936
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1937
+  (0.0ms) SAVEPOINT active_record_1
1938
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
1939
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1940
+ SQL (0.0ms) DELETE FROM "values"
1941
+  (0.0ms) SAVEPOINT active_record_1
1942
+ SQL (0.4ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:16:47.833550"], ["updated_at", "2016-08-12 15:16:47.833550"]]
1943
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1944
+  (0.0ms) SAVEPOINT active_record_1
1945
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
1946
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1947
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
1948
+  (0.6ms) rollback transaction
1949
+  (0.1ms) begin transaction
1950
+ ----------------------------------------------
1951
+ LazyGlobalRecordTest: test_FROZEN_MODEL_filter
1952
+ ----------------------------------------------
1953
+  (0.0ms) SAVEPOINT active_record_1
1954
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:16:47.836965"], ["updated_at", "2016-08-12 15:16:47.836965"]]
1955
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1956
+  (0.0ms) SAVEPOINT active_record_1
1957
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
1958
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1959
+  (0.3ms) rollback transaction
1960
+  (0.0ms) begin transaction
1961
+ ---------------------------------------------------------------------------
1962
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
1963
+ ---------------------------------------------------------------------------
1964
+  (0.0ms) SAVEPOINT active_record_1
1965
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "two"]]
1966
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
1967
+  (0.1ms) rollback transaction
1968
+  (0.1ms) begin transaction
1969
+ ---------------------------------------------------
1970
+ LazyGlobalRecordTest: test_it_returns_id_by_default
1971
+ ---------------------------------------------------
1972
+  (0.1ms) SAVEPOINT active_record_1
1973
+ SQL (0.4ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:16:47.841694"], ["updated_at", "2016-08-12 15:16:47.841694"]]
1974
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1975
+  (0.1ms) SAVEPOINT active_record_1
1976
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
1977
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1978
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
1979
+  (0.6ms) rollback transaction
1980
+  (0.1ms) begin transaction
1981
+ ----------------------------------------
1982
+ LazyGlobalRecordTest: test_custom_filter
1983
+ ----------------------------------------
1984
+  (0.1ms) SAVEPOINT active_record_1
1985
+ SQL (0.4ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", "2016-08-12 15:16:47.849199"], ["updated_at", "2016-08-12 15:16:47.849199"]]
1986
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1987
+  (0.1ms) SAVEPOINT active_record_1
1988
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "seven"]]
1989
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1990
+  (0.4ms) rollback transaction
1991
+  (0.1ms) begin transaction
1992
+ -------------------------------------
1993
+ LazyGlobalRecordTest: test_it_reloads
1994
+ -------------------------------------
1995
+  (0.1ms) SAVEPOINT active_record_1
1996
+ SQL (0.9ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:16:47.855222"], ["updated_at", "2016-08-12 15:16:47.855222"]]
1997
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1998
+  (0.1ms) SAVEPOINT active_record_1
1999
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2000
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2001
+ SQL (0.0ms) DELETE FROM "values"
2002
+  (0.0ms) SAVEPOINT active_record_1
2003
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:16:47.859843"], ["updated_at", "2016-08-12 15:16:47.859843"]]
2004
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2005
+  (0.0ms) SAVEPOINT active_record_1
2006
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2007
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2008
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2009
+  (0.5ms) rollback transaction
2010
+  (0.0ms) begin transaction
2011
+ --------------------------------------------------------------------
2012
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
2013
+ --------------------------------------------------------------------
2014
+  (0.0ms) SAVEPOINT active_record_1
2015
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "three"]]
2016
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", "2016-08-12 15:16:47.863596"], ["updated_at", "2016-08-12 15:16:47.863596"]]
2017
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2018
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2019
+  (0.3ms) rollback transaction
2020
+  (0.0ms) begin transaction
2021
+ ---------------------------------------------------------
2022
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
2023
+ ---------------------------------------------------------
2024
+  (0.0ms) SAVEPOINT active_record_1
2025
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2026
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:16:47.866139"], ["updated_at", "2016-08-12 15:16:47.866139"]]
2027
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2028
+  (0.3ms) rollback transaction
2029
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2030
+  (0.1ms) begin transaction
2031
+ ---------------------------------------------------------
2032
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
2033
+ ---------------------------------------------------------
2034
+  (0.0ms) SAVEPOINT active_record_1
2035
+ Value Load (0.2ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2036
+ SQL (0.4ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:21:22.456201"], ["updated_at", "2016-08-12 15:21:22.456201"]]
2037
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
2038
+  (0.4ms) rollback transaction
2039
+  (0.1ms) begin transaction
2040
+ ---------------------------------------------------------------------------
2041
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
2042
+ ---------------------------------------------------------------------------
2043
+  (0.0ms) SAVEPOINT active_record_1
2044
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "two"]]
2045
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2046
+  (0.0ms) rollback transaction
2047
+  (0.1ms) begin transaction
2048
+ -----------------------------------------------------------
2049
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
2050
+ -----------------------------------------------------------
2051
+  (0.0ms) SAVEPOINT active_record_1
2052
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:21:22.460253"], ["updated_at", "2016-08-12 15:21:22.460253"]]
2053
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2054
+  (0.0ms) SAVEPOINT active_record_1
2055
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2056
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2057
+ SQL (0.1ms) DELETE FROM "values"
2058
+  (0.0ms) SAVEPOINT active_record_1
2059
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:21:22.462465"], ["updated_at", "2016-08-12 15:21:22.462465"]]
2060
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2061
+  (0.0ms) SAVEPOINT active_record_1
2062
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2063
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2064
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2065
+  (0.5ms) rollback transaction
2066
+  (0.1ms) begin transaction
2067
+ ----------------------------------------------
2068
+ LazyGlobalRecordTest: test_FROZEN_MODEL_filter
2069
+ ----------------------------------------------
2070
+  (0.0ms) SAVEPOINT active_record_1
2071
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:21:22.467116"], ["updated_at", "2016-08-12 15:21:22.467116"]]
2072
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2073
+  (0.1ms) SAVEPOINT active_record_1
2074
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2075
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2076
+  (0.4ms) rollback transaction
2077
+  (0.1ms) begin transaction
2078
+ -----------------------------------------------------------------------
2079
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
2080
+ -----------------------------------------------------------------------
2081
+  (0.0ms) SAVEPOINT active_record_1
2082
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2083
+  (0.1ms) SAVEPOINT active_record_1
2084
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "nonesuch"]]
2085
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2086
+  (0.1ms) rollback transaction
2087
+  (0.1ms) begin transaction
2088
+ -------------------------------------------------------
2089
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
2090
+ -------------------------------------------------------
2091
+  (0.0ms) SAVEPOINT active_record_1
2092
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "six"]]
2093
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", "2016-08-12 15:21:22.473190"], ["updated_at", "2016-08-12 15:21:22.473190"]]
2094
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2095
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2096
+  (0.4ms) rollback transaction
2097
+  (0.1ms) begin transaction
2098
+ -------------------------------------------------------------------
2099
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
2100
+ -------------------------------------------------------------------
2101
+  (0.1ms) SAVEPOINT active_record_1
2102
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "four"]]
2103
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", "2016-08-12 15:21:22.476193"], ["updated_at", "2016-08-12 15:21:22.476193"]]
2104
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2105
+  (0.4ms) rollback transaction
2106
+  (0.0ms) begin transaction
2107
+ ---------------------------------------------------
2108
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2109
+ ---------------------------------------------------
2110
+  (0.0ms) SAVEPOINT active_record_1
2111
+ SQL (0.4ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:21:22.478438"], ["updated_at", "2016-08-12 15:21:22.478438"]]
2112
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2113
+  (0.1ms) SAVEPOINT active_record_1
2114
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2115
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2116
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2117
+  (0.4ms) rollback transaction
2118
+  (0.1ms) begin transaction
2119
+ ----------------------------------------
2120
+ LazyGlobalRecordTest: test_custom_filter
2121
+ ----------------------------------------
2122
+  (0.0ms) SAVEPOINT active_record_1
2123
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", "2016-08-12 15:21:22.483524"], ["updated_at", "2016-08-12 15:21:22.483524"]]
2124
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2125
+  (0.0ms) SAVEPOINT active_record_1
2126
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "seven"]]
2127
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2128
+  (0.3ms) rollback transaction
2129
+  (0.1ms) begin transaction
2130
+ --------------------------------------------------------------------
2131
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
2132
+ --------------------------------------------------------------------
2133
+  (0.0ms) SAVEPOINT active_record_1
2134
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "three"]]
2135
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", "2016-08-12 15:21:22.486818"], ["updated_at", "2016-08-12 15:21:22.486818"]]
2136
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2137
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2138
+  (0.4ms) rollback transaction
2139
+  (0.1ms) begin transaction
2140
+ -------------------------------------
2141
+ LazyGlobalRecordTest: test_it_reloads
2142
+ -------------------------------------
2143
+  (0.0ms) SAVEPOINT active_record_1
2144
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:21:22.489016"], ["updated_at", "2016-08-12 15:21:22.489016"]]
2145
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2146
+  (0.1ms) SAVEPOINT active_record_1
2147
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2148
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2149
+ SQL (0.1ms) DELETE FROM "values"
2150
+  (0.0ms) SAVEPOINT active_record_1
2151
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:21:22.491070"], ["updated_at", "2016-08-12 15:21:22.491070"]]
2152
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2153
+  (0.0ms) SAVEPOINT active_record_1
2154
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2155
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2156
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2157
+  (0.6ms) rollback transaction
2158
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2159
+  (0.1ms) begin transaction
2160
+ ---------------------------------------------------
2161
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2162
+ ---------------------------------------------------
2163
+  (0.1ms) SAVEPOINT active_record_1
2164
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:21:37.547513"], ["updated_at", "2016-08-12 15:21:37.547513"]]
2165
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2166
+  (0.0ms) SAVEPOINT active_record_1
2167
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2168
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2169
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2170
+  (0.6ms) rollback transaction
2171
+  (0.1ms) begin transaction
2172
+ -----------------------------------------------------------
2173
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
2174
+ -----------------------------------------------------------
2175
+  (0.0ms) SAVEPOINT active_record_1
2176
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:21:37.556178"], ["updated_at", "2016-08-12 15:21:37.556178"]]
2177
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2178
+  (0.0ms) SAVEPOINT active_record_1
2179
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2180
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2181
+ SQL (0.1ms) DELETE FROM "values"
2182
+  (0.0ms) SAVEPOINT active_record_1
2183
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:21:37.558547"], ["updated_at", "2016-08-12 15:21:37.558547"]]
2184
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2185
+  (0.0ms) SAVEPOINT active_record_1
2186
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2187
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2188
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2189
+  (0.4ms) rollback transaction
2190
+  (0.1ms) begin transaction
2191
+ --------------------------------------------------------------------
2192
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
2193
+ --------------------------------------------------------------------
2194
+  (0.0ms) SAVEPOINT active_record_1
2195
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "three"]]
2196
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", "2016-08-12 15:21:37.563587"], ["updated_at", "2016-08-12 15:21:37.563587"]]
2197
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2198
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2199
+  (0.4ms) rollback transaction
2200
+  (0.1ms) begin transaction
2201
+ ----------------------------------------------
2202
+ LazyGlobalRecordTest: test_FROZEN_MODEL_filter
2203
+ ----------------------------------------------
2204
+  (0.1ms) SAVEPOINT active_record_1
2205
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:21:37.566356"], ["updated_at", "2016-08-12 15:21:37.566356"]]
2206
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2207
+  (0.0ms) SAVEPOINT active_record_1
2208
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2209
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2210
+  (0.4ms) rollback transaction
2211
+  (0.0ms) begin transaction
2212
+ -----------------------------------------------------------------------
2213
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
2214
+ -----------------------------------------------------------------------
2215
+  (0.0ms) SAVEPOINT active_record_1
2216
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
2217
+  (0.0ms) SAVEPOINT active_record_1
2218
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "nonesuch"]]
2219
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2220
+  (0.0ms) rollback transaction
2221
+  (0.1ms) begin transaction
2222
+ -------------------------------------
2223
+ LazyGlobalRecordTest: test_it_reloads
2224
+ -------------------------------------
2225
+  (0.0ms) SAVEPOINT active_record_1
2226
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:21:37.571610"], ["updated_at", "2016-08-12 15:21:37.571610"]]
2227
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2228
+  (0.0ms) SAVEPOINT active_record_1
2229
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2230
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2231
+ SQL (0.1ms) DELETE FROM "values"
2232
+  (0.0ms) SAVEPOINT active_record_1
2233
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:21:37.574691"], ["updated_at", "2016-08-12 15:21:37.574691"]]
2234
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2235
+  (0.0ms) SAVEPOINT active_record_1
2236
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2237
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2238
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2239
+  (1.2ms) rollback transaction
2240
+  (0.1ms) begin transaction
2241
+ ---------------------------------------------------------
2242
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
2243
+ ---------------------------------------------------------
2244
+  (0.0ms) SAVEPOINT active_record_1
2245
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2246
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:21:37.580304"], ["updated_at", "2016-08-12 15:21:37.580304"]]
2247
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
2248
+  (0.4ms) rollback transaction
2249
+  (0.1ms) begin transaction
2250
+ ---------------------------------------------------------------------------
2251
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
2252
+ ---------------------------------------------------------------------------
2253
+  (0.0ms) SAVEPOINT active_record_1
2254
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "two"]]
2255
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2256
+  (0.0ms) rollback transaction
2257
+  (0.1ms) begin transaction
2258
+ -------------------------------------------------------
2259
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
2260
+ -------------------------------------------------------
2261
+  (0.0ms) SAVEPOINT active_record_1
2262
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "six"]]
2263
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", "2016-08-12 15:21:37.584155"], ["updated_at", "2016-08-12 15:21:37.584155"]]
2264
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2265
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2266
+  (0.4ms) rollback transaction
2267
+  (0.1ms) begin transaction
2268
+ ----------------------------------------
2269
+ LazyGlobalRecordTest: test_custom_filter
2270
+ ----------------------------------------
2271
+  (0.0ms) SAVEPOINT active_record_1
2272
+ SQL (0.5ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", "2016-08-12 15:21:37.586763"], ["updated_at", "2016-08-12 15:21:37.586763"]]
2273
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2274
+  (0.0ms) SAVEPOINT active_record_1
2275
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "seven"]]
2276
+  (0.2ms) RELEASE SAVEPOINT active_record_1
2277
+  (0.7ms) rollback transaction
2278
+  (0.2ms) begin transaction
2279
+ -------------------------------------------------------------------
2280
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
2281
+ -------------------------------------------------------------------
2282
+  (0.1ms) SAVEPOINT active_record_1
2283
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "four"]]
2284
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", "2016-08-12 15:21:37.594277"], ["updated_at", "2016-08-12 15:21:37.594277"]]
2285
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2286
+  (0.3ms) rollback transaction
2287
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2288
+  (0.1ms) begin transaction
2289
+ ----------------------------------------
2290
+ LazyGlobalRecordTest: test_custom_filter
2291
+ ----------------------------------------
2292
+  (0.0ms) SAVEPOINT active_record_1
2293
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", "2016-08-12 15:22:04.820592"], ["updated_at", "2016-08-12 15:22:04.820592"]]
2294
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2295
+  (0.0ms) SAVEPOINT active_record_1
2296
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "seven"]]
2297
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2298
+  (1.3ms) rollback transaction
2299
+  (0.1ms) begin transaction
2300
+ --------------------------------------------------------------------
2301
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
2302
+ --------------------------------------------------------------------
2303
+  (0.0ms) SAVEPOINT active_record_1
2304
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "three"]]
2305
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", "2016-08-12 15:22:04.830600"], ["updated_at", "2016-08-12 15:22:04.830600"]]
2306
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2307
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2308
+  (0.4ms) rollback transaction
2309
+  (0.1ms) begin transaction
2310
+ ---------------------------------------------------------
2311
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
2312
+ ---------------------------------------------------------
2313
+  (0.1ms) SAVEPOINT active_record_1
2314
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2315
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:22:04.835486"], ["updated_at", "2016-08-12 15:22:04.835486"]]
2316
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
2317
+  (0.3ms) rollback transaction
2318
+  (0.1ms) begin transaction
2319
+ -------------------------------------------------------
2320
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
2321
+ -------------------------------------------------------
2322
+  (0.0ms) SAVEPOINT active_record_1
2323
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "six"]]
2324
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", "2016-08-12 15:22:04.838690"], ["updated_at", "2016-08-12 15:22:04.838690"]]
2325
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2326
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2327
+  (0.4ms) rollback transaction
2328
+  (0.1ms) begin transaction
2329
+ -----------------------------------------------------------------------
2330
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
2331
+ -----------------------------------------------------------------------
2332
+  (0.0ms) SAVEPOINT active_record_1
2333
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2334
+  (0.0ms) SAVEPOINT active_record_1
2335
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "nonesuch"]]
2336
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2337
+  (0.0ms) rollback transaction
2338
+  (0.0ms) begin transaction
2339
+ -----------------------------------------------------------
2340
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
2341
+ -----------------------------------------------------------
2342
+  (0.0ms) SAVEPOINT active_record_1
2343
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:22:04.842924"], ["updated_at", "2016-08-12 15:22:04.842924"]]
2344
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2345
+  (0.0ms) SAVEPOINT active_record_1
2346
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2347
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2348
+ SQL (0.1ms) DELETE FROM "values"
2349
+  (0.0ms) SAVEPOINT active_record_1
2350
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:22:04.845467"], ["updated_at", "2016-08-12 15:22:04.845467"]]
2351
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2352
+  (0.0ms) SAVEPOINT active_record_1
2353
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2354
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2355
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2356
+  (0.5ms) rollback transaction
2357
+  (0.1ms) begin transaction
2358
+ ---------------------------------------------------
2359
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2360
+ ---------------------------------------------------
2361
+  (0.0ms) SAVEPOINT active_record_1
2362
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:22:04.848908"], ["updated_at", "2016-08-12 15:22:04.848908"]]
2363
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2364
+  (0.0ms) SAVEPOINT active_record_1
2365
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2366
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2367
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2368
+  (0.4ms) rollback transaction
2369
+  (0.1ms) begin transaction
2370
+ -------------------------------------
2371
+ LazyGlobalRecordTest: test_it_reloads
2372
+ -------------------------------------
2373
+  (0.0ms) SAVEPOINT active_record_1
2374
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:22:04.854177"], ["updated_at", "2016-08-12 15:22:04.854177"]]
2375
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2376
+  (0.0ms) SAVEPOINT active_record_1
2377
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2378
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2379
+ SQL (0.1ms) DELETE FROM "values"
2380
+  (0.0ms) SAVEPOINT active_record_1
2381
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:22:04.856280"], ["updated_at", "2016-08-12 15:22:04.856280"]]
2382
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2383
+  (0.1ms) SAVEPOINT active_record_1
2384
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2385
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2386
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2387
+  (0.5ms) rollback transaction
2388
+  (0.1ms) begin transaction
2389
+ -------------------------------------------------------------------
2390
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
2391
+ -------------------------------------------------------------------
2392
+  (0.0ms) SAVEPOINT active_record_1
2393
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "four"]]
2394
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", "2016-08-12 15:22:04.860763"], ["updated_at", "2016-08-12 15:22:04.860763"]]
2395
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2396
+  (0.4ms) rollback transaction
2397
+  (0.1ms) begin transaction
2398
+ ---------------------------------------------------------------------------
2399
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
2400
+ ---------------------------------------------------------------------------
2401
+  (0.0ms) SAVEPOINT active_record_1
2402
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "two"]]
2403
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2404
+  (0.1ms) rollback transaction
2405
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2406
+  (0.1ms) begin transaction
2407
+ -----------------------------------------------------------------------
2408
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
2409
+ -----------------------------------------------------------------------
2410
+  (0.0ms) SAVEPOINT active_record_1
2411
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2412
+  (0.1ms) SAVEPOINT active_record_1
2413
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "nonesuch"]]
2414
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
2415
+  (0.1ms) rollback transaction
2416
+  (0.1ms) begin transaction
2417
+ -------------------------------------
2418
+ LazyGlobalRecordTest: test_it_reloads
2419
+ -------------------------------------
2420
+  (0.0ms) SAVEPOINT active_record_1
2421
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:23:19.402178"], ["updated_at", "2016-08-12 15:23:19.402178"]]
2422
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2423
+  (0.0ms) SAVEPOINT active_record_1
2424
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2425
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2426
+ SQL (0.1ms) DELETE FROM "values"
2427
+  (0.0ms) SAVEPOINT active_record_1
2428
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:23:19.404730"], ["updated_at", "2016-08-12 15:23:19.404730"]]
2429
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2430
+  (0.0ms) SAVEPOINT active_record_1
2431
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2432
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2433
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2434
+  (1.4ms) rollback transaction
2435
+  (0.1ms) begin transaction
2436
+ ---------------------------------------------------------
2437
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
2438
+ ---------------------------------------------------------
2439
+  (0.0ms) SAVEPOINT active_record_1
2440
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2441
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:23:19.410652"], ["updated_at", "2016-08-12 15:23:19.410652"]]
2442
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
2443
+  (0.3ms) rollback transaction
2444
+  (0.1ms) begin transaction
2445
+ ----------------------------------------------
2446
+ LazyGlobalRecordTest: test_FROZEN_MODEL_filter
2447
+ ----------------------------------------------
2448
+  (0.0ms) SAVEPOINT active_record_1
2449
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:23:19.412687"], ["updated_at", "2016-08-12 15:23:19.412687"]]
2450
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2451
+  (0.0ms) SAVEPOINT active_record_1
2452
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2453
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2454
+  (0.4ms) rollback transaction
2455
+  (0.1ms) begin transaction
2456
+ --------------------------------------------------------------------
2457
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
2458
+ --------------------------------------------------------------------
2459
+  (0.0ms) SAVEPOINT active_record_1
2460
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "three"]]
2461
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", "2016-08-12 15:23:19.416596"], ["updated_at", "2016-08-12 15:23:19.416596"]]
2462
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2463
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2464
+  (0.3ms) rollback transaction
2465
+  (0.1ms) begin transaction
2466
+ ---------------------------------------------------------------------------
2467
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
2468
+ ---------------------------------------------------------------------------
2469
+  (0.0ms) SAVEPOINT active_record_1
2470
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "two"]]
2471
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2472
+  (0.0ms) rollback transaction
2473
+  (0.1ms) begin transaction
2474
+ -------------------------------------------------------------------
2475
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
2476
+ -------------------------------------------------------------------
2477
+  (0.0ms) SAVEPOINT active_record_1
2478
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "four"]]
2479
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", "2016-08-12 15:23:19.420534"], ["updated_at", "2016-08-12 15:23:19.420534"]]
2480
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2481
+  (0.3ms) rollback transaction
2482
+  (0.1ms) begin transaction
2483
+ ----------------------------------------
2484
+ LazyGlobalRecordTest: test_custom_filter
2485
+ ----------------------------------------
2486
+  (0.0ms) SAVEPOINT active_record_1
2487
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", "2016-08-12 15:23:19.422566"], ["updated_at", "2016-08-12 15:23:19.422566"]]
2488
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2489
+  (0.0ms) SAVEPOINT active_record_1
2490
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "seven"]]
2491
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2492
+  (0.4ms) rollback transaction
2493
+  (0.0ms) begin transaction
2494
+ ---------------------------------------------------
2495
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2496
+ ---------------------------------------------------
2497
+  (0.2ms) SAVEPOINT active_record_1
2498
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:23:19.425992"], ["updated_at", "2016-08-12 15:23:19.425992"]]
2499
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2500
+  (0.0ms) SAVEPOINT active_record_1
2501
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2502
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2503
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2504
+  (0.5ms) rollback transaction
2505
+  (0.2ms) begin transaction
2506
+ -----------------------------------------------------------
2507
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
2508
+ -----------------------------------------------------------
2509
+  (0.1ms) SAVEPOINT active_record_1
2510
+ SQL (0.4ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:23:19.431725"], ["updated_at", "2016-08-12 15:23:19.431725"]]
2511
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2512
+  (0.1ms) SAVEPOINT active_record_1
2513
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2514
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2515
+ SQL (0.2ms) DELETE FROM "values"
2516
+  (0.1ms) SAVEPOINT active_record_1
2517
+ SQL (0.4ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:23:19.436981"], ["updated_at", "2016-08-12 15:23:19.436981"]]
2518
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2519
+  (0.0ms) SAVEPOINT active_record_1
2520
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2521
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2522
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2523
+  (0.6ms) rollback transaction
2524
+  (0.1ms) begin transaction
2525
+ -------------------------------------------------------
2526
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
2527
+ -------------------------------------------------------
2528
+  (0.0ms) SAVEPOINT active_record_1
2529
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "six"]]
2530
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", "2016-08-12 15:23:19.441187"], ["updated_at", "2016-08-12 15:23:19.441187"]]
2531
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2532
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2533
+  (0.4ms) rollback transaction
2534
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2535
+  (0.1ms) begin transaction
2536
+ ---------------------------------------------------
2537
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2538
+ ---------------------------------------------------
2539
+  (0.1ms) SAVEPOINT active_record_1
2540
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:23:41.666618"], ["updated_at", "2016-08-12 15:23:41.666618"]]
2541
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2542
+  (0.0ms) SAVEPOINT active_record_1
2543
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2544
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2545
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2546
+  (1.3ms) rollback transaction
2547
+  (0.1ms) begin transaction
2548
+ ----------------------------------------------
2549
+ LazyGlobalRecordTest: test_FROZEN_MODEL_filter
2550
+ ----------------------------------------------
2551
+  (0.0ms) SAVEPOINT active_record_1
2552
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:23:41.675427"], ["updated_at", "2016-08-12 15:23:41.675427"]]
2553
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2554
+  (0.0ms) SAVEPOINT active_record_1
2555
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2556
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2557
+  (0.4ms) rollback transaction
2558
+  (0.1ms) begin transaction
2559
+ -------------------------------------------------------
2560
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
2561
+ -------------------------------------------------------
2562
+  (0.0ms) SAVEPOINT active_record_1
2563
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "six"]]
2564
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", "2016-08-12 15:23:41.678817"], ["updated_at", "2016-08-12 15:23:41.678817"]]
2565
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2566
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2567
+  (0.4ms) rollback transaction
2568
+  (0.0ms) begin transaction
2569
+ ---------------------------------------------------------
2570
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
2571
+ ---------------------------------------------------------
2572
+  (0.0ms) SAVEPOINT active_record_1
2573
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2574
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:23:41.683321"], ["updated_at", "2016-08-12 15:23:41.683321"]]
2575
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
2576
+  (0.4ms) rollback transaction
2577
+  (0.1ms) begin transaction
2578
+ -----------------------------------------------------------
2579
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
2580
+ -----------------------------------------------------------
2581
+  (0.1ms) SAVEPOINT active_record_1
2582
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:23:41.685462"], ["updated_at", "2016-08-12 15:23:41.685462"]]
2583
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2584
+  (0.0ms) SAVEPOINT active_record_1
2585
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2586
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2587
+ SQL (0.1ms) DELETE FROM "values"
2588
+  (0.0ms) SAVEPOINT active_record_1
2589
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:23:41.687561"], ["updated_at", "2016-08-12 15:23:41.687561"]]
2590
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2591
+  (0.0ms) SAVEPOINT active_record_1
2592
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2593
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2594
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2595
+  (0.5ms) rollback transaction
2596
+  (0.1ms) begin transaction
2597
+ -------------------------------------------------------------------
2598
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
2599
+ -------------------------------------------------------------------
2600
+  (0.0ms) SAVEPOINT active_record_1
2601
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "four"]]
2602
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", "2016-08-12 15:23:41.691136"], ["updated_at", "2016-08-12 15:23:41.691136"]]
2603
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2604
+  (0.3ms) rollback transaction
2605
+  (0.1ms) begin transaction
2606
+ ----------------------------------------
2607
+ LazyGlobalRecordTest: test_custom_filter
2608
+ ----------------------------------------
2609
+  (0.1ms) SAVEPOINT active_record_1
2610
+ SQL (0.5ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", "2016-08-12 15:23:41.694204"], ["updated_at", "2016-08-12 15:23:41.694204"]]
2611
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2612
+  (0.0ms) SAVEPOINT active_record_1
2613
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "seven"]]
2614
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2615
+  (0.4ms) rollback transaction
2616
+  (0.1ms) begin transaction
2617
+ -------------------------------------
2618
+ LazyGlobalRecordTest: test_it_reloads
2619
+ -------------------------------------
2620
+  (0.0ms) SAVEPOINT active_record_1
2621
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:23:41.699508"], ["updated_at", "2016-08-12 15:23:41.699508"]]
2622
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2623
+  (0.0ms) SAVEPOINT active_record_1
2624
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2625
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2626
+ SQL (0.1ms) DELETE FROM "values"
2627
+  (0.0ms) SAVEPOINT active_record_1
2628
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:23:41.701541"], ["updated_at", "2016-08-12 15:23:41.701541"]]
2629
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2630
+  (0.0ms) SAVEPOINT active_record_1
2631
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2632
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2633
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2634
+  (0.6ms) rollback transaction
2635
+  (0.1ms) begin transaction
2636
+ -----------------------------------------------------------------------
2637
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
2638
+ -----------------------------------------------------------------------
2639
+  (0.0ms) SAVEPOINT active_record_1
2640
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2641
+  (0.1ms) SAVEPOINT active_record_1
2642
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "nonesuch"]]
2643
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2644
+  (0.0ms) rollback transaction
2645
+  (0.0ms) begin transaction
2646
+ ---------------------------------------------------------------------------
2647
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
2648
+ ---------------------------------------------------------------------------
2649
+  (0.0ms) SAVEPOINT active_record_1
2650
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "two"]]
2651
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2652
+  (0.0ms) rollback transaction
2653
+  (0.0ms) begin transaction
2654
+ --------------------------------------------------------------------
2655
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
2656
+ --------------------------------------------------------------------
2657
+  (0.0ms) SAVEPOINT active_record_1
2658
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "three"]]
2659
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", "2016-08-12 15:23:41.708167"], ["updated_at", "2016-08-12 15:23:41.708167"]]
2660
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2661
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2662
+  (0.4ms) rollback transaction
2663
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2664
+  (0.1ms) begin transaction
2665
+ ---------------------------------------------------
2666
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2667
+ ---------------------------------------------------
2668
+  (0.1ms) SAVEPOINT active_record_1
2669
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:24:48.814539"], ["updated_at", "2016-08-12 15:24:48.814539"]]
2670
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2671
+  (0.0ms) SAVEPOINT active_record_1
2672
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2673
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2674
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2675
+  (1.3ms) rollback transaction
2676
+  (0.1ms) begin transaction
2677
+ ---------------------------------------------------------------------------
2678
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
2679
+ ---------------------------------------------------------------------------
2680
+  (0.0ms) SAVEPOINT active_record_1
2681
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "two"]]
2682
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2683
+  (0.0ms) rollback transaction
2684
+  (0.1ms) begin transaction
2685
+ -------------------------------------------------------
2686
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
2687
+ -------------------------------------------------------
2688
+  (0.0ms) SAVEPOINT active_record_1
2689
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "six"]]
2690
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", "2016-08-12 15:24:48.825071"], ["updated_at", "2016-08-12 15:24:48.825071"]]
2691
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2692
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2693
+  (0.5ms) rollback transaction
2694
+  (0.1ms) begin transaction
2695
+ ---------------------------------------------------------
2696
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
2697
+ ---------------------------------------------------------
2698
+  (0.1ms) SAVEPOINT active_record_1
2699
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2700
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:24:48.829570"], ["updated_at", "2016-08-12 15:24:48.829570"]]
2701
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2702
+  (0.3ms) rollback transaction
2703
+  (0.1ms) begin transaction
2704
+ --------------------------------------------------------------------
2705
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
2706
+ --------------------------------------------------------------------
2707
+  (0.0ms) SAVEPOINT active_record_1
2708
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "three"]]
2709
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", "2016-08-12 15:24:48.832149"], ["updated_at", "2016-08-12 15:24:48.832149"]]
2710
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2711
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 1]]
2712
+  (0.3ms) rollback transaction
2713
+  (0.1ms) begin transaction
2714
+ -------------------------------------------------------------------
2715
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
2716
+ -------------------------------------------------------------------
2717
+  (0.1ms) SAVEPOINT active_record_1
2718
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "four"]]
2719
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", "2016-08-12 15:24:48.835006"], ["updated_at", "2016-08-12 15:24:48.835006"]]
2720
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2721
+  (0.4ms) rollback transaction
2722
+  (0.1ms) begin transaction
2723
+ -----------------------------------------------------------------------
2724
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
2725
+ -----------------------------------------------------------------------
2726
+  (0.0ms) SAVEPOINT active_record_1
2727
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2728
+  (0.1ms) SAVEPOINT active_record_1
2729
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "nonesuch"]]
2730
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
2731
+  (0.1ms) rollback transaction
2732
+  (0.1ms) begin transaction
2733
+ -----------------------------------------------------------
2734
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
2735
+ -----------------------------------------------------------
2736
+  (0.0ms) SAVEPOINT active_record_1
2737
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:24:48.838906"], ["updated_at", "2016-08-12 15:24:48.838906"]]
2738
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2739
+  (0.0ms) SAVEPOINT active_record_1
2740
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2741
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2742
+ SQL (0.1ms) DELETE FROM "values"
2743
+  (0.0ms) SAVEPOINT active_record_1
2744
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:24:48.841442"], ["updated_at", "2016-08-12 15:24:48.841442"]]
2745
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2746
+  (0.0ms) SAVEPOINT active_record_1
2747
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2748
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2749
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2750
+  (0.5ms) rollback transaction
2751
+  (0.0ms) begin transaction
2752
+ ----------------------------------------------
2753
+ LazyGlobalRecordTest: test_FROZEN_MODEL_filter
2754
+ ----------------------------------------------
2755
+  (0.0ms) SAVEPOINT active_record_1
2756
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:24:48.844941"], ["updated_at", "2016-08-12 15:24:48.844941"]]
2757
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2758
+  (0.0ms) SAVEPOINT active_record_1
2759
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2760
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2761
+  (0.4ms) rollback transaction
2762
+  (0.1ms) begin transaction
2763
+ -------------------------------------
2764
+ LazyGlobalRecordTest: test_it_reloads
2765
+ -------------------------------------
2766
+  (0.0ms) SAVEPOINT active_record_1
2767
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", "2016-08-12 15:24:48.849054"], ["updated_at", "2016-08-12 15:24:48.849054"]]
2768
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2769
+  (0.0ms) SAVEPOINT active_record_1
2770
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2771
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2772
+ SQL (0.1ms) DELETE FROM "values"
2773
+  (0.1ms) SAVEPOINT active_record_1
2774
+ SQL (0.4ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", "2016-08-12 15:24:48.851975"], ["updated_at", "2016-08-12 15:24:48.851975"]]
2775
+  (0.4ms) RELEASE SAVEPOINT active_record_1
2776
+  (0.1ms) SAVEPOINT active_record_1
2777
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "five"]]
2778
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2779
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT 1 [["id", 2]]
2780
+  (0.7ms) rollback transaction
2781
+  (0.1ms) begin transaction
2782
+ ----------------------------------------
2783
+ LazyGlobalRecordTest: test_custom_filter
2784
+ ----------------------------------------
2785
+  (0.1ms) SAVEPOINT active_record_1
2786
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", "2016-08-12 15:24:48.859037"], ["updated_at", "2016-08-12 15:24:48.859037"]]
2787
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2788
+  (0.0ms) SAVEPOINT active_record_1
2789
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "seven"]]
2790
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2791
+  (0.4ms) rollback transaction
2792
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2793
+  (0.1ms) begin transaction
2794
+ ---------------------------------------------------
2795
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2796
+ ---------------------------------------------------
2797
+  (0.1ms) SAVEPOINT active_record_1
2798
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:25:17.581908"], ["updated_at", "2016-08-12 15:25:17.581908"]]
2799
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2800
+  (0.0ms) SAVEPOINT active_record_1
2801
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2802
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2803
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2804
+  (1.2ms) rollback transaction
2805
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2806
+  (0.1ms) begin transaction
2807
+ ---------------------------------------------------
2808
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2809
+ ---------------------------------------------------
2810
+  (0.1ms) SAVEPOINT active_record_1
2811
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:26:18.692520"], ["updated_at", "2016-08-12 15:26:18.692520"]]
2812
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2813
+ Value Load (0.2ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2814
+  (1.4ms) rollback transaction
2815
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2816
+  (0.1ms) begin transaction
2817
+ ---------------------------------------------------
2818
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2819
+ ---------------------------------------------------
2820
+  (0.0ms) rollback transaction
2821
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2822
+  (0.1ms) begin transaction
2823
+ ---------------------------------------------------
2824
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2825
+ ---------------------------------------------------
2826
+  (0.1ms) SAVEPOINT active_record_1
2827
+ SQL (0.4ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:27:04.923353"], ["updated_at", "2016-08-12 15:27:04.923353"]]
2828
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2829
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2830
+  (1.3ms) rollback transaction
2831
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2832
+  (0.1ms) begin transaction
2833
+ ---------------------------------------------------
2834
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2835
+ ---------------------------------------------------
2836
+  (0.1ms) SAVEPOINT active_record_1
2837
+ SQL (0.5ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:27:37.743347"], ["updated_at", "2016-08-12 15:27:37.743347"]]
2838
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2839
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2840
+  (1.4ms) rollback transaction
2841
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2842
+  (0.1ms) begin transaction
2843
+ ---------------------------------------------------
2844
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2845
+ ---------------------------------------------------
2846
+  (0.1ms) SAVEPOINT active_record_1
2847
+ SQL (0.4ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:27:43.688388"], ["updated_at", "2016-08-12 15:27:43.688388"]]
2848
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2849
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2850
+  (1.4ms) rollback transaction
2851
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2852
+  (0.1ms) begin transaction
2853
+ ---------------------------------------------------
2854
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2855
+ ---------------------------------------------------
2856
+  (0.1ms) SAVEPOINT active_record_1
2857
+ SQL (0.4ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:27:51.789620"], ["updated_at", "2016-08-12 15:27:51.789620"]]
2858
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2859
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2860
+  (1.4ms) rollback transaction
2861
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2862
+  (0.1ms) begin transaction
2863
+ ---------------------------------------------------
2864
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2865
+ ---------------------------------------------------
2866
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT 1 [["value", "one"]]
2867
+  (0.0ms) rollback transaction
2868
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2869
+  (0.1ms) begin transaction
2870
+ ---------------------------------------------------
2871
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2872
+ ---------------------------------------------------
2873
+  (0.1ms) SAVEPOINT active_record_1
2874
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:28:46.559295"], ["updated_at", "2016-08-12 15:28:46.559295"]]
2875
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2876
+  (1.3ms) rollback transaction
2877
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2878
+  (0.1ms) begin transaction
2879
+ ---------------------------------------------------
2880
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2881
+ ---------------------------------------------------
2882
+  (0.1ms) SAVEPOINT active_record_1
2883
+ SQL (0.4ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", "2016-08-12 15:29:15.173284"], ["updated_at", "2016-08-12 15:29:15.173284"]]
2884
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2885
+  (1.2ms) rollback transaction
2886
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2887
+  (0.1ms) begin transaction
2888
+ ---------------------------------------------------
2889
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2890
+ ---------------------------------------------------
2891
+  (0.1ms) rollback transaction
2892
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2893
+  (0.1ms) begin transaction
2894
+ ---------------------------------------------------
2895
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2896
+ ---------------------------------------------------
2897
+  (0.0ms) rollback transaction
2898
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2899
+  (0.1ms) begin transaction
2900
+ ---------------------------------------------------
2901
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2902
+ ---------------------------------------------------
2903
+  (0.1ms) rollback transaction
2904
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2905
+  (0.1ms) begin transaction
2906
+ ---------------------------------------------------
2907
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2908
+ ---------------------------------------------------
2909
+  (0.0ms) rollback transaction
2910
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2911
+  (0.1ms) begin transaction
2912
+ ---------------------------------------------------
2913
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2914
+ ---------------------------------------------------
2915
+  (0.0ms) rollback transaction
2916
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2917
+  (0.1ms) begin transaction
2918
+ ---------------------------------------------------
2919
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2920
+ ---------------------------------------------------
2921
+  (0.1ms) rollback transaction
2922
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2923
+  (0.1ms) begin transaction
2924
+ ---------------------------------------------------
2925
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2926
+ ---------------------------------------------------
2927
+  (0.1ms) rollback transaction
2928
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2929
+  (0.1ms) begin transaction
2930
+ ---------------------------------------------------
2931
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2932
+ ---------------------------------------------------
2933
+  (0.0ms) rollback transaction
2934
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2935
+  (0.1ms) begin transaction
2936
+ ---------------------------------------------------
2937
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2938
+ ---------------------------------------------------
2939
+  (0.1ms) rollback transaction
2940
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2941
+  (0.1ms) begin transaction
2942
+ ---------------------------------------------------
2943
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2944
+ ---------------------------------------------------
2945
+  (0.1ms) rollback transaction
2946
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2947
+  (0.1ms) begin transaction
2948
+ ---------------------------------------------------
2949
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2950
+ ---------------------------------------------------
2951
+  (0.1ms) rollback transaction
2952
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2953
+  (0.1ms) begin transaction
2954
+ ---------------------------------------------------
2955
+ LazyGlobalRecordTest: test_it_returns_id_by_default
2956
+ ---------------------------------------------------
2957
+  (0.1ms) rollback transaction
2958
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2959
+  (0.1ms) begin transaction
2960
+ --------------------------------------------------------------------
2961
+ LazyGlobalRecordTest: test_it_creates_a_record_when_creation_allowed
2962
+ --------------------------------------------------------------------
2963
+  (0.1ms) SAVEPOINT active_record_1
2964
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "three"], ["LIMIT", 1]]
2965
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "three"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
2966
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2967
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
2968
+  (0.4ms) rollback transaction
2969
+  (0.0ms) begin transaction
2970
+ ---------------------------------------------------------------------------
2971
+ LazyGlobalRecordTest: test_it_raises_on_no_record_when_creation_not_allowed
2972
+ ---------------------------------------------------------------------------
2973
+  (0.0ms) SAVEPOINT active_record_1
2974
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "two"], ["LIMIT", 1]]
2975
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
2976
+  (0.0ms) rollback transaction
2977
+  (0.1ms) begin transaction
2978
+ ----------------------------------------
2979
+ LazyGlobalRecordTest: test_custom_filter
2980
+ ----------------------------------------
2981
+  (0.0ms) SAVEPOINT active_record_1
2982
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "seven"], ["other_value", "treasure"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
2983
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2984
+  (0.0ms) SAVEPOINT active_record_1
2985
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "seven"], ["LIMIT", 1]]
2986
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2987
+  (0.3ms) rollback transaction
2988
+  (0.1ms) begin transaction
2989
+ ----------------------------------------------
2990
+ LazyGlobalRecordTest: test_FROZEN_MODEL_filter
2991
+ ----------------------------------------------
2992
+  (0.0ms) SAVEPOINT active_record_1
2993
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
2994
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2995
+  (0.0ms) SAVEPOINT active_record_1
2996
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "one"], ["LIMIT", 1]]
2997
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2998
+  (0.4ms) rollback transaction
2999
+  (0.1ms) begin transaction
3000
+ ---------------------------------------------------
3001
+ LazyGlobalRecordTest: test_it_returns_id_by_default
3002
+ ---------------------------------------------------
3003
+  (0.1ms) SAVEPOINT active_record_1
3004
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
3005
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3006
+  (0.0ms) SAVEPOINT active_record_1
3007
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "one"], ["LIMIT", 1]]
3008
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3009
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "one"], ["LIMIT", 1]]
3010
+  (0.4ms) rollback transaction
3011
+  (0.1ms) begin transaction
3012
+ -----------------------------------------------------------------------
3013
+ LazyGlobalRecordTest: test_raises_an_exception_if_exceptions_are_raised
3014
+ -----------------------------------------------------------------------
3015
+  (0.0ms) SAVEPOINT active_record_1
3016
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
3017
+  (0.1ms) SAVEPOINT active_record_1
3018
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "nonesuch"], ["LIMIT", 1]]
3019
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
3020
+  (0.1ms) rollback transaction
3021
+  (0.1ms) begin transaction
3022
+ -------------------------------------------------------------------
3023
+ LazyGlobalRecordTest: test_it_does_not_allow_reset_when_not_allowed
3024
+ -------------------------------------------------------------------
3025
+  (0.0ms) SAVEPOINT active_record_1
3026
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "four"], ["LIMIT", 1]]
3027
+ SQL (0.2ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "four"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
3028
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3029
+  (0.4ms) rollback transaction
3030
+  (0.1ms) begin transaction
3031
+ -------------------------------------------------------
3032
+ LazyGlobalRecordTest: test_it_uses_custom_creation_proc
3033
+ -------------------------------------------------------
3034
+  (0.0ms) SAVEPOINT active_record_1
3035
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "six"], ["LIMIT", 1]]
3036
+ SQL (0.2ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "six"], ["other_value", "manual"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
3037
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3038
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
3039
+  (0.4ms) rollback transaction
3040
+  (0.1ms) begin transaction
3041
+ ---------------------------------------------------------
3042
+ LazyGlobalRecordTest: test_raises_on_exceptions_in_filter
3043
+ ---------------------------------------------------------
3044
+  (0.0ms) SAVEPOINT active_record_1
3045
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "one"], ["LIMIT", 1]]
3046
+ SQL (0.3ms) INSERT INTO "values" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", "one"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
3047
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
3048
+  (0.4ms) rollback transaction
3049
+  (0.1ms) begin transaction
3050
+ -----------------------------------------------------------
3051
+ LazyGlobalRecordTest: test_it_does_allow_reset_when_allowed
3052
+ -----------------------------------------------------------
3053
+  (0.0ms) SAVEPOINT active_record_1
3054
+ SQL (0.7ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
3055
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3056
+  (0.0ms) SAVEPOINT active_record_1
3057
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "five"], ["LIMIT", 1]]
3058
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3059
+ SQL (0.1ms) DELETE FROM "values"
3060
+  (0.1ms) SAVEPOINT active_record_1
3061
+ SQL (0.4ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
3062
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3063
+  (0.1ms) SAVEPOINT active_record_1
3064
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "five"], ["LIMIT", 1]]
3065
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3066
+ Value Load (0.1ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
3067
+  (0.7ms) rollback transaction
3068
+  (0.2ms) begin transaction
3069
+ -------------------------------------
3070
+ LazyGlobalRecordTest: test_it_reloads
3071
+ -------------------------------------
3072
+  (0.1ms) SAVEPOINT active_record_1
3073
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "first"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
3074
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3075
+  (0.0ms) SAVEPOINT active_record_1
3076
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "five"], ["LIMIT", 1]]
3077
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3078
+ SQL (0.1ms) DELETE FROM "values"
3079
+  (0.0ms) SAVEPOINT active_record_1
3080
+ SQL (0.3ms) INSERT INTO "values" ("value", "other_value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["value", "five"], ["other_value", "second"], ["created_at", 2016-08-12 15:42:13 UTC], ["updated_at", 2016-08-12 15:42:13 UTC]]
3081
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3082
+  (0.0ms) SAVEPOINT active_record_1
3083
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."value" = ? ORDER BY "values"."id" ASC LIMIT ? [["value", "five"], ["LIMIT", 1]]
3084
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3085
+ Value Load (0.0ms) SELECT "values".* FROM "values" WHERE "values"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
3086
+  (0.5ms) rollback transaction