sequenced 3.1.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +3 -3
  3. data/CHANGELOG.md +14 -2
  4. data/Gemfile +1 -1
  5. data/MIT-LICENSE +1 -1
  6. data/README.md +31 -4
  7. data/lib/sequenced/generator.rb +3 -3
  8. data/lib/sequenced/version.rb +1 -1
  9. data/sequenced.gemspec +2 -3
  10. metadata +15 -161
  11. data/test/acts_as_sequenced_test.rb +0 -132
  12. data/test/concurrency_test.rb +0 -82
  13. data/test/dummy/README.rdoc +0 -261
  14. data/test/dummy/Rakefile +0 -7
  15. data/test/dummy/app/assets/javascripts/application.js +0 -15
  16. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  17. data/test/dummy/app/controllers/application_controller.rb +0 -3
  18. data/test/dummy/app/helpers/application_helper.rb +0 -2
  19. data/test/dummy/app/mailers/.gitkeep +0 -0
  20. data/test/dummy/app/models/.gitkeep +0 -0
  21. data/test/dummy/app/models/account.rb +0 -6
  22. data/test/dummy/app/models/address.rb +0 -4
  23. data/test/dummy/app/models/answer.rb +0 -4
  24. data/test/dummy/app/models/comment.rb +0 -8
  25. data/test/dummy/app/models/concurrent_badger.rb +0 -3
  26. data/test/dummy/app/models/doppelganger.rb +0 -4
  27. data/test/dummy/app/models/email.rb +0 -4
  28. data/test/dummy/app/models/invoice.rb +0 -4
  29. data/test/dummy/app/models/monster.rb +0 -3
  30. data/test/dummy/app/models/order.rb +0 -4
  31. data/test/dummy/app/models/policeman.rb +0 -5
  32. data/test/dummy/app/models/product.rb +0 -8
  33. data/test/dummy/app/models/question.rb +0 -4
  34. data/test/dummy/app/models/rating.rb +0 -3
  35. data/test/dummy/app/models/subscription.rb +0 -3
  36. data/test/dummy/app/models/user.rb +0 -4
  37. data/test/dummy/app/models/werewolf.rb +0 -2
  38. data/test/dummy/app/models/zombie.rb +0 -2
  39. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  40. data/test/dummy/config.ru +0 -4
  41. data/test/dummy/config/application.rb +0 -56
  42. data/test/dummy/config/boot.rb +0 -10
  43. data/test/dummy/config/database.yml +0 -29
  44. data/test/dummy/config/environment.rb +0 -5
  45. data/test/dummy/config/environments/development.rb +0 -33
  46. data/test/dummy/config/environments/production.rb +0 -67
  47. data/test/dummy/config/environments/test.rb +0 -43
  48. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  49. data/test/dummy/config/initializers/inflections.rb +0 -15
  50. data/test/dummy/config/initializers/mime_types.rb +0 -5
  51. data/test/dummy/config/initializers/secret_token.rb +0 -7
  52. data/test/dummy/config/initializers/session_store.rb +0 -8
  53. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  54. data/test/dummy/config/locales/en.yml +0 -5
  55. data/test/dummy/config/routes.rb +0 -58
  56. data/test/dummy/db/migrate/20120219165346_create_questions.rb +0 -10
  57. data/test/dummy/db/migrate/20120219165548_create_answers.rb +0 -13
  58. data/test/dummy/db/migrate/20120219171957_create_accounts.rb +0 -9
  59. data/test/dummy/db/migrate/20120219172039_create_invoices.rb +0 -12
  60. data/test/dummy/db/migrate/20120219172922_create_orders.rb +0 -10
  61. data/test/dummy/db/migrate/20120219174931_create_subscriptions.rb +0 -10
  62. data/test/dummy/db/migrate/20120219175744_create_users.rb +0 -12
  63. data/test/dummy/db/migrate/20120219232323_create_addresses.rb +0 -9
  64. data/test/dummy/db/migrate/20120220000804_create_comments.rb +0 -12
  65. data/test/dummy/db/migrate/20130411225444_create_emails.rb +0 -12
  66. data/test/dummy/db/migrate/20130715002029_create_ratings.rb +0 -10
  67. data/test/dummy/db/migrate/20130730004055_create_products.rb +0 -9
  68. data/test/dummy/db/migrate/20131226000000_create_monsters.rb +0 -9
  69. data/test/dummy/db/migrate/20140404195334_create_policemen.rb +0 -9
  70. data/test/dummy/db/migrate/20151120190645_create_concurrent_badgers.rb +0 -10
  71. data/test/dummy/db/migrate/20160118182655_create_doppelgangers.rb +0 -10
  72. data/test/dummy/db/schema.rb +0 -142
  73. data/test/dummy/lib/assets/.gitkeep +0 -0
  74. data/test/dummy/log/.gitkeep +0 -0
  75. data/test/dummy/public/404.html +0 -26
  76. data/test/dummy/public/422.html +0 -26
  77. data/test/dummy/public/500.html +0 -25
  78. data/test/dummy/public/favicon.ico +0 -0
  79. data/test/dummy/script/rails +0 -6
  80. data/test/multiple_sequences_test.rb +0 -20
  81. data/test/test_helper.rb +0 -13
