sequenced 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/lib/sequenced/acts_as_sequenced.rb +7 -4
- data/lib/sequenced/version.rb +1 -1
- data/test/dummy/log/test.log +158 -0
- data/test/sequenced_test.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
@@ -59,6 +59,13 @@ module Sequenced
|
|
59
59
|
scope = self.class.sequenced_options[:scope]
|
60
60
|
column = self.class.sequenced_options[:column]
|
61
61
|
|
62
|
+
unless self.respond_to?(column)
|
63
|
+
raise ArgumentError, "Column method ##{column.to_s} is undefined"
|
64
|
+
end
|
65
|
+
|
66
|
+
# Short-circuit here if the ID is already set
|
67
|
+
return unless self.send(column).nil?
|
68
|
+
|
62
69
|
if scope.present?
|
63
70
|
if scope.is_a?(Array)
|
64
71
|
scope.each { |s| verify_scope_method(s) }
|
@@ -67,10 +74,6 @@ module Sequenced
|
|
67
74
|
end
|
68
75
|
end
|
69
76
|
|
70
|
-
unless self.respond_to?(column)
|
71
|
-
raise ArgumentError, "Column method ##{column.to_s} is undefined"
|
72
|
-
end
|
73
|
-
|
74
77
|
# Fetch the next ID unless it is already defined
|
75
78
|
self.send(:"#{column}=", next_sequential_id) until sequential_id_is_unique?
|
76
79
|
end
|
data/lib/sequenced/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -11871,3 +11871,161 @@ Migrating to CreateEmails (20130411225444)
|
|
11871
11871
|
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11872
11872
|
[1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
11873
11873
|
[1m[35m (5.8ms)[0m rollback transaction
|
11874
|
+
Connecting to database specified by database.yml
|
11875
|
+
[1m[36m (1.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
11876
|
+
Migrating to CreateQuestions (20120219165346)
|
11877
|
+
Migrating to CreateAnswers (20120219165548)
|
11878
|
+
Migrating to CreateAccounts (20120219171957)
|
11879
|
+
Migrating to CreateInvoices (20120219172039)
|
11880
|
+
Migrating to CreateOrders (20120219172922)
|
11881
|
+
Migrating to CreateSubscriptions (20120219174931)
|
11882
|
+
Migrating to CreateUsers (20120219175744)
|
11883
|
+
Migrating to CreateAddresses (20120219232323)
|
11884
|
+
Migrating to CreateComments (20120220000804)
|
11885
|
+
Migrating to CreateEmails (20130411225444)
|
11886
|
+
[1m[35m (0.0ms)[0m begin transaction
|
11887
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11888
|
+
[1m[35mSQL (3.8ms)[0m INSERT INTO "accounts" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["name", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11889
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11890
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11891
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."account_id" = 1 AND (custom_sequential_id IS NOT NULL) ORDER BY custom_sequential_id DESC LIMIT 1[0m
|
11892
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "users" WHERE "users"."custom_sequential_id" = 1 AND "users"."account_id" = 1
|
11893
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "users" ("account_id", "created_at", "custom_sequential_id", "name", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["account_id", 1], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["custom_sequential_id", 1], ["name", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11894
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11895
|
+
[1m[36m (55.9ms)[0m [1mrollback transaction[0m
|
11896
|
+
[1m[35m (0.0ms)[0m begin transaction
|
11897
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11898
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "accounts" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["name", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11899
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11900
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11901
|
+
[1m[36mInvoice Load (0.1ms)[0m [1mSELECT "invoices".* FROM "invoices" WHERE "invoices"."account_id" = 1 AND (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1[0m
|
11902
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "invoices" WHERE "invoices"."sequential_id" = 1000 AND "invoices"."account_id" = 1
|
11903
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "invoices" ("account_id", "amount", "created_at", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["account_id", 1], ["amount", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["sequential_id", 1000], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11904
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11905
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11906
|
+
[1m[35mInvoice Load (0.2ms)[0m SELECT "invoices".* FROM "invoices" WHERE "invoices"."account_id" = 1 AND (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1
|
11907
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "invoices" WHERE "invoices"."sequential_id" = 1001 AND "invoices"."account_id" = 1[0m
|
11908
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "invoices" ("account_id", "amount", "created_at", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["account_id", 1], ["amount", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["sequential_id", 1001], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11909
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11910
|
+
[1m[35m (0.6ms)[0m rollback transaction
|
11911
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
11912
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11913
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["name", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11914
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11915
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11916
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "invoices" ("account_id", "amount", "created_at", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["account_id", 1], ["amount", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["sequential_id", 1], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11917
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11918
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11919
|
+
[1m[36mInvoice Load (0.1ms)[0m [1mSELECT "invoices".* FROM "invoices" WHERE "invoices"."account_id" = 1 AND (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1[0m
|
11920
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "invoices" WHERE "invoices"."sequential_id" = 1000 AND "invoices"."account_id" = 1
|
11921
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "invoices" ("account_id", "amount", "created_at", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["account_id", 1], ["amount", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["sequential_id", 1000], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11922
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11923
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
11924
|
+
[1m[35m (0.0ms)[0m begin transaction
|
11925
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11926
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "subscriptions" ("created_at", "plan", "sequential_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["plan", nil], ["sequential_id", 1], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11927
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11928
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11929
|
+
[1m[36mSubscription Load (0.1ms)[0m [1mSELECT "subscriptions".* FROM "subscriptions" WHERE (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1[0m
|
11930
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "subscriptions" WHERE "subscriptions"."sequential_id" = 2
|
11931
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "subscriptions" ("created_at", "plan", "sequential_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["plan", nil], ["sequential_id", 2], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11932
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11933
|
+
[1m[36m (1.3ms)[0m [1mrollback transaction[0m
|
11934
|
+
[1m[35m (0.0ms)[0m begin transaction
|
11935
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11936
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "questions" ("body", "created_at", "summary", "updated_at") VALUES (?, ?, ?, ?) [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["summary", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11937
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11938
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11939
|
+
[1m[36mAnswer Load (0.2ms)[0m [1mSELECT "answers".* FROM "answers" WHERE "answers"."question_id" = 1 AND (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1[0m
|
11940
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "answers" WHERE "answers"."sequential_id" = 1 AND "answers"."question_id" = 1
|
11941
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "answers" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 1], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11942
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11943
|
+
[1m[36m (0.7ms)[0m [1mrollback transaction[0m
|
11944
|
+
[1m[35m (0.0ms)[0m begin transaction
|
11945
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11946
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "questions" ("body", "created_at", "summary", "updated_at") VALUES (?, ?, ?, ?) [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["summary", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11947
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11948
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11949
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "answers" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 10], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11950
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11951
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11952
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "answers" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 10], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11953
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11954
|
+
[1m[35m (0.6ms)[0m rollback transaction
|
11955
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
11956
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11957
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "questions" ("body", "created_at", "summary", "updated_at") VALUES (?, ?, ?, ?)[0m [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["summary", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11958
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11959
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11960
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "comments" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 1], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11961
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11962
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11963
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "comments" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 2], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11964
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11965
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11966
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "comments" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 3], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11967
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11968
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11969
|
+
[1m[36mComment Load (0.1ms)[0m [1mSELECT "comments".* FROM "comments" WHERE "comments"."question_id" = 1 AND (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1[0m
|
11970
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "comments" WHERE "comments"."sequential_id" = 4 AND "comments"."question_id" = 1
|
11971
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "comments" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 4], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11972
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11973
|
+
[1m[36m (0.7ms)[0m [1mrollback transaction[0m
|
11974
|
+
[1m[35m (0.0ms)[0m begin transaction
|
11975
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11976
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "emails" ("address", "created_at", "emailable_id", "emailable_type", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["address", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["emailable_id", 1], ["emailable_type", "User"], ["sequential_id", 2], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11977
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11978
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11979
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "emails" ("address", "created_at", "emailable_id", "emailable_type", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["address", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Question"], ["sequential_id", 3], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11980
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11981
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11982
|
+
[1m[35mEmail Load (0.2ms)[0m SELECT "emails".* FROM "emails" WHERE "emails"."emailable_id" = 1 AND "emails"."emailable_type" = 'User' AND (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1
|
11983
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "emails" WHERE "emails"."sequential_id" = 3 AND "emails"."emailable_id" = 1 AND "emails"."emailable_type" = 'User'[0m
|
11984
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "emails" ("address", "created_at", "emailable_id", "emailable_type", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["address", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["emailable_id", 1], ["emailable_type", "User"], ["sequential_id", 3], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11985
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11986
|
+
[1m[35m (0.6ms)[0m rollback transaction
|
11987
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
11988
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11989
|
+
[1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
11990
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
11991
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
11992
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11993
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "questions" ("body", "created_at", "summary", "updated_at") VALUES (?, ?, ?, ?)[0m [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["summary", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11994
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
11995
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
11996
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "answers" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 10], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
11997
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
11998
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
11999
|
+
[1m[36mAnswer Load (0.1ms)[0m [1mSELECT "answers".* FROM "answers" WHERE "answers"."question_id" = 1 AND (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1[0m
|
12000
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "answers" WHERE "answers"."sequential_id" = 11 AND "answers"."question_id" = 1
|
12001
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "answers" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 11], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
12002
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
12003
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
12004
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12005
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
12006
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "questions" ("body", "created_at", "summary", "updated_at") VALUES (?, ?, ?, ?) [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["summary", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
12007
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
12008
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
12009
|
+
[1m[36mAnswer Load (0.1ms)[0m [1mSELECT "answers".* FROM "answers" WHERE "answers"."question_id" = 1 AND (sequential_id IS NOT NULL) ORDER BY sequential_id DESC LIMIT 1[0m
|
12010
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "answers" WHERE "answers"."sequential_id" = 1 AND "answers"."question_id" = 1
|
12011
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "answers" ("body", "created_at", "question_id", "sequential_id", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["body", nil], ["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["question_id", 1], ["sequential_id", 1], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
12012
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
12013
|
+
[1m[36mAnswer Load (0.1ms)[0m [1mSELECT "answers".* FROM "answers" WHERE "answers"."id" = ? LIMIT 1[0m [["id", 1]]
|
12014
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
12015
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "answers" SET "body" = 'Updated body', "updated_at" = '2013-04-12 01:33:10.706724' WHERE "answers"."id" = 1[0m
|
12016
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
12017
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
12018
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12019
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
12020
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "accounts" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["name", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
12021
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
12022
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
12023
|
+
[1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
12024
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
12025
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12026
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
12027
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00], ["name", nil], ["updated_at", Fri, 12 Apr 2013 01:33:10 UTC +00:00]]
|
12028
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
12029
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
12030
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
12031
|
+
[1m[36m (6.1ms)[0m [1mrollback transaction[0m
|
data/test/sequenced_test.rb
CHANGED
@@ -89,7 +89,7 @@ class SequencedTest < ActiveSupport::TestCase
|
|
89
89
|
another_answer.save
|
90
90
|
|
91
91
|
assert_equal 10, answer.sequential_id
|
92
|
-
assert_equal
|
92
|
+
assert_equal 10, another_answer.sequential_id
|
93
93
|
end
|
94
94
|
|
95
95
|
test "model with a default scope for sorting" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequenced
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|