papeel 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +34 -0
- data/lib/generators/papeel/initializer/initializer_generator.rb +15 -0
- data/lib/generators/papeel/initializer/templates/initializer.rb +3 -0
- data/lib/generators/papeel/migration/migration_generator.rb +15 -0
- data/lib/generators/papeel/migration/templates/migration.rb +14 -0
- data/lib/papeel/acts_as_papeel_resource.rb +21 -0
- data/lib/papeel/acts_as_papeel_user.rb +52 -0
- data/lib/papeel/role.rb +16 -0
- data/lib/papeel/version.rb +3 -0
- data/lib/papeel.rb +22 -0
- data/lib/tasks/papeel_tasks.rake +4 -0
- data/test/acts_as_papeel_resource_test.rb +10 -0
- data/test/acts_as_papeel_user_test.rb +34 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/forum.rb +4 -0
- data/test/dummy/app/models/user.rb +4 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config/application.rb +25 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/papeel.rb +3 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20161011093640_create_users.rb +8 -0
- data/test/dummy/db/migrate/20161011093701_create_forums.rb +8 -0
- data/test/dummy/db/migrate/20161011115632_papeel_create_roles.rb +14 -0
- data/test/dummy/db/schema.rb +41 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +239 -0
- data/test/dummy/log/test.log +1448 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/fixtures/forums.yml +11 -0
- data/test/dummy/test/fixtures/roles.yml +11 -0
- data/test/dummy/test/fixtures/users.yml +11 -0
- data/test/dummy/test/models/forum_test.rb +7 -0
- data/test/dummy/test/models/role_test.rb +7 -0
- data/test/dummy/test/models/user_test.rb +7 -0
- data/test/papeel_test.rb +7 -0
- data/test/role_test.rb +54 -0
- data/test/test_helper.rb +20 -0
- 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,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,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"] %>
|
Binary file
|
@@ -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
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (0.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5
|
+
Migrating to CreateUsers (20161011093640)
|
6
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
7
|
+
[1m[35m (0.5ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
8
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161011093640"]]
|
9
|
+
[1m[35m (1.8ms)[0m commit transaction
|
10
|
+
Migrating to CreateForums (20161011093701)
|
11
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
12
|
+
[1m[35m (1.7ms)[0m CREATE TABLE "forums" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
13
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161011093701"]]
|
14
|
+
[1m[35m (1.8ms)[0m commit transaction
|
15
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
16
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
17
|
+
Migrating to PapeelCreateRoles (20161011115632)
|
18
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19
|
+
[1m[36m (0.5ms)[0m [1mCREATE 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) [0m
|
20
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
21
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_papeel_roles_on_user_id" ON "papeel_roles" ("user_id")[0m
|
22
|
+
[1m[35m (0.2ms)[0m 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
|
+
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_papeel_roles_on_resource_type_and_resource_id" ON "papeel_roles" ("resource_type", "resource_id")[0m
|
31
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_roles_on_name" ON "roles" ("name")
|
32
|
+
[1m[36m (0.8ms)[0m [1mrollback transaction[0m
|
33
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
34
|
+
Migrating to PapeelCreateRoles (20161011115632)
|
35
|
+
[1m[35m (0.1ms)[0m begin transaction
|
36
|
+
[1m[36m (0.5ms)[0m [1mCREATE 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) [0m
|
37
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
38
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_papeel_roles_on_user_id" ON "papeel_roles" ("user_id")[0m
|
39
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_papeel_roles_on_resource_type_and_resource_id" ON "papeel_roles" ("resource_type", "resource_id")[0m
|
48
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1m 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
|
+
[0m
|
64
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_papeel_roles_on_name" ON "papeel_roles" ("name")
|
65
|
+
[1m[36m (0.1ms)[0m [1m 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
|
+
[0m
|
73
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1m 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
|
+
[0m
|
89
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_papeel_roles_on_user_id_and_name" ON "papeel_roles" ("user_id", "name")
|
90
|
+
[1m[36m (0.1ms)[0m [1m 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
|
+
[0m
|
98
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.0ms)[0m [1m 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
|
+
[0m
|
114
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_papeel_roles_on_resource_type_and_resource_id_and_name" ON "papeel_roles" ("resource_type", "resource_id", "name")[0m
|
123
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161011115632"]]
|
124
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
125
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
126
|
+
[1m[36m (0.1ms)[0m [1m 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
|
+
[0m
|
134
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1m 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
|
+
[0m
|
150
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1m 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
|
+
[0m
|
166
|
+
[1m[36mPapeel::Role Load (0.2ms)[0m [1mSELECT "roles".* FROM "roles" ORDER BY "roles"."id" ASC LIMIT 1[0m
|
167
|
+
[1m[36mPapeel::Role Load (0.4ms)[0m [1mSELECT "papeel_roles".* FROM "papeel_roles" ORDER BY "papeel_roles"."id" ASC LIMIT 1[0m
|
168
|
+
[1m[36mUser Load (0.4ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
169
|
+
[1m[35m (0.1ms)[0m begin transaction
|
170
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2016-10-11 12:27:53.225652"], ["updated_at", "2016-10-11 12:27:53.225652"]]
|
171
|
+
[1m[35m (0.8ms)[0m commit transaction
|
172
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
173
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
174
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
175
|
+
[1m[36mPapeel::Role Load (0.4ms)[0m [1mSELECT "papeel_roles".* FROM "papeel_roles" WHERE "papeel_roles"."user_id" = ?[0m [["user_id", 1]]
|
176
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
177
|
+
[1m[36mPapeel::Role Load (0.1ms)[0m [1mSELECT "papeel_roles".* FROM "papeel_roles" WHERE "papeel_roles"."user_id" = ?[0m [["user_id", 1]]
|
178
|
+
[1m[35mUser Load (0.5ms)[0m SELECT "users".* FROM "users" INNER JOIN "papeel_roles" ON "papeel_roles"."user_id" = "users"."id" WHERE "papeel_roles"."name" = 'admin'
|
179
|
+
[1m[36mPapeel::Role Exists (0.9ms)[0m [1mSELECT 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[0m
|
180
|
+
[1m[35mPapeel::Role Exists (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.5ms)[0m [1mSELECT "users".* FROM "users" INNER JOIN "papeel_roles" ON "papeel_roles"."user_id" = "users"."id" WHERE "papeel_roles"."name" = 'admin'[0m
|
182
|
+
[1m[35mUser Load (7.8ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
183
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
184
|
+
[1m[35m (0.5ms)[0m 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
|
+
[1m[36mUser Load (0.9ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
186
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
187
|
+
[1m[36m (0.2ms)[0m [1mSELECT 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[0m [["user_id", 1], ["name", "admin"]]
|
188
|
+
[1m[36mForum Load (0.5ms)[0m [1mSELECT "forums".* FROM "forums" ORDER BY "forums"."id" ASC LIMIT 1[0m
|
189
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
190
|
+
[1m[35mSQL (1.0ms)[0m 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
|
+
[1m[36m (0.9ms)[0m [1mcommit transaction[0m
|
192
|
+
[1m[35m (0.1ms)[0m begin transaction
|
193
|
+
[1m[36mPapeel::Role Exists (0.8ms)[0m [1mSELECT 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[0m
|
194
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
195
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
196
|
+
[1m[35mSQL (0.5ms)[0m 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
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
198
|
+
[1m[35m (0.1ms)[0m begin transaction
|
199
|
+
[1m[36mPapeel::Role Exists (0.3ms)[0m [1mSELECT 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[0m
|
200
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
201
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
202
|
+
[1m[35mPapeel::Role Exists (0.2ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
204
|
+
[1m[35m (0.1ms)[0m begin transaction
|
205
|
+
[1m[36mPapeel::Role Exists (0.3ms)[0m [1mSELECT 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[0m
|
206
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
207
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
208
|
+
[1m[35mPapeel::Role Exists (0.2ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
210
|
+
[1m[35mPapeel::Role Load (7.7ms)[0m SELECT "papeel_roles".* FROM "papeel_roles"
|
211
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
212
|
+
[1m[35mPapeel::Role Exists (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
214
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
215
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (1.0ms)[0m [1mcommit transaction[0m
|
217
|
+
[1m[35m (0.1ms)[0m begin transaction
|
218
|
+
[1m[36mPapeel::Role Exists (0.2ms)[0m [1mSELECT 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[0m
|
219
|
+
[1m[35mSQL (0.5ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
221
|
+
[1m[35mPapeel::Role Exists (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
223
|
+
[1m[35m (0.1ms)[0m begin transaction
|
224
|
+
[1m[36mPapeel::Role Exists (0.2ms)[0m [1mSELECT 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[0m
|
225
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
226
|
+
[1m[36mPapeel::Role Exists (0.2ms)[0m [1mSELECT 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[0m
|
227
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
|
228
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
229
|
+
[1m[35mPapeel::Role Exists (0.1ms)[0m 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
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "papeel_roles" ("user_id", "name", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["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
|
+
[1m[35m (8.9ms)[0m commit transaction
|
232
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
233
|
+
[1m[35mSQL (0.4ms)[0m DELETE FROM "papeel_roles" WHERE "papeel_roles"."id" = ? [["id", 2]]
|
234
|
+
[1m[36m (8.7ms)[0m [1mcommit transaction[0m
|
235
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
|
236
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
237
|
+
[1m[35mPapeel::Role Exists (0.1ms)[0m 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
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "papeel_roles" ("user_id", "name", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["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
|
+
[1m[35m (8.1ms)[0m commit transaction
|