kadmin 0.1.4 → 0.1.6
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 +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/{rails_admin → kadmin}/application.js +0 -0
- data/app/assets/stylesheets/{rails_admin → kadmin}/application.scss +0 -0
- data/app/assets/stylesheets/{rails_admin → kadmin}/finder.scss +0 -0
- data/lib/kadmin/form.rb +63 -7
- data/lib/kadmin/version.rb +1 -1
- data/test/dummy/app/models/group.rb +8 -0
- data/test/dummy/app/models/group_person.rb +6 -0
- data/test/dummy/app/models/person.rb +12 -3
- data/test/dummy/config/locales/en.yml +7 -1
- data/test/dummy/db/dummy_development.sqlite3 +0 -0
- data/test/dummy/db/dummy_test.sqlite3 +0 -0
- data/test/dummy/db/migrate/20161006114509_create_people.rb +1 -1
- data/test/dummy/db/migrate/20161006134459_create_groups.rb +11 -0
- data/test/dummy/db/migrate/20161006134746_create_group_people.rb +11 -0
- data/test/dummy/db/schema.rb +43 -0
- data/test/dummy/lib/forms/group_form.rb +28 -0
- data/test/dummy/lib/forms/person_form.rb +28 -0
- data/test/dummy/log/development.log +235 -0
- data/test/dummy/log/test.log +129 -0
- data/test/dummy/test/fixtures/group_people.yml +11 -0
- data/test/dummy/test/fixtures/groups.yml +11 -0
- data/test/dummy/test/models/{person_test.rb → group_person_test.rb} +1 -1
- data/test/dummy/test/models/{child_test.rb → group_test.rb} +1 -1
- metadata +30 -12
- data/test/dummy/app/models/relationship.rb +0 -4
- data/test/dummy/db/migrate/20161006121212_create_relationships.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb56dd82a58af0513f1751486f88ae71c8f1ccca
|
4
|
+
data.tar.gz: 185d7e43f4054b4fa0faca6c73f1aeea269088fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c9e04906af2c774c40cc1369736ac1b06a4f6faa9a1bfb5f87925b9bc109e858a08cab2b5b64ba2fed32cb58eeeaa0201b5972435f4a37e3aaae9fa7d2c95f1
|
7
|
+
data.tar.gz: 66664bea60096063a4acbb3669c6af0e4cfe15f8e9f908801eab71b37134d57de71636369a91ec57aa9882213619538b4fbb850bcf63e136221c32bd234c914a
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Kadmin
|
2
2
|
|
3
|
-
[](https://github.com/barcoo/kadmin/releases/tag/0.1.6)
|
4
4
|
|
5
5
|
Collection of utility, configuration, etc., for admin areas in different projects.
|
6
6
|
|
File without changes
|
File without changes
|
File without changes
|
data/lib/kadmin/form.rb
CHANGED
@@ -15,15 +15,16 @@ module Kadmin
|
|
15
15
|
# To use nested forms, you need to add a reader and a writer. For example,
|
16
16
|
# for a form called Person, with potentially X nested Person forms as children,
|
17
17
|
# you would have:
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
18
|
+
# @example
|
19
|
+
# class PersonForm < Form
|
20
|
+
# def children
|
21
|
+
# [@child1, @child2]
|
22
|
+
# end
|
22
23
|
#
|
23
|
-
#
|
24
|
-
#
|
24
|
+
# def children_attributes=(attributes)
|
25
|
+
# ...instantiate subforms and pass attributes...
|
26
|
+
# end
|
25
27
|
# end
|
26
|
-
# end
|
27
28
|
class Form
|
28
29
|
# Provides common validators and methods to add custom ones
|
29
30
|
include ActiveModel::Validations
|
@@ -60,5 +61,60 @@ module Kadmin
|
|
60
61
|
end
|
61
62
|
|
62
63
|
# @!endgroup
|
64
|
+
|
65
|
+
# @!group Validation
|
66
|
+
|
67
|
+
validates :model_valid?
|
68
|
+
|
69
|
+
# Validates the models and merge errors back into our own errors if they
|
70
|
+
# are invalid.
|
71
|
+
# Overload if you need to validate associations.
|
72
|
+
# @example
|
73
|
+
# class PersonForm < Form
|
74
|
+
# def model_valid?
|
75
|
+
# super
|
76
|
+
# if @model&.child&.changed? && !@model.child.valid?
|
77
|
+
# @errors.add(:base, :invalid, message: 'child model is invalid')
|
78
|
+
# end
|
79
|
+
# end
|
80
|
+
# end
|
81
|
+
def model_valid?
|
82
|
+
unless @model.valid?
|
83
|
+
@model.errors.each do |attribute, error|
|
84
|
+
@errors.add(attribute, error)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# @!endgroup
|
90
|
+
|
91
|
+
# @!group Helper methods
|
92
|
+
|
93
|
+
class << self
|
94
|
+
# Delegates the list of attributes to the model, both readers and writers.
|
95
|
+
# If the attribute value passed is a hash and not a symbol, assumes it is
|
96
|
+
# a hash of one key, whose value is an array contained :reader, :writer, or both.
|
97
|
+
# @example
|
98
|
+
# delegate_attributes :first_name, { last_name: [:reader] }
|
99
|
+
# @param [Array<Symbol, Hash<Symbol, Array<Symbol>>>] attributes list of attributes to delegate to the model
|
100
|
+
def delegate_attributes(*attributes)
|
101
|
+
delegates = attributes.reduce([]) do |acc, attribute|
|
102
|
+
case attribute
|
103
|
+
when Hash
|
104
|
+
key, value = attribute.first
|
105
|
+
acc << key if value.include?(:reader)
|
106
|
+
acc << "#{key}=" if value.include?(:writer)
|
107
|
+
when Symbol, String
|
108
|
+
acc << attribute
|
109
|
+
else
|
110
|
+
raise(ArgumentError, 'Attribute must be one of: Hash, Symbol, String')
|
111
|
+
end
|
112
|
+
|
113
|
+
delegate(*delegates, to: model)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# @!endgroup
|
63
119
|
end
|
64
120
|
end
|
data/lib/kadmin/version.rb
CHANGED
@@ -0,0 +1,8 @@
|
|
1
|
+
class Group < ActiveRecord::Base
|
2
|
+
has_many :group_people, dependent: :destroy, autosave: true
|
3
|
+
has_many :people, through: :group_people
|
4
|
+
belongs_to :owner, class_name: 'Person'
|
5
|
+
|
6
|
+
validates :name, presence: true, length: { in: 1..254 },
|
7
|
+
format: { with: /[a-zA-Z0-9\-_\s]+/, message: 'only alphanumerics, dashes, underscores, and spaces' }
|
8
|
+
end
|
@@ -1,6 +1,15 @@
|
|
1
1
|
class Person < ActiveRecord::Base
|
2
|
-
has_many :
|
2
|
+
has_many :group_people, dependent: :destroy, autosave: true
|
3
|
+
has_many :groups, through: :group_people
|
4
|
+
has_many :owned_groups, class_name: 'Group', foreign_key: 'owner_id', dependent: :nullify, autosave: true
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
+
validates :first_name, presence: true, length: { in: 2..254 }
|
7
|
+
validates :last_name, presence: true, length: { in: 2..254 }
|
8
|
+
validates :sex, presence: true, length: { is: 1 }, inclusion: { in: %w(m f o), message: 'one of m (male), f (female), or o (other)' }
|
9
|
+
validate :valid_date_of_birth?
|
10
|
+
|
11
|
+
def valid_date_of_birth?
|
12
|
+
return date_of_birth.nil? || (date_of_birth.is_a?(Date) && date_of_birth < Date.current)
|
13
|
+
end
|
14
|
+
private :valid_date_of_birth?
|
6
15
|
end
|
Binary file
|
Binary file
|
@@ -3,7 +3,7 @@ class CreatePeople < ActiveRecord::Migration
|
|
3
3
|
create_table :people do |t|
|
4
4
|
t.string :first_name
|
5
5
|
t.string :last_name
|
6
|
-
t.
|
6
|
+
t.string :sex, limit: 1 # enum: m, f, o (other)
|
7
7
|
t.date :date_of_birth
|
8
8
|
t.timestamps null: false
|
9
9
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateGroupPeople < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :group_people do |t|
|
4
|
+
t.references :group
|
5
|
+
t.references :person
|
6
|
+
t.timestamps null: false
|
7
|
+
|
8
|
+
t.index [:group_id, :person_id], unique: true, name: 'group_people_lookup'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,43 @@
|
|
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: 20161006134746) do
|
15
|
+
|
16
|
+
create_table "group_people", force: :cascade do |t|
|
17
|
+
t.integer "group_id"
|
18
|
+
t.integer "person_id"
|
19
|
+
t.datetime "created_at", null: false
|
20
|
+
t.datetime "updated_at", null: false
|
21
|
+
end
|
22
|
+
|
23
|
+
add_index "group_people", ["group_id", "person_id"], name: "group_people_lookup", unique: true
|
24
|
+
|
25
|
+
create_table "groups", force: :cascade do |t|
|
26
|
+
t.string "name"
|
27
|
+
t.integer "owner_id"
|
28
|
+
t.datetime "created_at", null: false
|
29
|
+
t.datetime "updated_at", null: false
|
30
|
+
end
|
31
|
+
|
32
|
+
add_index "groups", ["owner_id"], name: "groups_owner_lookup"
|
33
|
+
|
34
|
+
create_table "people", force: :cascade do |t|
|
35
|
+
t.string "first_name"
|
36
|
+
t.string "last_name"
|
37
|
+
t.string "sex", limit: 1
|
38
|
+
t.date "date_of_birth"
|
39
|
+
t.datetime "created_at", null: false
|
40
|
+
t.datetime "updated_at", null: false
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Forms
|
2
|
+
class GroupForm < Kadmin::Form
|
3
|
+
delegate_attributes :name, :owner_id
|
4
|
+
|
5
|
+
def initialize(*args)
|
6
|
+
super
|
7
|
+
raise(ArgumentError, 'Model given should be a group') unless @model.is_a?(Group)
|
8
|
+
end
|
9
|
+
|
10
|
+
def owner
|
11
|
+
owner = @model.owner || Person.new
|
12
|
+
return Forms::PersonForm.new(owner)
|
13
|
+
end
|
14
|
+
|
15
|
+
def owner_attributes=(attributes)
|
16
|
+
form = owner
|
17
|
+
form.assign_attributes(attributes)
|
18
|
+
end
|
19
|
+
|
20
|
+
def model_valid?
|
21
|
+
super
|
22
|
+
|
23
|
+
if @model&.owner&.changed? && !@model.owner.valid?
|
24
|
+
@errors.add(:base, :invalid, message: 'owner has invalid attributes')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Forms
|
2
|
+
class PersonForm < Kadmin::Form
|
3
|
+
delegate_attributes :sex, :first_name, :last_name, date_of_birth: [:reader]
|
4
|
+
|
5
|
+
validates :adult?
|
6
|
+
|
7
|
+
def initialize(*args)
|
8
|
+
super
|
9
|
+
raise(ArgumentError, 'Model given should be a person') unless @model.is_a?(Person)
|
10
|
+
end
|
11
|
+
|
12
|
+
# @param [Array<String>] value array where 0 is the year, 1 is the month, 2 is the day
|
13
|
+
def date_of_birth=(value)
|
14
|
+
year = value[0].to_i
|
15
|
+
month = value[1].to_i
|
16
|
+
day = value[2].to_i
|
17
|
+
|
18
|
+
@model.date_of_birth = Date.new(year, month, day)
|
19
|
+
end
|
20
|
+
|
21
|
+
def adult?
|
22
|
+
cutoff_date = 18.years.ago.beginning_of_day
|
23
|
+
if @model.date_of_birth > cutoff_date
|
24
|
+
@errors.add(:date_of_birth, :invalid, message: 'must be 18 years old')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -9190,3 +9190,238 @@ Processing by RailsAdmin::AuthController#login as HTML
|
|
9190
9190
|
Rendered /Users/npepinpe/work/github/offerista/RailsAdmin/app/views/rails_admin/auth/login.html.erb within layouts/rails_admin/application (0.9ms)
|
9191
9191
|
Rendered /Users/npepinpe/work/github/offerista/RailsAdmin/app/views/rails_admin/_alerts.html.erb (0.1ms)
|
9192
9192
|
Completed 200 OK in 23ms (Views: 22.9ms | ActiveRecord: 0.0ms)
|
9193
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
9194
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
9195
|
+
[1m[36m (1.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9196
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9197
|
+
Migrating to CreatePeople (20161006114509)
|
9198
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9199
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9200
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
9201
|
+
[1m[35m (1.3ms)[0m commit transaction
|
9202
|
+
Migrating to CreateRelationships (20161006121212)
|
9203
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
9204
|
+
Migrating to CreateRelationships (20161006121212)
|
9205
|
+
[1m[35m (0.1ms)[0m begin transaction
|
9206
|
+
[1m[36m (0.8ms)[0m [1mCREATE TABLE "relationships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "person_from_id" integer, "person_to_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
9207
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
9208
|
+
[1m[36m (0.5ms)[0m [1mCREATE INDEX "relationships_person_lookup" ON "relationships" ("person_from", "person_to", "name")[0m
|
9209
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
9210
|
+
[1m[36m (18.5ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
9211
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
9212
|
+
[1m[36m (1.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9213
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9214
|
+
Migrating to CreatePeople (20161006114509)
|
9215
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9216
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9217
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
9218
|
+
[1m[35m (1.1ms)[0m commit transaction
|
9219
|
+
Migrating to CreateRelationships (20161006121212)
|
9220
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9221
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "relationships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "person_from_id" integer, "person_to_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9222
|
+
[1m[36m (0.5ms)[0m [1mCREATE INDEX "relationships_person_lookup" ON "relationships" ("person_from", "person_to", "name")[0m
|
9223
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
9224
|
+
[1m[36m (1.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
9225
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
9226
|
+
[1m[36m (1.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9227
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9228
|
+
Migrating to CreatePeople (20161006114509)
|
9229
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9230
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9231
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
9232
|
+
[1m[35m (0.9ms)[0m commit transaction
|
9233
|
+
Migrating to CreatePersonRelationships (20161006121212)
|
9234
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9235
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "person_relationships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "person_from_id" integer, "person_to_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9236
|
+
[1m[36m (0.4ms)[0m [1mCREATE INDEX "relationships_person_lookup" ON "person_relationships" ("person_from", "person_to", "name")[0m
|
9237
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
9238
|
+
[1m[36m (192.8ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
9239
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
9240
|
+
[1m[36m (2.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9241
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9242
|
+
Migrating to CreatePeople (20161006114509)
|
9243
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9244
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9245
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
9246
|
+
[1m[35m (177.7ms)[0m commit transaction
|
9247
|
+
Migrating to CreatePersonRelationships (20161006121212)
|
9248
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9249
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "person_relationships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "person_from" integer, "person_to" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9250
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "relationships_person_lookup" ON "person_relationships" ("person_from", "person_to", "name")[0m
|
9251
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006121212"]]
|
9252
|
+
[1m[36m (97.2ms)[0m [1mcommit transaction[0m
|
9253
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9254
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
9255
|
+
FROM sqlite_master
|
9256
|
+
WHERE name='relationships_person_lookup' AND type='index'
|
9257
|
+
UNION ALL
|
9258
|
+
SELECT sql
|
9259
|
+
FROM sqlite_temp_master
|
9260
|
+
WHERE name='relationships_person_lookup' AND type='index'
|
9261
|
+
[0m
|
9262
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9263
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "people" ("first_name", "last_name", "date_of_birth", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["first_name", "John"], ["last_name", "Smith"], ["date_of_birth", "1960-10-06"], ["created_at", "2016-10-06 13:29:47.096073"], ["updated_at", "2016-10-06 13:29:47.096073"]]
|
9264
|
+
[1m[36m (1.2ms)[0m [1mcommit transaction[0m
|
9265
|
+
[1m[35m (0.1ms)[0m begin transaction
|
9266
|
+
[1m[36mSQL (0.4ms)[0m [1mUPDATE "people" SET "sex" = ?, "updated_at" = ? WHERE "people"."id" = ?[0m [["sex", "m"], ["updated_at", "2016-10-06 13:29:58.552750"], ["id", 1]]
|
9267
|
+
[1m[35m (1.0ms)[0m commit transaction
|
9268
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
9269
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "people" ("first_name", "last_name", "sex", "date_of_birth", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["first_name", "Tim"], ["last_name", "Smith"], ["sex", "m"], ["date_of_birth", "2003-10-06"], ["created_at", "2016-10-06 13:30:21.353051"], ["updated_at", "2016-10-06 13:30:21.353051"]]
|
9270
|
+
[1m[36m (3.1ms)[0m [1mcommit transaction[0m
|
9271
|
+
[1m[35mPersonRelationship Load (0.2ms)[0m SELECT "person_relationships".* FROM "person_relationships" WHERE "person_relationships"."person_from" = ? LIMIT 1 [["person_from", 2]]
|
9272
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9273
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
9274
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9275
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "person_relationships" ("person_from", "person_to", "name", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["person_from", 2], ["person_to", 1], ["name", "child"], ["created_at", "2016-10-06 13:31:48.422609"], ["updated_at", "2016-10-06 13:31:48.422609"]]
|
9276
|
+
[1m[36m (1.1ms)[0m [1mcommit transaction[0m
|
9277
|
+
[1m[35mPersonRelationship Load (0.2ms)[0m SELECT "person_relationships".* FROM "person_relationships" WHERE "person_relationships"."person_to" = ? [["person_to", 1]]
|
9278
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
9279
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
9280
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
9281
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" INNER JOIN "person_relationships" ON "people"."id" = "person_relationships"."person_to" WHERE "person_relationships"."person_from" = ? [["person_from", 1]]
|
9282
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
9283
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" INNER JOIN "person_relationships" ON "people"."id" = "person_relationships"."person_from" WHERE "person_relationships"."person_from" = ? [["person_from", 1]]
|
9284
|
+
[1m[36mPersonRelationship Load (0.1ms)[0m [1mSELECT "person_relationships".* FROM "person_relationships" ORDER BY "person_relationships"."id" ASC LIMIT 1[0m
|
9285
|
+
[1m[36mPersonRelationship Load (0.1ms)[0m [1mSELECT "person_relationships".* FROM "person_relationships" ORDER BY "person_relationships"."id" ASC LIMIT 1[0m
|
9286
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
|
9287
|
+
[1m[36mPerson Load (0.2ms)[0m [1mSELECT "people".* FROM "people" INNER JOIN "person_relationships" ON "people"."id" = "person_relationships"."person_to" WHERE "person_relationships"."person_from" = ?[0m [["person_from", 1]]
|
9288
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
9289
|
+
[1m[36m (1.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
9290
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
9291
|
+
[1m[36m (1.6ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9292
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9293
|
+
Migrating to CreatePeople (20161006114509)
|
9294
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9295
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9296
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
9297
|
+
[1m[35m (1.0ms)[0m commit transaction
|
9298
|
+
Migrating to CreateGroups (20161006134459)
|
9299
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9300
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "owner_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9301
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "groups_owner_lookup" ON "groups" ("owner_id")[0m
|
9302
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006134459"]]
|
9303
|
+
[1m[36m (1.0ms)[0m [1mcommit transaction[0m
|
9304
|
+
Migrating to CreateGroupPeople (20161006134746)
|
9305
|
+
[1m[35m (0.0ms)[0m begin transaction
|
9306
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "group_people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "groups_id" integer, "people_id" integer, "join_date" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
9307
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006134746"]]
|
9308
|
+
[1m[36m (1.1ms)[0m [1mcommit transaction[0m
|
9309
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9310
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
9311
|
+
FROM sqlite_master
|
9312
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
9313
|
+
UNION ALL
|
9314
|
+
SELECT sql
|
9315
|
+
FROM sqlite_temp_master
|
9316
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
9317
|
+
[0m
|
9318
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9319
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "people" ("first_name", "last_name", "sex", "date_of_birth", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["first_name", "John"], ["last_name", "Smith"], ["sex", "m"], ["date_of_birth", "1960-10-06"], ["created_at", "2016-10-06 13:50:39.444546"], ["updated_at", "2016-10-06 13:50:39.444546"]]
|
9320
|
+
[1m[36m (1.0ms)[0m [1mcommit transaction[0m
|
9321
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
9322
|
+
[1m[35m (0.1ms)[0m begin transaction
|
9323
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "groups" ("name", "owner_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "The Smiths"], ["owner_id", 1], ["created_at", "2016-10-06 13:52:31.965101"], ["updated_at", "2016-10-06 13:52:31.965101"]]
|
9324
|
+
[1m[35m (1.3ms)[0m commit transaction
|
9325
|
+
[1m[36mGroup Load (0.2ms)[0m [1mSELECT "groups".* FROM "groups" WHERE "groups"."owner_id" = ?[0m [["owner_id", 1]]
|
9326
|
+
[1m[35mGroup Load (0.5ms)[0m SELECT "groups".* FROM "groups" INNER JOIN "group_people" ON "groups"."id" = "group_people"."group_id" WHERE "group_people"."person_id" = ? [[nil, 1]]
|
9327
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9328
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
9329
|
+
[1m[36m (1.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
9330
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
9331
|
+
[1m[36m (1.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9332
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9333
|
+
Migrating to CreatePeople (20161006114509)
|
9334
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9335
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9336
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
9337
|
+
[1m[35m (1.1ms)[0m commit transaction
|
9338
|
+
Migrating to CreateGroups (20161006134459)
|
9339
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9340
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "owner_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9341
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "groups_owner_lookup" ON "groups" ("owner_id")[0m
|
9342
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006134459"]]
|
9343
|
+
[1m[36m (1.1ms)[0m [1mcommit transaction[0m
|
9344
|
+
Migrating to CreateGroupPeople (20161006134746)
|
9345
|
+
[1m[35m (0.0ms)[0m begin transaction
|
9346
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "group_people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "group_id" integer, "person_id" integer, "join_date" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
9347
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "group_people_lookup" ON "group_people" ("group_id", "person_id", "join_date")
|
9348
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006134746"]]
|
9349
|
+
[1m[35m (1.5ms)[0m commit transaction
|
9350
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
9351
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
9352
|
+
FROM sqlite_master
|
9353
|
+
WHERE name='group_people_lookup' AND type='index'
|
9354
|
+
UNION ALL
|
9355
|
+
SELECT sql
|
9356
|
+
FROM sqlite_temp_master
|
9357
|
+
WHERE name='group_people_lookup' AND type='index'
|
9358
|
+
|
9359
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
9360
|
+
FROM sqlite_master
|
9361
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
9362
|
+
UNION ALL
|
9363
|
+
SELECT sql
|
9364
|
+
FROM sqlite_temp_master
|
9365
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
9366
|
+
[0m
|
9367
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9368
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "people" ("first_name", "last_name", "sex", "date_of_birth", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["first_name", "John"], ["last_name", "Smith"], ["sex", "m"], ["date_of_birth", "1960-10-06"], ["created_at", "2016-10-06 13:54:24.199800"], ["updated_at", "2016-10-06 13:54:24.199800"]]
|
9369
|
+
[1m[36m (1.5ms)[0m [1mcommit transaction[0m
|
9370
|
+
[1m[35m (0.2ms)[0m begin transaction
|
9371
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "groups" ("name", "owner_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "The Smiths"], ["owner_id", 1], ["created_at", "2016-10-06 13:54:26.888319"], ["updated_at", "2016-10-06 13:54:26.888319"]]
|
9372
|
+
[1m[35m (1.1ms)[0m commit transaction
|
9373
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9374
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "group_people" ("group_id", "person_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["group_id", 1], ["person_id", 1], ["created_at", "2016-10-06 13:54:29.391167"], ["updated_at", "2016-10-06 13:54:29.391167"]]
|
9375
|
+
[1m[36m (1.2ms)[0m [1mcommit transaction[0m
|
9376
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" INNER JOIN "group_people" ON "people"."id" = "group_people"."person_id" WHERE "group_people"."group_id" = ? [["group_id", 1]]
|
9377
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
9378
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
9379
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9380
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9381
|
+
Migrating to CreatePeople (20161006114509)
|
9382
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9383
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9384
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
9385
|
+
[1m[35m (1.2ms)[0m commit transaction
|
9386
|
+
Migrating to CreateGroups (20161006134459)
|
9387
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9388
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "owner_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9389
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "groups_owner_lookup" ON "groups" ("owner_id")[0m
|
9390
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006134459"]]
|
9391
|
+
[1m[36m (1.5ms)[0m [1mcommit transaction[0m
|
9392
|
+
Migrating to CreateGroupPeople (20161006134746)
|
9393
|
+
[1m[35m (0.1ms)[0m begin transaction
|
9394
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "group_people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "group_id" integer, "person_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
9395
|
+
[1m[35m (0.4ms)[0m CREATE UNIQUE INDEX "group_people_lookup" ON "group_people" ("group_id", "person_id")
|
9396
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006134746"]]
|
9397
|
+
[1m[35m (1.3ms)[0m commit transaction
|
9398
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
9399
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
9400
|
+
FROM sqlite_master
|
9401
|
+
WHERE name='group_people_lookup' AND type='index'
|
9402
|
+
UNION ALL
|
9403
|
+
SELECT sql
|
9404
|
+
FROM sqlite_temp_master
|
9405
|
+
WHERE name='group_people_lookup' AND type='index'
|
9406
|
+
|
9407
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
9408
|
+
FROM sqlite_master
|
9409
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
9410
|
+
UNION ALL
|
9411
|
+
SELECT sql
|
9412
|
+
FROM sqlite_temp_master
|
9413
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
9414
|
+
[0m
|
9415
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9416
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "people" ("first_name", "last_name", "sex", "date_of_birth", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["first_name", "John"], ["last_name", "Smith"], ["sex", "m"], ["date_of_birth", "1960-10-06"], ["created_at", "2016-10-06 14:06:29.393094"], ["updated_at", "2016-10-06 14:06:29.393094"]]
|
9417
|
+
[1m[36m (1.0ms)[0m [1mcommit transaction[0m
|
9418
|
+
[1m[35m (0.0ms)[0m begin transaction
|
9419
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "groups" ("name", "owner_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "The Smiths"], ["owner_id", 1], ["created_at", "2016-10-06 14:06:32.355702"], ["updated_at", "2016-10-06 14:06:32.355702"]]
|
9420
|
+
[1m[35m (1.3ms)[0m commit transaction
|
9421
|
+
[1m[36mGroup Load (0.1ms)[0m [1mSELECT "groups".* FROM "groups" ORDER BY "groups"."id" ASC LIMIT 1[0m
|
9422
|
+
[1m[35mPerson Load (0.1ms)[0m SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
|
9423
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
9424
|
+
[1m[35mGroupPerson Exists (0.1ms)[0m SELECT 1 AS one FROM "group_people" WHERE ("group_people"."person_id" = 1 AND "group_people"."group_id" = 1) LIMIT 1
|
9425
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "group_people" ("group_id", "person_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["group_id", 1], ["person_id", 1], ["created_at", "2016-10-06 14:07:40.650822"], ["updated_at", "2016-10-06 14:07:40.650822"]]
|
9426
|
+
[1m[35m (1.1ms)[0m commit transaction
|
9427
|
+
[1m[36mPerson Load (0.2ms)[0m [1mSELECT "people".* FROM "people" INNER JOIN "group_people" ON "people"."id" = "group_people"."person_id" WHERE "group_people"."group_id" = ?[0m [["group_id", 1]]
|
@@ -0,0 +1,129 @@
|
|
1
|
+
[1m[36m (1.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[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 CreatePeople (20161006114509)
|
6
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
7
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
8
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
9
|
+
[1m[35m (1.2ms)[0m commit transaction
|
10
|
+
Migrating to CreatePersonRelationships (20161006121212)
|
11
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
12
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "person_relationships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "person_from" integer, "person_to" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
13
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "relationships_person_lookup" ON "person_relationships" ("person_from", "person_to", "name")[0m
|
14
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006121212"]]
|
15
|
+
[1m[36m (1.3ms)[0m [1mcommit transaction[0m
|
16
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
17
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
18
|
+
FROM sqlite_master
|
19
|
+
WHERE name='relationships_person_lookup' AND type='index'
|
20
|
+
UNION ALL
|
21
|
+
SELECT sql
|
22
|
+
FROM sqlite_temp_master
|
23
|
+
WHERE name='relationships_person_lookup' AND type='index'
|
24
|
+
[0m
|
25
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
26
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
27
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
28
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
29
|
+
Migrating to CreatePeople (20161006114509)
|
30
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
31
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
32
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
33
|
+
[1m[35m (1.2ms)[0m commit transaction
|
34
|
+
Migrating to CreateGroups (20161006134459)
|
35
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
36
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "owner_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
37
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "groups_owner_lookup" ON "groups" ("owner_id")[0m
|
38
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006134459"]]
|
39
|
+
[1m[36m (1.2ms)[0m [1mcommit transaction[0m
|
40
|
+
Migrating to CreateGroupPeople (20161006134746)
|
41
|
+
[1m[35m (0.0ms)[0m begin transaction
|
42
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "group_people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "groups_id" integer, "people_id" integer, "join_date" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
43
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006134746"]]
|
44
|
+
[1m[36m (1.1ms)[0m [1mcommit transaction[0m
|
45
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
46
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
47
|
+
FROM sqlite_master
|
48
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
49
|
+
UNION ALL
|
50
|
+
SELECT sql
|
51
|
+
FROM sqlite_temp_master
|
52
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
53
|
+
[0m
|
54
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
55
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
56
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
57
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
58
|
+
Migrating to CreatePeople (20161006114509)
|
59
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
60
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
61
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
62
|
+
[1m[35m (1.1ms)[0m commit transaction
|
63
|
+
Migrating to CreateGroups (20161006134459)
|
64
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
65
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "owner_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
66
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "groups_owner_lookup" ON "groups" ("owner_id")[0m
|
67
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006134459"]]
|
68
|
+
[1m[36m (1.2ms)[0m [1mcommit transaction[0m
|
69
|
+
Migrating to CreateGroupPeople (20161006134746)
|
70
|
+
[1m[35m (0.0ms)[0m begin transaction
|
71
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "group_people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "group_id" integer, "person_id" integer, "join_date" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
72
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "group_people_lookup" ON "group_people" ("group_id", "person_id", "join_date")
|
73
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006134746"]]
|
74
|
+
[1m[35m (1.1ms)[0m commit transaction
|
75
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
76
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
77
|
+
FROM sqlite_master
|
78
|
+
WHERE name='group_people_lookup' AND type='index'
|
79
|
+
UNION ALL
|
80
|
+
SELECT sql
|
81
|
+
FROM sqlite_temp_master
|
82
|
+
WHERE name='group_people_lookup' AND type='index'
|
83
|
+
|
84
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
85
|
+
FROM sqlite_master
|
86
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
87
|
+
UNION ALL
|
88
|
+
SELECT sql
|
89
|
+
FROM sqlite_temp_master
|
90
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
91
|
+
[0m
|
92
|
+
[1m[36m (1.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
93
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
94
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
95
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
96
|
+
Migrating to CreatePeople (20161006114509)
|
97
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
98
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "sex" varchar(1), "date_of_birth" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
99
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006114509"]]
|
100
|
+
[1m[35m (1.2ms)[0m commit transaction
|
101
|
+
Migrating to CreateGroups (20161006134459)
|
102
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
103
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "owner_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
104
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "groups_owner_lookup" ON "groups" ("owner_id")[0m
|
105
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20161006134459"]]
|
106
|
+
[1m[36m (1.0ms)[0m [1mcommit transaction[0m
|
107
|
+
Migrating to CreateGroupPeople (20161006134746)
|
108
|
+
[1m[35m (0.0ms)[0m begin transaction
|
109
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "group_people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "group_id" integer, "person_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
110
|
+
[1m[35m (0.3ms)[0m CREATE UNIQUE INDEX "group_people_lookup" ON "group_people" ("group_id", "person_id")
|
111
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161006134746"]]
|
112
|
+
[1m[35m (1.7ms)[0m commit transaction
|
113
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
114
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
115
|
+
FROM sqlite_master
|
116
|
+
WHERE name='group_people_lookup' AND type='index'
|
117
|
+
UNION ALL
|
118
|
+
SELECT sql
|
119
|
+
FROM sqlite_temp_master
|
120
|
+
WHERE name='group_people_lookup' AND type='index'
|
121
|
+
|
122
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
123
|
+
FROM sqlite_master
|
124
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
125
|
+
UNION ALL
|
126
|
+
SELECT sql
|
127
|
+
FROM sqlite_temp_master
|
128
|
+
WHERE name='groups_owner_lookup' AND type='index'
|
129
|
+
[0m
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
|
+
|
3
|
+
# This model initially had no columns defined. If you add columns to the
|
4
|
+
# model remove the '{}' from the fixture names and add the columns immediately
|
5
|
+
# below each fixture, per the syntax in the comments below
|
6
|
+
#
|
7
|
+
one: {}
|
8
|
+
# column: value
|
9
|
+
#
|
10
|
+
two: {}
|
11
|
+
# column: value
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
|
+
|
3
|
+
# This model initially had no columns defined. If you add columns to the
|
4
|
+
# model remove the '{}' from the fixture names and add the columns immediately
|
5
|
+
# below each fixture, per the syntax in the comments below
|
6
|
+
#
|
7
|
+
one: {}
|
8
|
+
# column: value
|
9
|
+
#
|
10
|
+
two: {}
|
11
|
+
# column: value
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kadmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Pepin-Perreault
|
@@ -109,9 +109,9 @@ extra_rdoc_files: []
|
|
109
109
|
files:
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
|
-
- app/assets/javascripts/
|
113
|
-
- app/assets/stylesheets/
|
114
|
-
- app/assets/stylesheets/
|
112
|
+
- app/assets/javascripts/kadmin/application.js
|
113
|
+
- app/assets/stylesheets/kadmin/application.scss
|
114
|
+
- app/assets/stylesheets/kadmin/finder.scss
|
115
115
|
- app/controllers/kadmin/application_controller.rb
|
116
116
|
- app/controllers/kadmin/auth_controller.rb
|
117
117
|
- app/controllers/kadmin/concerns/authorized_user.rb
|
@@ -153,8 +153,9 @@ files:
|
|
153
153
|
- test/dummy/app/controllers/application_controller.rb
|
154
154
|
- test/dummy/app/controllers/authorized_controller.rb
|
155
155
|
- test/dummy/app/helpers/application_helper.rb
|
156
|
+
- test/dummy/app/models/group.rb
|
157
|
+
- test/dummy/app/models/group_person.rb
|
156
158
|
- test/dummy/app/models/person.rb
|
157
|
-
- test/dummy/app/models/relationship.rb
|
158
159
|
- test/dummy/app/views/admin/index.html.erb
|
159
160
|
- test/dummy/app/views/authorized/index.html.erb
|
160
161
|
- test/dummy/app/views/layouts/application.html.erb
|
@@ -183,17 +184,25 @@ files:
|
|
183
184
|
- test/dummy/config/routes.rb
|
184
185
|
- test/dummy/config/secrets.yml
|
185
186
|
- test/dummy/db/dummy_development.sqlite3
|
187
|
+
- test/dummy/db/dummy_test.sqlite3
|
186
188
|
- test/dummy/db/migrate/20161006114509_create_people.rb
|
187
|
-
- test/dummy/db/migrate/
|
189
|
+
- test/dummy/db/migrate/20161006134459_create_groups.rb
|
190
|
+
- test/dummy/db/migrate/20161006134746_create_group_people.rb
|
191
|
+
- test/dummy/db/schema.rb
|
192
|
+
- test/dummy/lib/forms/group_form.rb
|
193
|
+
- test/dummy/lib/forms/person_form.rb
|
188
194
|
- test/dummy/log/development.log
|
195
|
+
- test/dummy/log/test.log
|
189
196
|
- test/dummy/public/404.html
|
190
197
|
- test/dummy/public/422.html
|
191
198
|
- test/dummy/public/500.html
|
192
199
|
- test/dummy/public/favicon.ico
|
193
200
|
- test/dummy/test/fixtures/children.yml
|
201
|
+
- test/dummy/test/fixtures/group_people.yml
|
202
|
+
- test/dummy/test/fixtures/groups.yml
|
194
203
|
- test/dummy/test/fixtures/people.yml
|
195
|
-
- test/dummy/test/models/
|
196
|
-
- test/dummy/test/models/
|
204
|
+
- test/dummy/test/models/group_person_test.rb
|
205
|
+
- test/dummy/test/models/group_test.rb
|
197
206
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/-E/-E7l5lmqv4YBdAJz55GQp5nq67ZkFAo6Bi5OjNk5wH0.cache
|
198
207
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/-G/-GztuOFiffIyLHRd9L2OrRr8LvduErePFmti2KiEWnM.cache
|
199
208
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/-K/-Ki0cNlcEH7alAxkgEojJTity_R8pKPW8lod9PdmQp4.cache
|
@@ -487,8 +496,9 @@ test_files:
|
|
487
496
|
- test/dummy/app/controllers/application_controller.rb
|
488
497
|
- test/dummy/app/controllers/authorized_controller.rb
|
489
498
|
- test/dummy/app/helpers/application_helper.rb
|
499
|
+
- test/dummy/app/models/group.rb
|
500
|
+
- test/dummy/app/models/group_person.rb
|
490
501
|
- test/dummy/app/models/person.rb
|
491
|
-
- test/dummy/app/models/relationship.rb
|
492
502
|
- test/dummy/app/views/admin/index.html.erb
|
493
503
|
- test/dummy/app/views/authorized/index.html.erb
|
494
504
|
- test/dummy/app/views/layouts/application.html.erb
|
@@ -517,9 +527,15 @@ test_files:
|
|
517
527
|
- test/dummy/config/secrets.yml
|
518
528
|
- test/dummy/config.ru
|
519
529
|
- test/dummy/db/dummy_development.sqlite3
|
530
|
+
- test/dummy/db/dummy_test.sqlite3
|
520
531
|
- test/dummy/db/migrate/20161006114509_create_people.rb
|
521
|
-
- test/dummy/db/migrate/
|
532
|
+
- test/dummy/db/migrate/20161006134459_create_groups.rb
|
533
|
+
- test/dummy/db/migrate/20161006134746_create_group_people.rb
|
534
|
+
- test/dummy/db/schema.rb
|
535
|
+
- test/dummy/lib/forms/group_form.rb
|
536
|
+
- test/dummy/lib/forms/person_form.rb
|
522
537
|
- test/dummy/log/development.log
|
538
|
+
- test/dummy/log/test.log
|
523
539
|
- test/dummy/public/404.html
|
524
540
|
- test/dummy/public/422.html
|
525
541
|
- test/dummy/public/500.html
|
@@ -527,9 +543,11 @@ test_files:
|
|
527
543
|
- test/dummy/Rakefile
|
528
544
|
- test/dummy/README.rdoc
|
529
545
|
- test/dummy/test/fixtures/children.yml
|
546
|
+
- test/dummy/test/fixtures/group_people.yml
|
547
|
+
- test/dummy/test/fixtures/groups.yml
|
530
548
|
- test/dummy/test/fixtures/people.yml
|
531
|
-
- test/dummy/test/models/
|
532
|
-
- test/dummy/test/models/
|
549
|
+
- test/dummy/test/models/group_person_test.rb
|
550
|
+
- test/dummy/test/models/group_test.rb
|
533
551
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/-_/-_GyWOMxsUj1Vcwf_522X6jS5CyLaFUziq4bW17lZAw.cache
|
534
552
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/-E/-E7l5lmqv4YBdAJz55GQp5nq67ZkFAo6Bi5OjNk5wH0.cache
|
535
553
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/-G/-GztuOFiffIyLHRd9L2OrRr8LvduErePFmti2KiEWnM.cache
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class CreateJobs < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :relationships do |t|
|
4
|
-
t.string :name
|
5
|
-
t.references :person_from
|
6
|
-
t.references :person_to
|
7
|
-
t.timestamps null: false
|
8
|
-
|
9
|
-
t.index [:person_from, :person_to, :name], name: 'relationships_person_lookup'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|