@@ -1,10 +0,0 @@
1
- class CreateQuestions < ActiveRecord::Migration
2
- def change
3
- create_table :questions do |t|
4
- t.string :summary
5
- t.text :body
6
-
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,13 +0,0 @@
1
- class CreateAnswers < ActiveRecord::Migration
2
- def change
3
- create_table :answers do |t|
4
- t.references :question
5
- t.text :body
6
- t.integer :sequential_id
7
-
8
- t.timestamps
9
- end
10
- add_index :answers, :question_id
11
- add_index :answers, :sequential_id
12
- end
13
- end
@@ -1,9 +0,0 @@
1
- class CreateAccounts < ActiveRecord::Migration
2
- def change
3
- create_table :accounts do |t|
4
- t.string :name
5
-
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,12 +0,0 @@
1
- class CreateInvoices < ActiveRecord::Migration
2
- def change
3
- create_table :invoices do |t|
4
- t.integer :amount
5
- t.integer :sequential_id
6
- t.references :account
7
-
8
- t.timestamps
9
- end
10
- add_index :invoices, :account_id
11
- end
12
- end
@@ -1,10 +0,0 @@
1
- class CreateOrders < ActiveRecord::Migration
2
- def change
3
- create_table :orders do |t|
4
- t.string :product
5
- t.references :account
6
-
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- class CreateSubscriptions < ActiveRecord::Migration
2
- def change
3
- create_table :subscriptions do |t|
4
- t.string :plan
5
- t.integer :sequential_id
6
-
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,12 +0,0 @@
1
- class CreateUsers < ActiveRecord::Migration
2
- def change
3
- create_table :users do |t|
4
- t.references :account
5
- t.string :name
6
- t.integer :custom_sequential_id
7
-
8
- t.timestamps
9
- end
10
- add_index :users, :account_id
11
- end
12
- end
@@ -1,9 +0,0 @@
1
- class CreateAddresses < ActiveRecord::Migration
2
- def change
3
- create_table :addresses do |t|
4
- t.references :account
5
- t.string :city
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,12 +0,0 @@
1
- class CreateComments < ActiveRecord::Migration
2
- def change
3
- create_table :comments do |t|
4
- t.references :question
5
- t.text :body
6
- t.integer :sequential_id
7
-
8
- t.timestamps
9
- end
10
- add_index :comments, :question_id
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- class CreateEmails < ActiveRecord::Migration
2
- def change
3
- create_table :emails do |t|
4
- t.string :emailable_type
5
- t.integer :emailable_id
6
- t.integer :sequential_id
7
- t.string :address
8
-
9
- t.timestamps
10
- end
11
- end
12
- end
@@ -1,10 +0,0 @@
1
- class CreateRatings < ActiveRecord::Migration
2
- def change
3
- create_table :ratings do |t|
4
- t.references :comment
5
- t.integer :score
6
- t.integer :sequential_id
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,9 +0,0 @@
1
- class CreateProducts < ActiveRecord::Migration
2
- def change
3
- create_table :products do |t|
4
- t.references :account
5
- t.integer :sequential_id
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class CreateMonsters < ActiveRecord::Migration
2
- def change
3
- create_table :monsters do |t|
4
- t.integer :sequential_id
5
- t.string :type
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class CreatePolicemen < ActiveRecord::Migration
2
- def change
3
- create_table :policemen do |t|
4
- t.integer :sequential_id
5
-
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- class CreateConcurrentBadgers < ActiveRecord::Migration
2
- def change
3
- create_table :concurrent_badgers do |t|
4
- t.integer :sequential_id, null: false
5
- t.integer :burrow_id
6
- end
7
-
8
- add_index :concurrent_badgers, [:sequential_id, :burrow_id], unique: true, name: 'unique_concurrent'
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- class CreateDoppelgangers < ActiveRecord::Migration
2
- def change
3
- create_table :doppelgangers do |t|
4
- t.integer :sequential_id_one
5
- t.integer :sequential_id_two
6
-
7
- t.timestamps null: false
8
- end
9
- end
10
- end
@@ -1,142 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20160118182655) do
15
-
16
- create_table "accounts", force: :cascade do |t|
17
- t.string "name"
18
- t.datetime "created_at"
19
- t.datetime "updated_at"
20
- end
21
-
22
- create_table "addresses", force: :cascade do |t|
23
- t.integer "account_id"
24
- t.string "city"
25
- t.datetime "created_at"
26
- t.datetime "updated_at"
27
- end
28
-
29
- create_table "answers", force: :cascade do |t|
30
- t.integer "question_id"
31
- t.text "body"
32
- t.integer "sequential_id"
33
- t.datetime "created_at"
34
- t.datetime "updated_at"
35
- end
36
-
37
- add_index "answers", ["question_id"], name: "index_answers_on_question_id"
38
- add_index "answers", ["sequential_id"], name: "index_answers_on_sequential_id"
39
-
40
- create_table "comments", force: :cascade do |t|
41
- t.integer "question_id"
42
- t.text "body"
43
- t.integer "sequential_id"
44
- t.datetime "created_at"
45
- t.datetime "updated_at"
46
- end
47
-
48
- add_index "comments", ["question_id"], name: "index_comments_on_question_id"
49
-
50
- create_table "concurrent_badgers", force: :cascade do |t|
51
- t.integer "sequential_id", null: false
52
- t.integer "burrow_id"
53
- end
54
-
55
- add_index "concurrent_badgers", ["sequential_id", "burrow_id"], name: "unique_concurrent", unique: true
56
-
57
- create_table "doppelgangers", force: :cascade do |t|
58
- t.integer "sequential_id_one"
59
- t.integer "sequential_id_two"
60
- t.datetime "created_at", null: false
61
- t.datetime "updated_at", null: false
62
- end
63
-
64
- create_table "emails", force: :cascade do |t|
65
- t.string "emailable_type"
66
- t.integer "emailable_id"
67
- t.integer "sequential_id"
68
- t.string "address"
69
- t.datetime "created_at"
70
- t.datetime "updated_at"
71
- end
72
-
73
- create_table "invoices", force: :cascade do |t|
74
- t.integer "amount"
75
- t.integer "sequential_id"
76
- t.integer "account_id"
77
- t.datetime "created_at"
78
- t.datetime "updated_at"
79
- end
80
-
81
- add_index "invoices", ["account_id"], name: "index_invoices_on_account_id"
82
-
83
- create_table "monsters", force: :cascade do |t|
84
- t.integer "sequential_id"
85
- t.string "type"
86
- t.datetime "created_at"
87
- t.datetime "updated_at"
88
- end
89
-
90
- create_table "orders", force: :cascade do |t|
91
- t.string "product"
92
- t.integer "account_id"
93
- t.datetime "created_at"
94
- t.datetime "updated_at"
95
- end
96
-
97
- create_table "policemen", force: :cascade do |t|
98
- t.integer "sequential_id"
99
- t.datetime "created_at"
100
- t.datetime "updated_at"
101
- end
102
-
103
- create_table "products", force: :cascade do |t|
104
- t.integer "account_id"
105
- t.integer "sequential_id"
106
- t.datetime "created_at"
107
- t.datetime "updated_at"
108
- end
109
-
110
- create_table "questions", force: :cascade do |t|
111
- t.string "summary"
112
- t.text "body"
113
- t.datetime "created_at"
114
- t.datetime "updated_at"
115
- end
116
-
117
- create_table "ratings", force: :cascade do |t|
118
- t.integer "comment_id"
119
- t.integer "score"
120
- t.integer "sequential_id"
121
- t.datetime "created_at"
122
- t.datetime "updated_at"
123
- end
124
-
125
- create_table "subscriptions", force: :cascade do |t|
126
- t.string "plan"
127
- t.integer "sequential_id"
128
- t.datetime "created_at"
129
- t.datetime "updated_at"
130
- end
131
-
132
- create_table "users", force: :cascade do |t|
133
- t.integer "account_id"
134
- t.string "name"
135
- t.integer "custom_sequential_id"
136
- t.datetime "created_at"
137
- t.datetime "updated_at"
138
- end
139
-
140
- add_index "users", ["account_id"], name: "index_users_on_account_id"
141
-
142
- end
File without changes
File without changes
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
File without changes
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,20 +0,0 @@
1
- require 'test_helper'
2
-
3
- class MultipleSequencesTest < ActiveSupport::TestCase
4
- test "works with simple multiple sequences" do
5
- doppelganger = Doppelganger.create!
6
- assert_equal 1, doppelganger.sequential_id_one
7
- assert_equal 1000, doppelganger.sequential_id_two
8
- end
9
-
10
- test "raises error on multiple definitions for the same column" do
11
- assert_raise Sequenced::ActsAsSequenced::SequencedColumnExists do
12
- Doppelganger.class_eval do
13
- acts_as_sequenced column: :sequential_id_one, start_at: 99
14
- end
15
- end
16
-
17
- doppelganger = Doppelganger.create!
18
- assert_equal 1, doppelganger.sequential_id_one
19
- end
20
- end