papeel 0.0.1

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 (71) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/lib/generators/papeel/initializer/initializer_generator.rb +15 -0
  6. data/lib/generators/papeel/initializer/templates/initializer.rb +3 -0
  7. data/lib/generators/papeel/migration/migration_generator.rb +15 -0
  8. data/lib/generators/papeel/migration/templates/migration.rb +14 -0
  9. data/lib/papeel/acts_as_papeel_resource.rb +21 -0
  10. data/lib/papeel/acts_as_papeel_user.rb +52 -0
  11. data/lib/papeel/role.rb +16 -0
  12. data/lib/papeel/version.rb +3 -0
  13. data/lib/papeel.rb +22 -0
  14. data/lib/tasks/papeel_tasks.rake +4 -0
  15. data/test/acts_as_papeel_resource_test.rb +10 -0
  16. data/test/acts_as_papeel_user_test.rb +34 -0
  17. data/test/dummy/README.rdoc +28 -0
  18. data/test/dummy/Rakefile +6 -0
  19. data/test/dummy/app/assets/javascripts/application.js +13 -0
  20. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  21. data/test/dummy/app/controllers/application_controller.rb +5 -0
  22. data/test/dummy/app/helpers/application_helper.rb +2 -0
  23. data/test/dummy/app/models/forum.rb +4 -0
  24. data/test/dummy/app/models/user.rb +4 -0
  25. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  26. data/test/dummy/bin/bundle +3 -0
  27. data/test/dummy/bin/rails +4 -0
  28. data/test/dummy/bin/rake +4 -0
  29. data/test/dummy/bin/setup +29 -0
  30. data/test/dummy/config/application.rb +25 -0
  31. data/test/dummy/config/boot.rb +5 -0
  32. data/test/dummy/config/database.yml +25 -0
  33. data/test/dummy/config/environment.rb +5 -0
  34. data/test/dummy/config/environments/development.rb +41 -0
  35. data/test/dummy/config/environments/production.rb +79 -0
  36. data/test/dummy/config/environments/test.rb +42 -0
  37. data/test/dummy/config/initializers/assets.rb +11 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  40. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  41. data/test/dummy/config/initializers/inflections.rb +16 -0
  42. data/test/dummy/config/initializers/mime_types.rb +4 -0
  43. data/test/dummy/config/initializers/papeel.rb +3 -0
  44. data/test/dummy/config/initializers/session_store.rb +3 -0
  45. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  46. data/test/dummy/config/locales/en.yml +23 -0
  47. data/test/dummy/config/routes.rb +56 -0
  48. data/test/dummy/config/secrets.yml +22 -0
  49. data/test/dummy/config.ru +4 -0
  50. data/test/dummy/db/development.sqlite3 +0 -0
  51. data/test/dummy/db/migrate/20161011093640_create_users.rb +8 -0
  52. data/test/dummy/db/migrate/20161011093701_create_forums.rb +8 -0
  53. data/test/dummy/db/migrate/20161011115632_papeel_create_roles.rb +14 -0
  54. data/test/dummy/db/schema.rb +41 -0
  55. data/test/dummy/db/test.sqlite3 +0 -0
  56. data/test/dummy/log/development.log +239 -0
  57. data/test/dummy/log/test.log +1448 -0
  58. data/test/dummy/public/404.html +67 -0
  59. data/test/dummy/public/422.html +67 -0
  60. data/test/dummy/public/500.html +66 -0
  61. data/test/dummy/public/favicon.ico +0 -0
  62. data/test/dummy/test/fixtures/forums.yml +11 -0
  63. data/test/dummy/test/fixtures/roles.yml +11 -0
  64. data/test/dummy/test/fixtures/users.yml +11 -0
  65. data/test/dummy/test/models/forum_test.rb +7 -0
  66. data/test/dummy/test/models/role_test.rb +7 -0
  67. data/test/dummy/test/models/user_test.rb +7 -0
  68. data/test/papeel_test.rb +7 -0
  69. data/test/role_test.rb +54 -0
  70. data/test/test_helper.rb +20 -0
  71. metadata +198 -0
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,3 @@
1
+ Papeel.configure do |config|
2
+ config.roles = [:super_admin, :admin]
3
+ end
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,56 @@
1
+ Rails.application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
+
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
10
+
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
+
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
15
+ # resources :products
16
+
17
+ # Example resource route with options:
18
+ # resources :products do
19
+ # member do
20
+ # get 'short'
21
+ # post 'toggle'
22
+ # end
23
+ #
24
+ # collection do
25
+ # get 'sold'
26
+ # end
27
+ # end
28
+
29
+ # Example resource route with sub-resources:
30
+ # resources :products do
31
+ # resources :comments, :sales
32
+ # resource :seller
33
+ # end
34
+
35
+ # Example resource route with more complex sub-resources:
36
+ # resources :products do
37
+ # resources :comments
38
+ # resources :sales do
39
+ # get 'recent', on: :collection
40
+ # end
41
+ # end
42
+
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
49
+
50
+ # Example resource route within a namespace:
51
+ # namespace :admin do
52
+ # # Directs /admin/products/* to Admin::ProductsController
53
+ # # (app/controllers/admin/products_controller.rb)
54
+ # resources :products
55
+ # end
56
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 80c2c59e56a84470acf73fe1aea5904c7e03a054c517054306f1956ce6fa65651df7273a5242aad68acf07ba9e834873730dd57bc56d7ecb798230523d568a22
15
+
16
+ test:
17
+ secret_key_base: becf84a7a391b1f82caee9a27df6dea1e29f205e390185d645aada8ae815a2b882ff470a2e3e1ab1794f818302624346143729e8a8153cfb8fa9fd07e9ed1b21
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
Binary file
@@ -0,0 +1,8 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+
5
+ t.timestamps null: false
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class CreateForums < ActiveRecord::Migration
2
+ def change
3
+ create_table :forums do |t|
4
+
5
+ t.timestamps null: false
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ class PapeelCreateRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :papeel_roles do |t|
4
+ t.belongs_to :user, index: true, foreign_key: true
5
+ t.string :name
6
+ t.belongs_to :resource, polymorphic: true, index: true
7
+ t.timestamps null: false
8
+ end
9
+
10
+ add_index :papeel_roles, :name
11
+ add_index :papeel_roles, [:user_id, :name]
12
+ add_index :papeel_roles, [:resource_type, :resource_id, :name]
13
+ end
14
+ end
@@ -0,0 +1,41 @@
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: 20161011115632) do
15
+
16
+ create_table "forums", force: :cascade do |t|
17
+ t.datetime "created_at", null: false
18
+ t.datetime "updated_at", null: false
19
+ end
20
+
21
+ create_table "papeel_roles", force: :cascade do |t|
22
+ t.integer "user_id"
23
+ t.string "name"
24
+ t.integer "resource_id"
25
+ t.string "resource_type"
26
+ t.datetime "created_at", null: false
27
+ t.datetime "updated_at", null: false
28
+ end
29
+
30
+ add_index "papeel_roles", ["name"], name: "index_papeel_roles_on_name"
31
+ add_index "papeel_roles", ["resource_type", "resource_id", "name"], name: "index_papeel_roles_on_resource_type_and_resource_id_and_name"
32
+ add_index "papeel_roles", ["resource_type", "resource_id"], name: "index_papeel_roles_on_resource_type_and_resource_id"
33
+ add_index "papeel_roles", ["user_id", "name"], name: "index_papeel_roles_on_user_id_and_name"
34
+ add_index "papeel_roles", ["user_id"], name: "index_papeel_roles_on_user_id"
35
+
36
+ create_table "users", force: :cascade do |t|
37
+ t.datetime "created_at", null: false
38
+ t.datetime "updated_at", null: false
39
+ end
40
+
41
+ end
Binary file
@@ -0,0 +1,239 @@
1
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateUsers (20161011093640)
6
+  (0.1ms) begin transaction
7
+  (0.5ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
8
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161011093640"]]
9
+  (1.8ms) commit transaction
10
+ Migrating to CreateForums (20161011093701)
11
+  (0.1ms) begin transaction
12
+  (1.7ms) CREATE TABLE "forums" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
13
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161011093701"]]
14
+  (1.8ms) commit transaction
15
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
16
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
17
+ Migrating to PapeelCreateRoles (20161011115632)
18
+  (0.1ms) begin transaction
19
+  (0.5ms) CREATE TABLE "papeel_roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "name" varchar, "resource_id" integer, "resource_type" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
20
+  (0.1ms) select sqlite_version(*)
21
+  (0.1ms) CREATE INDEX "index_papeel_roles_on_user_id" ON "papeel_roles" ("user_id")
22
+  (0.2ms) SELECT sql
23
+ FROM sqlite_master
24
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
25
+ UNION ALL
26
+ SELECT sql
27
+ FROM sqlite_temp_master
28
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
29
+
30
+  (0.2ms) CREATE INDEX "index_papeel_roles_on_resource_type_and_resource_id" ON "papeel_roles" ("resource_type", "resource_id")
31
+  (0.1ms) CREATE INDEX "index_roles_on_name" ON "roles" ("name")
32
+  (0.8ms) rollback transaction
33
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
34
+ Migrating to PapeelCreateRoles (20161011115632)
35
+  (0.1ms) begin transaction
36
+  (0.5ms) CREATE TABLE "papeel_roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "name" varchar, "resource_id" integer, "resource_type" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
37
+  (0.1ms) select sqlite_version(*)
38
+  (0.1ms) CREATE INDEX "index_papeel_roles_on_user_id" ON "papeel_roles" ("user_id")
39
+  (0.1ms) SELECT sql
40
+ FROM sqlite_master
41
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
42
+ UNION ALL
43
+ SELECT sql
44
+ FROM sqlite_temp_master
45
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
46
+
47
+  (0.1ms) CREATE INDEX "index_papeel_roles_on_resource_type_and_resource_id" ON "papeel_roles" ("resource_type", "resource_id")
48
+  (0.1ms) SELECT sql
49
+ FROM sqlite_master
50
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id' AND type='index'
51
+ UNION ALL
52
+ SELECT sql
53
+ FROM sqlite_temp_master
54
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id' AND type='index'
55
+
56
+  (0.1ms)  SELECT sql
57
+ FROM sqlite_master
58
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
59
+ UNION ALL
60
+ SELECT sql
61
+ FROM sqlite_temp_master
62
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
63
+ 
64
+  (0.1ms) CREATE INDEX "index_papeel_roles_on_name" ON "papeel_roles" ("name")
65
+  (0.1ms)  SELECT sql
66
+ FROM sqlite_master
67
+ WHERE name='index_papeel_roles_on_name' AND type='index'
68
+ UNION ALL
69
+ SELECT sql
70
+ FROM sqlite_temp_master
71
+ WHERE name='index_papeel_roles_on_name' AND type='index'
72
+ 
73
+  (0.1ms) SELECT sql
74
+ FROM sqlite_master
75
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id' AND type='index'
76
+ UNION ALL
77
+ SELECT sql
78
+ FROM sqlite_temp_master
79
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id' AND type='index'
80
+
81
+  (0.1ms)  SELECT sql
82
+ FROM sqlite_master
83
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
84
+ UNION ALL
85
+ SELECT sql
86
+ FROM sqlite_temp_master
87
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
88
+ 
89
+  (0.1ms) CREATE INDEX "index_papeel_roles_on_user_id_and_name" ON "papeel_roles" ("user_id", "name")
90
+  (0.1ms)  SELECT sql
91
+ FROM sqlite_master
92
+ WHERE name='index_papeel_roles_on_user_id_and_name' AND type='index'
93
+ UNION ALL
94
+ SELECT sql
95
+ FROM sqlite_temp_master
96
+ WHERE name='index_papeel_roles_on_user_id_and_name' AND type='index'
97
+ 
98
+  (0.1ms) SELECT sql
99
+ FROM sqlite_master
100
+ WHERE name='index_papeel_roles_on_name' AND type='index'
101
+ UNION ALL
102
+ SELECT sql
103
+ FROM sqlite_temp_master
104
+ WHERE name='index_papeel_roles_on_name' AND type='index'
105
+
106
+  (0.0ms)  SELECT sql
107
+ FROM sqlite_master
108
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id' AND type='index'
109
+ UNION ALL
110
+ SELECT sql
111
+ FROM sqlite_temp_master
112
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id' AND type='index'
113
+ 
114
+  (0.1ms) SELECT sql
115
+ FROM sqlite_master
116
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
117
+ UNION ALL
118
+ SELECT sql
119
+ FROM sqlite_temp_master
120
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
121
+
122
+  (0.1ms) CREATE INDEX "index_papeel_roles_on_resource_type_and_resource_id_and_name" ON "papeel_roles" ("resource_type", "resource_id", "name")
123
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161011115632"]]
124
+  (0.8ms) commit transaction
125
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
126
+  (0.1ms)  SELECT sql
127
+ FROM sqlite_master
128
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id_and_name' AND type='index'
129
+ UNION ALL
130
+ SELECT sql
131
+ FROM sqlite_temp_master
132
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id_and_name' AND type='index'
133
+ 
134
+  (0.1ms) SELECT sql
135
+ FROM sqlite_master
136
+ WHERE name='index_papeel_roles_on_user_id_and_name' AND type='index'
137
+ UNION ALL
138
+ SELECT sql
139
+ FROM sqlite_temp_master
140
+ WHERE name='index_papeel_roles_on_user_id_and_name' AND type='index'
141
+
142
+  (0.1ms)  SELECT sql
143
+ FROM sqlite_master
144
+ WHERE name='index_papeel_roles_on_name' AND type='index'
145
+ UNION ALL
146
+ SELECT sql
147
+ FROM sqlite_temp_master
148
+ WHERE name='index_papeel_roles_on_name' AND type='index'
149
+ 
150
+  (0.1ms) SELECT sql
151
+ FROM sqlite_master
152
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id' AND type='index'
153
+ UNION ALL
154
+ SELECT sql
155
+ FROM sqlite_temp_master
156
+ WHERE name='index_papeel_roles_on_resource_type_and_resource_id' AND type='index'
157
+
158
+  (0.1ms)  SELECT sql
159
+ FROM sqlite_master
160
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
161
+ UNION ALL
162
+ SELECT sql
163
+ FROM sqlite_temp_master
164
+ WHERE name='index_papeel_roles_on_user_id' AND type='index'
165
+ 
166
+ Papeel::Role Load (0.2ms) SELECT "roles".* FROM "roles" ORDER BY "roles"."id" ASC LIMIT 1
167
+ Papeel::Role Load (0.4ms) SELECT "papeel_roles".* FROM "papeel_roles" ORDER BY "papeel_roles"."id" ASC LIMIT 1
168
+ User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
169
+  (0.1ms) begin transaction
170
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2016-10-11 12:27:53.225652"], ["updated_at", "2016-10-11 12:27:53.225652"]]
171
+  (0.8ms) commit transaction
172
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
173
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
174
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
175
+ Papeel::Role Load (0.4ms) SELECT "papeel_roles".* FROM "papeel_roles" WHERE "papeel_roles"."user_id" = ? [["user_id", 1]]
176
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
177
+ Papeel::Role Load (0.1ms) SELECT "papeel_roles".* FROM "papeel_roles" WHERE "papeel_roles"."user_id" = ? [["user_id", 1]]
178
+ User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "papeel_roles" ON "papeel_roles"."user_id" = "users"."id" WHERE "papeel_roles"."name" = 'admin'
179
+ Papeel::Role Exists (0.9ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'test' AND "papeel_roles"."user_id" IS NULL AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
180
+ Papeel::Role Exists (0.2ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'test' AND "papeel_roles"."user_id" IS NULL AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
181
+ User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "papeel_roles" ON "papeel_roles"."user_id" = "users"."id" WHERE "papeel_roles"."name" = 'admin'
182
+ User Load (7.8ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
183
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
184
+  (0.5ms) SELECT COUNT(*) FROM "papeel_roles" WHERE "papeel_roles"."user_id" = ? AND "papeel_roles"."name" = ? AND "papeel_roles"."resource_id" IS NULL AND "papeel_roles"."resource_type" IS NULL [["user_id", 1], ["name", "admin"]]
185
+ User Load (0.9ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
186
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
187
+  (0.2ms) SELECT COUNT(*) FROM "papeel_roles" WHERE "papeel_roles"."user_id" = ? AND "papeel_roles"."name" = ? AND "papeel_roles"."resource_id" IS NULL AND "papeel_roles"."resource_type" IS NULL [["user_id", 1], ["name", "admin"]]
188
+ Forum Load (0.5ms) SELECT "forums".* FROM "forums" ORDER BY "forums"."id" ASC LIMIT 1
189
+  (0.1ms) begin transaction
190
+ SQL (1.0ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2016-10-11 13:31:03.696627"], ["updated_at", "2016-10-11 13:31:03.696627"]]
191
+  (0.9ms) commit transaction
192
+  (0.1ms) begin transaction
193
+ Papeel::Role Exists (0.8ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 2 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
194
+  (0.1ms) rollback transaction
195
+  (0.1ms) begin transaction
196
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2016-10-11 13:32:10.610829"], ["updated_at", "2016-10-11 13:32:10.610829"]]
197
+  (0.7ms) commit transaction
198
+  (0.1ms) begin transaction
199
+ Papeel::Role Exists (0.3ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 3 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
200
+  (0.1ms) rollback transaction
201
+  (0.1ms) begin transaction
202
+ Papeel::Role Exists (0.2ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 3 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
203
+  (0.1ms) rollback transaction
204
+  (0.1ms) begin transaction
205
+ Papeel::Role Exists (0.3ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 3 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
206
+  (0.1ms) rollback transaction
207
+  (0.1ms) begin transaction
208
+ Papeel::Role Exists (0.2ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 3 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
209
+  (0.1ms) rollback transaction
210
+ Papeel::Role Load (7.7ms) SELECT "papeel_roles".* FROM "papeel_roles"
211
+  (0.4ms) begin transaction
212
+ Papeel::Role Exists (0.1ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 3 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
213
+  (0.1ms) rollback transaction
214
+  (0.0ms) begin transaction
215
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2016-10-11 13:36:02.106986"], ["updated_at", "2016-10-11 13:36:02.106986"]]
216
+  (1.0ms) commit transaction
217
+  (0.1ms) begin transaction
218
+ Papeel::Role Exists (0.2ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 4 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
219
+ SQL (0.5ms) INSERT INTO "papeel_roles" ("user_id", "name", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["user_id", 4], ["name", "admin"], ["created_at", "2016-10-11 13:36:04.574613"], ["updated_at", "2016-10-11 13:36:04.574613"]]
220
+  (0.8ms) commit transaction
221
+ Papeel::Role Exists (0.2ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."id" != 1 AND "papeel_roles"."user_id" = 4 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
222
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
223
+  (0.1ms) begin transaction
224
+ Papeel::Role Exists (0.2ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 4 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
225
+  (0.1ms) rollback transaction
226
+ Papeel::Role Exists (0.2ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'admin' AND "papeel_roles"."user_id" = 4 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
227
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
228
+  (0.0ms) begin transaction
229
+ Papeel::Role Exists (0.1ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'super_admin' AND "papeel_roles"."user_id" = 4 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
230
+ SQL (0.5ms) INSERT INTO "papeel_roles" ("user_id", "name", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["user_id", 4], ["name", "super_admin"], ["created_at", "2016-10-11 13:36:53.799956"], ["updated_at", "2016-10-11 13:36:53.799956"]]
231
+  (8.9ms) commit transaction
232
+  (0.1ms) begin transaction
233
+ SQL (0.4ms) DELETE FROM "papeel_roles" WHERE "papeel_roles"."id" = ? [["id", 2]]
234
+  (8.7ms) commit transaction
235
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
236
+  (0.1ms) begin transaction
237
+ Papeel::Role Exists (0.1ms) SELECT 1 AS one FROM "papeel_roles" WHERE ("papeel_roles"."name" = 'super_admin' AND "papeel_roles"."user_id" = 4 AND "papeel_roles"."resource_type" IS NULL AND "papeel_roles"."resource_id" IS NULL) LIMIT 1
238
+ SQL (0.3ms) INSERT INTO "papeel_roles" ("user_id", "name", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["user_id", 4], ["name", "super_admin"], ["created_at", "2016-10-11 13:37:03.240197"], ["updated_at", "2016-10-11 13:37:03.240197"]]
239
+  (8.1ms) commit transaction