paper_trail-audit 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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +34 -0
- data/lib/paper_trail_audit.rb +68 -0
- data/lib/paper_trail_audit/change.rb +15 -0
- data/lib/paper_trail_audit/version.rb +3 -0
- data/lib/tasks/paper_trail_audit_tasks.rake +4 -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/bank.rb +8 -0
- data/test/dummy/app/models/user.rb +2 -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.ru +4 -0
- data/test/dummy/config/application.rb +26 -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/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/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20160802221911_create_banks.rb +8 -0
- data/test/dummy/db/migrate/20160802222941_create_versions.rb +80 -0
- data/test/dummy/db/migrate/20160802235555_create_users.rb +9 -0
- data/test/dummy/db/migrate/20160802235657_add_user_id_to_banks.rb +5 -0
- data/test/dummy/db/schema.rb +40 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +116 -0
- data/test/dummy/log/test.log +3582 -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/spec/models/user_spec.rb +5 -0
- data/test/paper_trail_audit_test.rb +7 -0
- data/test/test_helper.rb +20 -0
- metadata +208 -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: 7febf0d534afd6b26244c73af6bf2ea7b72e12a1ab54f535d7a33faba3ac7a9d98f2329024c3fef8be7801eb08a309e147a30c096fe6adc39394733afa8d32e9
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 13e20fe0bc866841136f72e336d24dbf6605216bad55859201a519711d6fa74bd0c34697f198b148d37ef5cfcf3eba6b6f413987fc7073f4940532bde36bebe7
|
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,80 @@
|
|
1
|
+
# This migration creates the `versions` table, the only schema PT requires.
|
2
|
+
# All other migrations PT provides are optional.
|
3
|
+
class CreateVersions < ActiveRecord::Migration
|
4
|
+
# Class names of MySQL adapters.
|
5
|
+
# - `MysqlAdapter` - Used by gems: `mysql`, `activerecord-jdbcmysql-adapter`.
|
6
|
+
# - `Mysql2Adapter` - Used by `mysql2` gem.
|
7
|
+
MYSQL_ADAPTERS = [
|
8
|
+
"ActiveRecord::ConnectionAdapters::MysqlAdapter",
|
9
|
+
"ActiveRecord::ConnectionAdapters::Mysql2Adapter"
|
10
|
+
].freeze
|
11
|
+
|
12
|
+
# The largest text column available in all supported RDBMS is
|
13
|
+
# 1024^3 - 1 bytes, roughly one gibibyte. We specify a size
|
14
|
+
# so that MySQL will use `longtext` instead of `text`. Otherwise,
|
15
|
+
# when serializing very large objects, `text` might not be big enough.
|
16
|
+
TEXT_BYTES = 1_073_741_823
|
17
|
+
|
18
|
+
def change
|
19
|
+
create_table :versions, versions_table_options do |t|
|
20
|
+
t.string :item_type, item_type_options
|
21
|
+
t.integer :item_id, null: false
|
22
|
+
t.string :event, null: false
|
23
|
+
t.string :whodunnit
|
24
|
+
t.text :object, limit: TEXT_BYTES
|
25
|
+
|
26
|
+
# Known issue in MySQL: fractional second precision
|
27
|
+
# -------------------------------------------------
|
28
|
+
#
|
29
|
+
# MySQL timestamp columns do not support fractional seconds unless
|
30
|
+
# defined with "fractional seconds precision". MySQL users should manually
|
31
|
+
# add fractional seconds precision to this migration, specifically, to
|
32
|
+
# the `created_at` column.
|
33
|
+
# (https://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html)
|
34
|
+
#
|
35
|
+
# MySQL users should also upgrade to rails 4.2, which is the first
|
36
|
+
# version of ActiveRecord with support for fractional seconds in MySQL.
|
37
|
+
# (https://github.com/rails/rails/pull/14359)
|
38
|
+
#
|
39
|
+
t.datetime :created_at
|
40
|
+
end
|
41
|
+
add_index :versions, [:item_type, :item_id]
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
# MySQL 5.6 utf8mb4 limit is 191 chars for keys used in indexes.
|
47
|
+
# See https://github.com/airblade/paper_trail/issues/651
|
48
|
+
def item_type_options
|
49
|
+
opt = { null: false }
|
50
|
+
opt[:limit] = 191 if mysql?
|
51
|
+
opt
|
52
|
+
end
|
53
|
+
|
54
|
+
def mysql?
|
55
|
+
MYSQL_ADAPTERS.include?(connection.class.name)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Even modern versions of MySQL still use `latin1` as the default character
|
59
|
+
# encoding. Many users are not aware of this, and run into trouble when they
|
60
|
+
# try to use PaperTrail in apps that otherwise tend to use UTF-8. Postgres, by
|
61
|
+
# comparison, uses UTF-8 except in the unusual case where the OS is configured
|
62
|
+
# with a custom locale.
|
63
|
+
#
|
64
|
+
# - https://dev.mysql.com/doc/refman/5.7/en/charset-applications.html
|
65
|
+
# - http://www.postgresql.org/docs/9.4/static/multibyte.html
|
66
|
+
#
|
67
|
+
# Furthermore, MySQL's original implementation of UTF-8 was flawed, and had
|
68
|
+
# to be fixed later by introducing a new charset, `utf8mb4`.
|
69
|
+
#
|
70
|
+
# - https://mathiasbynens.be/notes/mysql-utf8mb4
|
71
|
+
# - https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html
|
72
|
+
#
|
73
|
+
def versions_table_options
|
74
|
+
if mysql?
|
75
|
+
{ options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci" }
|
76
|
+
else
|
77
|
+
{}
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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: 20160802235657) do
|
15
|
+
|
16
|
+
create_table "banks", force: :cascade do |t|
|
17
|
+
t.integer "value"
|
18
|
+
t.datetime "created_at", null: false
|
19
|
+
t.datetime "updated_at", null: false
|
20
|
+
t.integer "user_id"
|
21
|
+
end
|
22
|
+
|
23
|
+
create_table "users", force: :cascade do |t|
|
24
|
+
t.string "name"
|
25
|
+
t.datetime "created_at", null: false
|
26
|
+
t.datetime "updated_at", null: false
|
27
|
+
end
|
28
|
+
|
29
|
+
create_table "versions", force: :cascade do |t|
|
30
|
+
t.string "item_type", null: false
|
31
|
+
t.integer "item_id", null: false
|
32
|
+
t.string "event", null: false
|
33
|
+
t.string "whodunnit"
|
34
|
+
t.text "object", limit: 1073741823
|
35
|
+
t.datetime "created_at"
|
36
|
+
end
|
37
|
+
|
38
|
+
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
|
39
|
+
|
40
|
+
end
|
Binary file
|
@@ -0,0 +1,116 @@
|
|
1
|
+
[1m[36m (2.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (0.5ms)[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 CreateBanks (20160802221911)
|
6
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
7
|
+
[1m[35m (0.6ms)[0m CREATE TABLE "banks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "value" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
8
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160802221911"]]
|
9
|
+
[1m[35m (0.6ms)[0m commit transaction
|
10
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
11
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
12
|
+
Migrating to CreateVersions (20160802222941)
|
13
|
+
[1m[35m (0.1ms)[0m begin transaction
|
14
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text(1073741823), "created_at" datetime) [0m
|
15
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
16
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_versions_on_item_type_and_item_id" ON "versions" ("item_type", "item_id")[0m
|
17
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160802222941"]]
|
18
|
+
[1m[36m (2.1ms)[0m [1mcommit transaction[0m
|
19
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
20
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
21
|
+
FROM sqlite_master
|
22
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
23
|
+
UNION ALL
|
24
|
+
SELECT sql
|
25
|
+
FROM sqlite_temp_master
|
26
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
27
|
+
[0m
|
28
|
+
[1m[36mBank Load (0.1ms)[0m [1mSELECT "banks".* FROM "banks" ORDER BY "banks"."id" DESC LIMIT 1[0m
|
29
|
+
[1m[35m (0.1ms)[0m begin transaction
|
30
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "banks" ("value", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["value", 10], ["created_at", "2016-08-02 22:35:14.708058"], ["updated_at", "2016-08-02 22:35:14.708058"]]
|
31
|
+
DEPRECATION WARNING: PaperTrail.track_associations has not been set. As of PaperTrail 5, it defaults to false. Tracking associations is an experimental feature so we recommend setting PaperTrail.config.track_associations = false in your config/initializers/paper_trail.rb . (called from irb_binding at (irb):4)
|
32
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "versions" ("event", "created_at", "item_id", "item_type") VALUES (?, ?, ?, ?) [["event", "create"], ["created_at", "2016-08-02 22:35:14.708058"], ["item_id", 1], ["item_type", "Bank"]]
|
33
|
+
DEPRECATION WARNING: PaperTrail.track_associations has not been set. As of PaperTrail 5, it defaults to false. Tracking associations is an experimental feature so we recommend setting PaperTrail.config.track_associations = false in your config/initializers/paper_trail.rb . (called from irb_binding at (irb):4)
|
34
|
+
[1m[36m (2.2ms)[0m [1mcommit transaction[0m
|
35
|
+
[1m[35mBank Load (0.2ms)[0m SELECT "banks".* FROM "banks" ORDER BY "banks"."id" DESC LIMIT 1
|
36
|
+
[1m[36mBank Load (0.1ms)[0m [1mSELECT "banks".* FROM "banks" ORDER BY "banks"."id" DESC LIMIT 1[0m
|
37
|
+
[1m[35mPaperTrail::Version Load (0.1ms)[0m SELECT "versions".* FROM "versions" WHERE "versions"."item_id" = ? AND "versions"."item_type" = ? ORDER BY "versions"."created_at" ASC, "versions"."id" ASC [["item_id", 1], ["item_type", "Bank"]]
|
38
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
39
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "banks" ("value", "created_at", "updated_at") VALUES (?, ?, ?) [["value", 20], ["created_at", "2016-08-02 22:42:17.964072"], ["updated_at", "2016-08-02 22:42:17.964072"]]
|
40
|
+
DEPRECATION WARNING: PaperTrail.track_associations has not been set. As of PaperTrail 5, it defaults to false. Tracking associations is an experimental feature so we recommend setting PaperTrail.config.track_associations = false in your config/initializers/paper_trail.rb . (called from irb_binding at (irb):1)
|
41
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "versions" ("event", "created_at", "item_id", "item_type") VALUES (?, ?, ?, ?)[0m [["event", "create"], ["created_at", "2016-08-02 22:42:17.964072"], ["item_id", 2], ["item_type", "Bank"]]
|
42
|
+
DEPRECATION WARNING: PaperTrail.track_associations has not been set. As of PaperTrail 5, it defaults to false. Tracking associations is an experimental feature so we recommend setting PaperTrail.config.track_associations = false in your config/initializers/paper_trail.rb . (called from irb_binding at (irb):1)
|
43
|
+
[1m[35m (2.5ms)[0m commit transaction
|
44
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
45
|
+
Migrating to CreateUsers (20160802235555)
|
46
|
+
[1m[35m (0.1ms)[0m begin transaction
|
47
|
+
[1m[36m (0.5ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
48
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160802235555"]]
|
49
|
+
[1m[36m (2.3ms)[0m [1mcommit transaction[0m
|
50
|
+
Migrating to AddUserIdToBanks (20160802235657)
|
51
|
+
[1m[35m (0.1ms)[0m begin transaction
|
52
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
53
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
54
|
+
Migrating to AddUserIdToBanks (20160802235657)
|
55
|
+
[1m[35m (0.1ms)[0m begin transaction
|
56
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160802235657"]]
|
57
|
+
[1m[35m (2.1ms)[0m commit transaction
|
58
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
59
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
60
|
+
FROM sqlite_master
|
61
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
62
|
+
UNION ALL
|
63
|
+
SELECT sql
|
64
|
+
FROM sqlite_temp_master
|
65
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
66
|
+
|
67
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
68
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
69
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
70
|
+
FROM sqlite_master
|
71
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
72
|
+
UNION ALL
|
73
|
+
SELECT sql
|
74
|
+
FROM sqlite_temp_master
|
75
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
76
|
+
[0m
|
77
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
78
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
79
|
+
Migrating to AddUserIdToBanks (20160802235657)
|
80
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
81
|
+
[1m[35m (0.4ms)[0m CREATE TEMPORARY TABLE "abanks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "value" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
82
|
+
[1m[36m (0.0ms)[0m [1mSELECT * FROM "banks"[0m
|
83
|
+
[1m[35m (0.1ms)[0m INSERT INTO "abanks" ("id","value","created_at","updated_at") VALUES (1, 10, '2016-08-02 22:35:14.708058', '2016-08-02 22:35:14.708058')
|
84
|
+
[1m[36m (0.0ms)[0m [1mINSERT INTO "abanks" ("id","value","created_at","updated_at") VALUES (2, 20, '2016-08-02 22:42:17.964072', '2016-08-02 22:42:17.964072')[0m
|
85
|
+
[1m[35m (0.3ms)[0m DROP TABLE "banks"
|
86
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "banks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "value" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
87
|
+
[1m[35m (0.0ms)[0m SELECT * FROM "abanks"
|
88
|
+
[1m[36m (0.0ms)[0m [1mINSERT INTO "banks" ("id","value","created_at","updated_at") VALUES (1, 10, '2016-08-02 22:35:14.708058', '2016-08-02 22:35:14.708058')[0m
|
89
|
+
[1m[35m (0.1ms)[0m INSERT INTO "banks" ("id","value","created_at","updated_at") VALUES (2, 20, '2016-08-02 22:42:17.964072', '2016-08-02 22:42:17.964072')
|
90
|
+
[1m[36m (0.6ms)[0m [1mDROP TABLE "abanks"[0m
|
91
|
+
[1m[35mSQL (0.4ms)[0m DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20160802235657"]]
|
92
|
+
[1m[36m (2.5ms)[0m [1mcommit transaction[0m
|
93
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
94
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
95
|
+
FROM sqlite_master
|
96
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
97
|
+
UNION ALL
|
98
|
+
SELECT sql
|
99
|
+
FROM sqlite_temp_master
|
100
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
101
|
+
[0m
|
102
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
103
|
+
Migrating to AddUserIdToBanks (20160802235657)
|
104
|
+
[1m[35m (0.1ms)[0m begin transaction
|
105
|
+
[1m[36m (0.4ms)[0m [1mALTER TABLE "banks" ADD "user_id" integer[0m
|
106
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160802235657"]]
|
107
|
+
[1m[36m (2.2ms)[0m [1mcommit transaction[0m
|
108
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
109
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
110
|
+
FROM sqlite_master
|
111
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
112
|
+
UNION ALL
|
113
|
+
SELECT sql
|
114
|
+
FROM sqlite_temp_master
|
115
|
+
WHERE name='index_versions_on_item_type_and_item_id' AND type='index'
|
116
|
+
[0m
|