core_models 0.0.2
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/Rakefile +34 -0
- data/lib/core_models.rb +4 -0
- data/lib/core_models/models/concerns/group_concerns.rb +31 -0
- data/lib/core_models/models/concerns/role_concerns.rb +31 -0
- data/lib/core_models/models/concerns/user_concerns.rb +102 -0
- data/lib/core_models/models/group.rb +25 -0
- data/lib/core_models/models/group_membership.rb +16 -0
- data/lib/core_models/models/groups_role.rb +15 -0
- data/lib/core_models/models/permission.rb +24 -0
- data/lib/core_models/models/role.rb +33 -0
- data/lib/core_models/models/roles_permission.rb +15 -0
- data/lib/core_models/models/user.rb +63 -0
- data/lib/core_models/version.rb +3 -0
- data/lib/generators/core_models_setup_generator.rb +19 -0
- data/lib/tasks/core_models_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +23 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/friendly_id.rb +88 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150220064247_create_friendly_id_slugs.rb +15 -0
- data/spec/dummy/db/schema.rb +93 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +256 -0
- data/spec/dummy/log/test.log +21878 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/test.sqlite3 +0 -0
- data/spec/models/group_spec.rb +94 -0
- data/spec/models/permission_spec.rb +49 -0
- data/spec/models/role_spec.rb +113 -0
- data/spec/models/user_spec.rb +139 -0
- data/spec/rails_helper.rb +57 -0
- data/spec/schema.rb +103 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/factories.rb +54 -0
- data/spec/support/model_classes.rb +36 -0
- data/spec/support/setup.rb +48 -0
- data/spec/test.sqlite3 +0 -0
- metadata +294 -0
@@ -0,0 +1,88 @@
|
|
1
|
+
# FriendlyId Global Configuration
|
2
|
+
#
|
3
|
+
# Use this to set up shared configuration options for your entire application.
|
4
|
+
# Any of the configuration options shown here can also be applied to single
|
5
|
+
# models by passing arguments to the `friendly_id` class method or defining
|
6
|
+
# methods in your model.
|
7
|
+
#
|
8
|
+
# To learn more, check out the guide:
|
9
|
+
#
|
10
|
+
# http://norman.github.io/friendly_id/file.Guide.html
|
11
|
+
|
12
|
+
FriendlyId.defaults do |config|
|
13
|
+
# ## Reserved Words
|
14
|
+
#
|
15
|
+
# Some words could conflict with Rails's routes when used as slugs, or are
|
16
|
+
# undesirable to allow as slugs. Edit this list as needed for your app.
|
17
|
+
config.use :reserved
|
18
|
+
|
19
|
+
config.reserved_words = %w(new edit index session login logout users admin
|
20
|
+
stylesheets assets javascripts images)
|
21
|
+
|
22
|
+
# ## Friendly Finders
|
23
|
+
#
|
24
|
+
# Uncomment this to use friendly finders in all models. By default, if
|
25
|
+
# you wish to find a record by its friendly id, you must do:
|
26
|
+
#
|
27
|
+
# MyModel.friendly.find('foo')
|
28
|
+
#
|
29
|
+
# If you uncomment this, you can do:
|
30
|
+
#
|
31
|
+
# MyModel.find('foo')
|
32
|
+
#
|
33
|
+
# This is significantly more convenient but may not be appropriate for
|
34
|
+
# all applications, so you must explicity opt-in to this behavior. You can
|
35
|
+
# always also configure it on a per-model basis if you prefer.
|
36
|
+
#
|
37
|
+
# Something else to consider is that using the :finders addon boosts
|
38
|
+
# performance because it will avoid Rails-internal code that makes runtime
|
39
|
+
# calls to `Module.extend`.
|
40
|
+
#
|
41
|
+
# config.use :finders
|
42
|
+
#
|
43
|
+
# ## Slugs
|
44
|
+
#
|
45
|
+
# Most applications will use the :slugged module everywhere. If you wish
|
46
|
+
# to do so, uncomment the following line.
|
47
|
+
#
|
48
|
+
# config.use :slugged
|
49
|
+
#
|
50
|
+
# By default, FriendlyId's :slugged addon expects the slug column to be named
|
51
|
+
# 'slug', but you can change it if you wish.
|
52
|
+
#
|
53
|
+
# config.slug_column = 'slug'
|
54
|
+
#
|
55
|
+
# When FriendlyId can not generate a unique ID from your base method, it appends
|
56
|
+
# a UUID, separated by a single dash. You can configure the character used as the
|
57
|
+
# separator. If you're upgrading from FriendlyId 4, you may wish to replace this
|
58
|
+
# with two dashes.
|
59
|
+
#
|
60
|
+
# config.sequence_separator = '-'
|
61
|
+
#
|
62
|
+
# ## Tips and Tricks
|
63
|
+
#
|
64
|
+
# ### Controlling when slugs are generated
|
65
|
+
#
|
66
|
+
# As of FriendlyId 5.0, new slugs are generated only when the slug field is
|
67
|
+
# nil, but if you're using a column as your base method can change this
|
68
|
+
# behavior by overriding the `should_generate_new_friendly_id` method that
|
69
|
+
# FriendlyId adds to your model. The change below makes FriendlyId 5.0 behave
|
70
|
+
# more like 4.0.
|
71
|
+
#
|
72
|
+
# config.use Module.new {
|
73
|
+
# def should_generate_new_friendly_id?
|
74
|
+
# slug.blank? || <your_column_name_here>_changed?
|
75
|
+
# end
|
76
|
+
# }
|
77
|
+
#
|
78
|
+
# FriendlyId uses Rails's `parameterize` method to generate slugs, but for
|
79
|
+
# languages that don't use the Roman alphabet, that's not usually sufficient.
|
80
|
+
# Here we use the Babosa library to transliterate Russian Cyrillic slugs to
|
81
|
+
# ASCII. If you use this, don't forget to add "babosa" to your Gemfile.
|
82
|
+
#
|
83
|
+
# config.use Module.new {
|
84
|
+
# def normalize_friendly_id(text)
|
85
|
+
# text.to_slug.normalize! :transliterations => [:russian, :latin]
|
86
|
+
# end
|
87
|
+
# }
|
88
|
+
end
|
@@ -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: a4d81d7b4762fd6bd160c031e574a62fd3c276d471c03e539e644524bd41e67e9e9ec0772240eadac543f12e42f2e2a84922c003cd4e9ec3642fd2e33945f818
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 497c2202f218142bc9e3035ea548f728686f5cb651bb5888664df907ff56bbbbde0cfe4459caf63a0b4139de72cbbce291d4a856857549fd0443671af02521fc
|
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,15 @@
|
|
1
|
+
class CreateFriendlyIdSlugs < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :friendly_id_slugs do |t|
|
4
|
+
t.string :slug, :null => false
|
5
|
+
t.integer :sluggable_id, :null => false
|
6
|
+
t.string :sluggable_type, :limit => 50
|
7
|
+
t.string :scope
|
8
|
+
t.datetime :created_at
|
9
|
+
end
|
10
|
+
add_index :friendly_id_slugs, :sluggable_id
|
11
|
+
add_index :friendly_id_slugs, [:slug, :sluggable_type]
|
12
|
+
add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], :unique => true
|
13
|
+
add_index :friendly_id_slugs, :sluggable_type
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,93 @@
|
|
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: 20150221025001) do
|
15
|
+
|
16
|
+
create_table "friendly_id_slugs", force: :cascade do |t|
|
17
|
+
t.string "slug", null: false
|
18
|
+
t.integer "sluggable_id", null: false
|
19
|
+
t.string "sluggable_type", limit: 50
|
20
|
+
t.string "scope"
|
21
|
+
t.datetime "created_at"
|
22
|
+
end
|
23
|
+
|
24
|
+
add_index "friendly_id_slugs", ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
|
25
|
+
add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
|
26
|
+
add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
|
27
|
+
add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
|
28
|
+
|
29
|
+
create_table "group_memberships", force: :cascade do |t|
|
30
|
+
t.integer "user_id"
|
31
|
+
t.integer "group_id"
|
32
|
+
t.integer "role_id"
|
33
|
+
end
|
34
|
+
|
35
|
+
create_table "groups", force: :cascade do |t|
|
36
|
+
t.string "group_name"
|
37
|
+
t.string "slug"
|
38
|
+
t.boolean "can_alter", default: true
|
39
|
+
t.boolean "can_delete", default: true
|
40
|
+
end
|
41
|
+
|
42
|
+
add_index "groups", ["slug"], name: "index_groups_on_slug"
|
43
|
+
|
44
|
+
create_table "groups_roles", force: :cascade do |t|
|
45
|
+
t.integer "group_id"
|
46
|
+
t.integer "role_id"
|
47
|
+
end
|
48
|
+
|
49
|
+
create_table "permissions", force: :cascade do |t|
|
50
|
+
t.string "permission_name"
|
51
|
+
t.string "slug"
|
52
|
+
t.boolean "can_alter", default: true
|
53
|
+
t.boolean "can_delete", default: true
|
54
|
+
t.datetime "created_at"
|
55
|
+
t.datetime "updated_at"
|
56
|
+
end
|
57
|
+
|
58
|
+
add_index "permissions", ["slug"], name: "index_permissions_on_slug"
|
59
|
+
|
60
|
+
create_table "roles", force: :cascade do |t|
|
61
|
+
t.string "role_name"
|
62
|
+
t.string "slug"
|
63
|
+
t.boolean "can_alter", default: true
|
64
|
+
t.boolean "can_delete", default: true
|
65
|
+
t.datetime "created_at"
|
66
|
+
t.datetime "updated_at"
|
67
|
+
end
|
68
|
+
|
69
|
+
add_index "roles", ["slug"], name: "index_roles_on_slug"
|
70
|
+
|
71
|
+
create_table "roles_permissions", force: :cascade do |t|
|
72
|
+
t.integer "role_id"
|
73
|
+
t.integer "permission_id"
|
74
|
+
end
|
75
|
+
|
76
|
+
create_table "users", force: :cascade do |t|
|
77
|
+
t.string "first_name"
|
78
|
+
t.string "last_name"
|
79
|
+
t.string "user_name"
|
80
|
+
t.string "email"
|
81
|
+
t.string "password"
|
82
|
+
t.string "salt"
|
83
|
+
t.string "slug"
|
84
|
+
t.string "password_reset_token"
|
85
|
+
t.datetime "password_reset_timestamp"
|
86
|
+
t.string "auth_token"
|
87
|
+
t.datetime "created_at"
|
88
|
+
t.datetime "updated_at"
|
89
|
+
end
|
90
|
+
|
91
|
+
add_index "users", ["slug"], name: "index_users_on_slug"
|
92
|
+
|
93
|
+
end
|
Binary file
|
@@ -0,0 +1,256 @@
|
|
1
|
+
[1m[36m (1.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (1.2ms)[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 CreateFriendlyIdSlugs (20150220064247)
|
6
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
7
|
+
[1m[35m (1.6ms)[0m CREATE TABLE "friendly_id_slugs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "slug" varchar NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" varchar(50), "scope" varchar, "created_at" datetime)
|
8
|
+
[1m[36m (0.3ms)[0m [1mCREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" ("sluggable_id")[0m
|
9
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
10
|
+
FROM sqlite_master
|
11
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
12
|
+
UNION ALL
|
13
|
+
SELECT sql
|
14
|
+
FROM sqlite_temp_master
|
15
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
16
|
+
|
17
|
+
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" ("slug", "sluggable_type")[0m
|
18
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
19
|
+
FROM sqlite_master
|
20
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
|
21
|
+
UNION ALL
|
22
|
+
SELECT sql
|
23
|
+
FROM sqlite_temp_master
|
24
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
|
25
|
+
|
26
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
27
|
+
FROM sqlite_master
|
28
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
29
|
+
UNION ALL
|
30
|
+
SELECT sql
|
31
|
+
FROM sqlite_temp_master
|
32
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
33
|
+
[0m
|
34
|
+
[1m[35m (0.6ms)[0m CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" ("slug", "sluggable_type", "scope")
|
35
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
36
|
+
FROM sqlite_master
|
37
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
|
38
|
+
UNION ALL
|
39
|
+
SELECT sql
|
40
|
+
FROM sqlite_temp_master
|
41
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
|
42
|
+
[0m
|
43
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
44
|
+
FROM sqlite_master
|
45
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
|
46
|
+
UNION ALL
|
47
|
+
SELECT sql
|
48
|
+
FROM sqlite_temp_master
|
49
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
|
50
|
+
|
51
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
52
|
+
FROM sqlite_master
|
53
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
54
|
+
UNION ALL
|
55
|
+
SELECT sql
|
56
|
+
FROM sqlite_temp_master
|
57
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
58
|
+
[0m
|
59
|
+
[1m[35m (0.3ms)[0m CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" ("sluggable_type")
|
60
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150220064247"]]
|
61
|
+
[1m[35m (32.5ms)[0m commit transaction
|
62
|
+
Migrating to CreateUser (20150221024005)
|
63
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
64
|
+
DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/Adam/Documents/Rails-Projects/core_models/spec/dummy/db/migrate/20150221024005_create_user.rb:14)
|
65
|
+
[1m[35m (0.5ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "user_name" varchar, "email" varchar, "password" varchar, "salt" varchar, "slug" varchar, "password_reset_token" varchar, "password_reset_timestamp" datetime, "auth_token" varchar, "created_at" datetime, "updated_at" datetime)
|
66
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_users_on_slug" ON "users" ("slug")[0m
|
67
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150221024005"]]
|
68
|
+
[1m[36m (1.2ms)[0m [1mcommit transaction[0m
|
69
|
+
Migrating to CreateRole (20150221024159)
|
70
|
+
[1m[35m (0.2ms)[0m begin transaction
|
71
|
+
DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/Adam/Documents/Rails-Projects/core_models/spec/dummy/db/migrate/20150221024159_create_role.rb:8)
|
72
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "role_name" varchar, "slug" varchar, "can_alter" boolean DEFAULT 't', "can_delete" boolean DEFAULT 't', "created_at" datetime, "updated_at" datetime) [0m
|
73
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_roles_on_slug" ON "roles" ("slug")
|
74
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150221024159"]]
|
75
|
+
[1m[35m (2.9ms)[0m commit transaction
|
76
|
+
Migrating to CreatePermission (20150221024409)
|
77
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
78
|
+
DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/Adam/Documents/Rails-Projects/core_models/spec/dummy/db/migrate/20150221024409_create_permission.rb:8)
|
79
|
+
[1m[35m (1.3ms)[0m CREATE TABLE "permissions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "permission_name" varchar, "slug" varchar, "can_alter" boolean DEFAULT 't', "can_delete" boolean DEFAULT 't', "created_at" datetime, "updated_at" datetime)
|
80
|
+
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_permissions_on_slug" ON "permissions" ("slug")[0m
|
81
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150221024409"]]
|
82
|
+
[1m[36m (2.2ms)[0m [1mcommit transaction[0m
|
83
|
+
Migrating to CreateGroup (20150221024519)
|
84
|
+
[1m[35m (0.2ms)[0m begin transaction
|
85
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "group_name" varchar, "slug" varchar, "can_alter" boolean DEFAULT 't', "can_delete" boolean DEFAULT 't') [0m
|
86
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
87
|
+
FROM sqlite_master
|
88
|
+
WHERE name='index_permissions_on_slug' AND type='index'
|
89
|
+
UNION ALL
|
90
|
+
SELECT sql
|
91
|
+
FROM sqlite_temp_master
|
92
|
+
WHERE name='index_permissions_on_slug' AND type='index'
|
93
|
+
|
94
|
+
[1m[36m (0.9ms)[0m [1mrollback transaction[0m
|
95
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
96
|
+
Migrating to CreateGroup (20150221024519)
|
97
|
+
[1m[35m (0.2ms)[0m begin transaction
|
98
|
+
[1m[36m (0.7ms)[0m [1mCREATE TABLE "groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "group_name" varchar, "slug" varchar, "can_alter" boolean DEFAULT 't', "can_delete" boolean DEFAULT 't') [0m
|
99
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
100
|
+
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_groups_on_slug" ON "groups" ("slug")[0m
|
101
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150221024519"]]
|
102
|
+
[1m[36m (1.9ms)[0m [1mcommit transaction[0m
|
103
|
+
Migrating to CreateJoinTableRolesGroups (20150221024728)
|
104
|
+
[1m[35m (0.1ms)[0m begin transaction
|
105
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
106
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
107
|
+
Migrating to CreateJoinTableRolesGroups (20150221024728)
|
108
|
+
[1m[35m (0.1ms)[0m begin transaction
|
109
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
110
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
111
|
+
Migrating to CreateJoinTableRolesGroups (20150221024728)
|
112
|
+
[1m[35m (0.1ms)[0m begin transaction
|
113
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "groups_roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "group_id" integer, "role_id" integer) [0m
|
114
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150221024728"]]
|
115
|
+
[1m[36m (1.0ms)[0m [1mcommit transaction[0m
|
116
|
+
Migrating to CreateJoinTableRolesPermissions (20150221024807)
|
117
|
+
[1m[35m (0.1ms)[0m begin transaction
|
118
|
+
[1m[36m (0.5ms)[0m [1mCREATE TABLE "roles_permissions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "role_id" integer, "permission_id" integer) [0m
|
119
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150221024807"]]
|
120
|
+
[1m[36m (1.2ms)[0m [1mcommit transaction[0m
|
121
|
+
Migrating to CreateTrippleJoinTableUserGroupRole (20150221025001)
|
122
|
+
[1m[35m (0.2ms)[0m begin transaction
|
123
|
+
[1m[36m (0.6ms)[0m [1mCREATE TABLE "group_memberships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "group_id" integer, "role_id" integer) [0m
|
124
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150221025001"]]
|
125
|
+
[1m[36m (1.1ms)[0m [1mcommit transaction[0m
|
126
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
127
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
128
|
+
FROM sqlite_master
|
129
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_type' AND type='index'
|
130
|
+
UNION ALL
|
131
|
+
SELECT sql
|
132
|
+
FROM sqlite_temp_master
|
133
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_type' AND type='index'
|
134
|
+
[0m
|
135
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
136
|
+
FROM sqlite_master
|
137
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
|
138
|
+
UNION ALL
|
139
|
+
SELECT sql
|
140
|
+
FROM sqlite_temp_master
|
141
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
|
142
|
+
|
143
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
144
|
+
FROM sqlite_master
|
145
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
|
146
|
+
UNION ALL
|
147
|
+
SELECT sql
|
148
|
+
FROM sqlite_temp_master
|
149
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
|
150
|
+
[0m
|
151
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
152
|
+
FROM sqlite_master
|
153
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
154
|
+
UNION ALL
|
155
|
+
SELECT sql
|
156
|
+
FROM sqlite_temp_master
|
157
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
158
|
+
|
159
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
160
|
+
FROM sqlite_master
|
161
|
+
WHERE name='index_groups_on_slug' AND type='index'
|
162
|
+
UNION ALL
|
163
|
+
SELECT sql
|
164
|
+
FROM sqlite_temp_master
|
165
|
+
WHERE name='index_groups_on_slug' AND type='index'
|
166
|
+
[0m
|
167
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
168
|
+
FROM sqlite_master
|
169
|
+
WHERE name='index_permissions_on_slug' AND type='index'
|
170
|
+
UNION ALL
|
171
|
+
SELECT sql
|
172
|
+
FROM sqlite_temp_master
|
173
|
+
WHERE name='index_permissions_on_slug' AND type='index'
|
174
|
+
|
175
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
176
|
+
FROM sqlite_master
|
177
|
+
WHERE name='index_roles_on_slug' AND type='index'
|
178
|
+
UNION ALL
|
179
|
+
SELECT sql
|
180
|
+
FROM sqlite_temp_master
|
181
|
+
WHERE name='index_roles_on_slug' AND type='index'
|
182
|
+
[0m
|
183
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
184
|
+
FROM sqlite_master
|
185
|
+
WHERE name='index_users_on_slug' AND type='index'
|
186
|
+
UNION ALL
|
187
|
+
SELECT sql
|
188
|
+
FROM sqlite_temp_master
|
189
|
+
WHERE name='index_users_on_slug' AND type='index'
|
190
|
+
|
191
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
192
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
193
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
194
|
+
FROM sqlite_master
|
195
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_type' AND type='index'
|
196
|
+
UNION ALL
|
197
|
+
SELECT sql
|
198
|
+
FROM sqlite_temp_master
|
199
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_type' AND type='index'
|
200
|
+
[0m
|
201
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
202
|
+
FROM sqlite_master
|
203
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
|
204
|
+
UNION ALL
|
205
|
+
SELECT sql
|
206
|
+
FROM sqlite_temp_master
|
207
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
|
208
|
+
|
209
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
210
|
+
FROM sqlite_master
|
211
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
|
212
|
+
UNION ALL
|
213
|
+
SELECT sql
|
214
|
+
FROM sqlite_temp_master
|
215
|
+
WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
|
216
|
+
[0m
|
217
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
218
|
+
FROM sqlite_master
|
219
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
220
|
+
UNION ALL
|
221
|
+
SELECT sql
|
222
|
+
FROM sqlite_temp_master
|
223
|
+
WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
|
224
|
+
|
225
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
226
|
+
FROM sqlite_master
|
227
|
+
WHERE name='index_groups_on_slug' AND type='index'
|
228
|
+
UNION ALL
|
229
|
+
SELECT sql
|
230
|
+
FROM sqlite_temp_master
|
231
|
+
WHERE name='index_groups_on_slug' AND type='index'
|
232
|
+
[0m
|
233
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
234
|
+
FROM sqlite_master
|
235
|
+
WHERE name='index_permissions_on_slug' AND type='index'
|
236
|
+
UNION ALL
|
237
|
+
SELECT sql
|
238
|
+
FROM sqlite_temp_master
|
239
|
+
WHERE name='index_permissions_on_slug' AND type='index'
|
240
|
+
|
241
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
242
|
+
FROM sqlite_master
|
243
|
+
WHERE name='index_roles_on_slug' AND type='index'
|
244
|
+
UNION ALL
|
245
|
+
SELECT sql
|
246
|
+
FROM sqlite_temp_master
|
247
|
+
WHERE name='index_roles_on_slug' AND type='index'
|
248
|
+
[0m
|
249
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
250
|
+
FROM sqlite_master
|
251
|
+
WHERE name='index_users_on_slug' AND type='index'
|
252
|
+
UNION ALL
|
253
|
+
SELECT sql
|
254
|
+
FROM sqlite_temp_master
|
255
|
+
WHERE name='index_users_on_slug' AND type='index'
|
256
|
+
|