pose 2.0.1 → 2.1.0

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.
@@ -32,65 +32,14 @@ module Pose
32
32
 
33
33
  # Returns all objects matching the given query.
34
34
  #
35
- # @param [String] query
35
+ # @param [String] query_string
36
36
  # @param (Class|[Array<Class>]) classes
37
37
  # @param [Hash?] options Additional options.
38
38
  #
39
39
  # @return [Hash<Class, ActiveRecord::Relation>]
40
- def search query, classes, options = {}
41
-
42
-
43
- # Get the ids of the results.
44
- class_names = Helpers.make_array(classes).map &:name
45
- result_classes_and_ids = {}
46
- Helpers.query_terms(query).each do |query_word|
47
- Helpers.search_classes_and_ids_for_word(query_word, class_names).each do |class_name, ids|
48
- Helpers.merge_search_result_word_matches result_classes_and_ids, class_name, ids
49
- end
50
- end
51
-
52
- # Load the results by id.
53
- {}.tap do |result|
54
- result_classes_and_ids.each do |class_name, ids|
55
- result_class = class_name.constantize
56
-
57
- if ids.size == 0
58
- # Handle no results.
59
- result[result_class] = []
60
-
61
- else
62
- # Here we have results.
63
-
64
- if options[:result_type] == :ids
65
- # Ids requested for result.
66
-
67
- if options[:where].blank?
68
- # No scope.
69
- result[result_class] = options[:limit] ? ids.slice(0, options[:limit]) : ids
70
- else
71
- # We have a scope.
72
- options[:where].each do |scope|
73
- query = result_class.select('id').where('id IN (?)', ids).where(scope)
74
- query = query.limit(options[:limit]) unless options[:limit].blank?
75
- query = query.to_sql
76
- result[result_class] = result_class.connection.select_values(query).map(&:to_i)
77
- end
78
- end
79
-
80
- else
81
- # Classes requested for result.
82
-
83
- result[result_class] = result_class.where(id: ids)
84
- result[result_class] = result[result_class].limit(options[:limit]) unless options[:limit].blank?
85
- unless options[:where].blank?
86
- options[:where].each do |scope|
87
- result[result_class] = result[result_class].where('id IN (?)', ids).where(scope)
88
- end
89
- end
90
- end
91
- end
92
- end
93
- end
40
+ def search query_string, classes, options = {}
41
+ search = Pose::Search.new classes, query_string, options
42
+ search.results
94
43
  end
95
44
  end
96
45
  end
data/lib/pose/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pose
2
- VERSION = "2.0.1"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -1,5 +1,7 @@
1
1
  class PosableOne < ActiveRecord::Base
2
2
  attr_accessible :text
3
3
 
4
+ belongs_to :user
5
+
4
6
  posify { text }
5
7
  end
@@ -1,5 +1,7 @@
1
1
  class PosableTwo < ActiveRecord::Base
2
2
  attr_accessible :text
3
3
 
4
+ belongs_to :user
5
+
4
6
  posify { text }
5
7
  end
@@ -0,0 +1,6 @@
1
+ class User < ActiveRecord::Base
2
+ has_many :posable_one
3
+ has_many :posable_two
4
+
5
+ attr_accessible :name
6
+ end
Binary file
@@ -3,6 +3,7 @@ class CreatePosableOne < ActiveRecord::Migration
3
3
  create_table :posable_ones do |t|
4
4
  t.string :text
5
5
  t.boolean :private
6
+ t.integer :user_id
6
7
  end
7
8
  end
8
9
  end
@@ -3,6 +3,7 @@ class CreatePosableTwo < ActiveRecord::Migration
3
3
  create_table :posable_twos do |t|
4
4
  t.string :text
5
5
  t.boolean :private
6
+ t.integer :user_id
6
7
  end
7
8
  end
8
9
  end
@@ -0,0 +1,7 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :name
5
+ end
6
+ end
7
+ end
@@ -11,22 +11,24 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20130308144915) do
14
+ ActiveRecord::Schema.define(:version => 20130708084009) do
15
15
 
16
16
  create_table "posable_ones", :force => true do |t|
17
17
  t.string "text"
18
18
  t.boolean "private"
19
+ t.integer "user_id"
19
20
  end
20
21
 
21
22
  create_table "posable_twos", :force => true do |t|
22
23
  t.string "text"
23
24
  t.boolean "private"
25
+ t.integer "user_id"
24
26
  end
25
27
 
26
28
  create_table "pose_assignments", :force => true do |t|
27
29
  t.integer "word_id", :null => false
28
30
  t.integer "posable_id", :null => false
29
- t.string "posable_type", :limit => 40, :null => false
31
+ t.string "posable_type", :limit => 60, :null => false
30
32
  end
31
33
 
32
34
  add_index "pose_assignments", ["posable_id"], :name => "index_pose_assignments_on_posable_id"
@@ -38,4 +40,8 @@ ActiveRecord::Schema.define(:version => 20130308144915) do
38
40
 
39
41
  add_index "pose_words", ["text"], :name => "index_pose_words_on_text"
40
42
 
43
+ create_table "users", :force => true do |t|
44
+ t.string "name"
45
+ end
46
+
41
47
  end
Binary file
@@ -1,216 +1,259 @@
1
- Connecting to database specified by database.yml
2
- Connecting to database specified by database.yml
3
-  (0.1ms) select sqlite_version(*)
4
-  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
5
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
7
- Migrating to InstallPose (20130308053038)
8
-  (0.0ms) begin transaction
9
-  (0.4ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "pose_word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL)
10
-  (0.1ms) CREATE INDEX "index_pose_assignments_on_pose_word_id" ON "pose_assignments" ("pose_word_id")
11
-  (0.1ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
12
-  (0.1ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL) 
13
-  (0.1ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
14
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308053038')
15
-  (0.9ms) commit transaction
16
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
17
- Connecting to database specified by database.yml
18
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
19
- Migrating to InstallPose (20130308053038)
20
-  (0.1ms) select sqlite_version(*)
21
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
22
1
  Connecting to database specified by database.yml
23
2
   (0.1ms) select sqlite_version(*)
24
3
   (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
25
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
26
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
27
- Migrating to InstallPose (20130308053038)
4
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
+  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
6
+ Migrating to CreatePosableOne (20130308054001)
28
7
   (0.0ms) begin transaction
29
-  (0.4ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "pose_word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL)
30
-  (0.1ms) CREATE INDEX "index_pose_assignments_on_pose_word_id" ON "pose_assignments" ("pose_word_id")
8
+  (0.4ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
9
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054001')
10
+  (0.7ms) commit transaction
11
+ Migrating to CreatePosableTwo (20130308054142)
12
+  (0.0ms) begin transaction
13
+  (0.2ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
14
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054142')
15
+  (0.7ms) commit transaction
16
+ Migrating to PoseInstall (20130308144915)
17
+  (0.0ms) begin transaction
18
+  (0.2ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL)
19
+  (0.1ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
31
20
   (0.1ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
32
21
   (0.1ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL) 
33
22
   (0.1ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
34
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308053038')
35
-  (1.0ms) commit transaction
23
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308144915')
24
+  (0.8ms) commit transaction
36
25
   (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
37
26
  Connecting to database specified by database.yml
38
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
39
-  (0.3ms) select sqlite_version(*)
40
-  (1.2ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "pose_word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL) 
41
-  (0.8ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
42
-  (0.9ms) CREATE INDEX "index_pose_assignments_on_pose_word_id" ON "pose_assignments" ("pose_word_id")
43
-  (0.9ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL)
44
-  (1.6ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
45
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
46
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27
+  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
28
+  (0.2ms) select sqlite_version(*)
29
+  (1.1ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean) 
30
+  (0.7ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
31
+  (0.8ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL) 
32
+  (0.7ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
33
+  (0.6ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
34
+  (0.8ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL)
35
+  (0.8ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
36
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
37
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
47
38
   (0.1ms) SELECT version FROM "schema_migrations"
48
-  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308053038')
49
- Connecting to database specified by database.yml
50
- Connecting to database specified by database.yml
51
- Connecting to database specified by database.yml
39
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308144915')
40
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054001')
41
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054142')
52
42
  Connecting to database specified by database.yml
43
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
44
+ Migrating to CreatePosableOne (20130308054001)
45
+ Migrating to CreatePosableTwo (20130308054142)
46
+ Migrating to PoseInstall (20130308144915)
47
+  (2.4ms) select sqlite_version(*)
48
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
53
49
  Connecting to database specified by database.yml
54
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
55
- Migrating to InstallPose (20130308053038)
50
+  (0.0ms) select sqlite_version(*)
51
+  (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
52
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
53
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
56
54
  Migrating to CreatePosableOne (20130308054001)
57
-  (0.0ms) select sqlite_version(*)
58
55
   (0.0ms) begin transaction
59
-  (0.5ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
56
+  (0.3ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
60
57
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054001')
61
58
   (0.8ms) commit transaction
62
59
  Migrating to CreatePosableTwo (20130308054142)
63
60
   (0.0ms) begin transaction
64
-  (0.3ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
61
+  (0.2ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
65
62
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054142')
66
63
   (0.7ms) commit transaction
67
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
68
- Connecting to database specified by database.yml
69
-  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
70
-  (0.3ms) select sqlite_version(*)
71
-  (0.9ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean) 
72
-  (0.9ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
73
-  (1.0ms) DROP TABLE "pose_assignments"
74
-  (0.9ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "pose_word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL)
75
-  (1.6ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
76
-  (0.9ms) CREATE INDEX "index_pose_assignments_on_pose_word_id" ON "pose_assignments" ("pose_word_id")
77
-  (0.9ms) DROP TABLE "pose_words"
78
-  (0.7ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL)
79
-  (0.8ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
80
-  (0.1ms) SELECT version FROM "schema_migrations"
81
-  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054142')
82
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054001')
83
- Connecting to database specified by database.yml
84
- Connecting to database specified by database.yml
85
-  (0.1ms) select sqlite_version(*)
86
-  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
87
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
88
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
89
- Migrating to InstallPose (20130308053038)
64
+ Migrating to PoseInstall (20130308144915)
90
65
   (0.0ms) begin transaction
91
-  (2.0ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL)
66
+  (0.2ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL)
92
67
   (0.1ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
93
68
   (0.1ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
94
69
   (0.1ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL) 
95
70
   (0.1ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
96
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308053038')
97
-  (1.3ms) commit transaction
71
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308144915')
72
+  (0.9ms) commit transaction
73
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
74
+ Connecting to database specified by database.yml
75
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
98
76
  Migrating to CreatePosableOne (20130308054001)
99
-  (0.0ms) begin transaction
100
-  (0.3ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
101
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054001')
102
-  (1.0ms) commit transaction
103
77
  Migrating to CreatePosableTwo (20130308054142)
78
+ Migrating to PoseInstall (20130308144915)
79
+ Migrating to CreateUsers (20130708084009)
80
+  (0.0ms) select sqlite_version(*)
104
81
   (0.0ms) begin transaction
105
-  (0.3ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
106
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054142')
107
-  (0.7ms) commit transaction
82
+  (0.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)
83
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130708084009')
84
+  (2.1ms) commit transaction
108
85
   (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
109
86
  Connecting to database specified by database.yml
110
-  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
111
-  (0.2ms) select sqlite_version(*)
112
-  (1.1ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean) 
113
-  (0.8ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
114
-  (0.9ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL) 
115
-  (0.8ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
116
-  (0.9ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
117
-  (0.9ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL)
118
-  (0.8ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
119
-  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
120
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
121
-  (0.1ms) SELECT version FROM "schema_migrations"
122
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054142')
123
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308053038')
124
-  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054001')
87
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
88
+ Migrating to CreatePosableOne (20130308054001)
89
+ Migrating to CreatePosableTwo (20130308054142)
90
+ Migrating to PoseInstall (20130308144915)
91
+ Migrating to CreateUsers (20130708084009)
92
+  (0.1ms) select sqlite_version(*)
93
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
125
94
  Connecting to database specified by database.yml
126
-  (0.1ms) select sqlite_version(*)
127
-  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
95
+  (0.0ms) select sqlite_version(*)
96
+  (3.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
128
97
   (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
129
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
130
- Migrating to InstallPose (20130308053038)
131
-  (0.0ms) begin transaction
132
-  (0.4ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL)
133
-  (0.1ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
134
-  (0.1ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
135
-  (0.1ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL) 
136
-  (0.1ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
137
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308053038')
138
-  (1.0ms) commit transaction
98
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
139
99
  Migrating to CreatePosableOne (20130308054001)
140
100
   (0.0ms) begin transaction
141
-  (0.3ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
101
+  (0.3ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
142
102
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054001')
143
103
   (0.7ms) commit transaction
144
104
  Migrating to CreatePosableTwo (20130308054142)
145
105
   (0.0ms) begin transaction
146
-  (0.3ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
106
+  (0.2ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
147
107
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054142')
148
-  (0.6ms) commit transaction
149
- Migrating to PoseInstall (20130308144915)
108
+  (0.7ms) commit transaction
109
+ Migrating to CreateUsers (20130708084009)
150
110
   (0.0ms) begin transaction
151
-  (0.0ms) rollback transaction
152
- Connecting to database specified by database.yml
153
-  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
111
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)
112
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130708084009')
113
+  (0.7ms) commit transaction
114
+ Migrating to PoseInstall (20130716235926)
115
+  (0.0ms) begin transaction
116
+  (0.2ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL)
117
+  (0.1ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
118
+  (0.1ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
119
+  (0.1ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL) 
120
+  (0.1ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
121
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130716235926')
122
+  (0.7ms) commit transaction
123
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
154
124
  Connecting to database specified by database.yml
155
-  (0.1ms) select sqlite_version(*)
156
-  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
157
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
125
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
126
+  (0.2ms) select sqlite_version(*)
127
+  (1.1ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer) 
128
+  (0.8ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
129
+  (0.9ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL) 
130
+  (0.8ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
131
+  (0.6ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
132
+  (0.8ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL)
133
+  (0.8ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
134
+  (0.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)
135
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
136
+  (0.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
137
+  (0.1ms) SELECT version FROM "schema_migrations"
138
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20130716235926')
139
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054001')
140
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054142')
141
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20130708084009')
158
142
  Connecting to database specified by database.yml
159
-  (0.1ms) select sqlite_version(*)
160
-  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
161
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
162
-  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
143
+  (0.0ms) select sqlite_version(*)
144
+  (3.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
145
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
146
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
163
147
  Migrating to CreatePosableOne (20130308054001)
164
148
   (0.0ms) begin transaction
165
-  (0.4ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
149
+  (0.3ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
166
150
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054001')
167
151
   (0.7ms) commit transaction
168
152
  Migrating to CreatePosableTwo (20130308054142)
169
153
   (0.0ms) begin transaction
170
-  (0.3ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
154
+  (0.2ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
171
155
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054142')
156
+  (0.6ms) commit transaction
157
+ Migrating to CreateUsers (20130708084009)
158
+  (0.0ms) begin transaction
159
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
160
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130708084009')
172
161
   (0.7ms) commit transaction
173
- Migrating to PoseInstall (20130308144915)
162
+ Migrating to PoseInstall (20130716235926)
174
163
   (0.0ms) begin transaction
175
-  (0.0ms) rollback transaction
164
+  (0.2ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL)
165
+  (0.1ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
166
+  (0.1ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
167
+  (0.1ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL) 
168
+  (0.1ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
169
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130716235926')
170
+  (0.8ms) commit transaction
171
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
176
172
  Connecting to database specified by database.yml
177
-  (0.1ms) select sqlite_version(*)
178
-  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
179
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
180
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
173
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
174
+  (0.2ms) select sqlite_version(*)
175
+  (2.5ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer) 
176
+  (1.0ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
177
+  (0.7ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL) 
178
+  (0.9ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
179
+  (0.8ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
180
+  (0.7ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL)
181
+  (0.6ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
182
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
183
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
184
+  (0.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
185
+  (0.1ms) SELECT version FROM "schema_migrations"
186
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130716235926')
187
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054001')
188
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054142')
189
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130708084009')
190
+ Connecting to database specified by database.yml
191
+  (0.5ms) select sqlite_version(*)
192
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
193
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
194
+ Connecting to database specified by database.yml
195
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
181
196
  Migrating to CreatePosableOne (20130308054001)
197
+  (0.0ms) select sqlite_version(*)
182
198
   (0.0ms) begin transaction
183
-  (0.4ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
199
+  (1.0ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
184
200
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054001')
185
-  (0.8ms) commit transaction
201
+  (1.9ms) commit transaction
186
202
  Migrating to CreatePosableTwo (20130308054142)
187
-  (0.0ms) begin transaction
188
-  (0.3ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
203
+  (0.1ms) begin transaction
204
+  (0.3ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
189
205
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308054142')
190
-  (1.0ms) commit transaction
206
+  (0.6ms) commit transaction
191
207
  Migrating to PoseInstall (20130308144915)
192
208
   (0.0ms) begin transaction
193
-  (0.3ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL)
209
+  (0.2ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL)
194
210
   (0.1ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
195
211
   (0.1ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
196
212
   (0.1ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL) 
197
213
   (0.1ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
198
214
   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130308144915')
199
-  (0.9ms) commit transaction
215
+  (0.7ms) commit transaction
216
+ Migrating to CreateUsers (20130708084009)
217
+  (0.0ms) begin transaction
218
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
219
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130708084009')
220
+  (0.6ms) commit transaction
200
221
   (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
201
222
  Connecting to database specified by database.yml
202
-  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
223
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
203
224
   (0.2ms) select sqlite_version(*)
204
-  (1.1ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean) 
205
-  (0.8ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean)
206
-  (0.8ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(40) NOT NULL) 
225
+  (1.1ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer) 
226
+  (0.8ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
227
+  (0.8ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL) 
228
+  (0.8ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
229
+  (0.7ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
230
+  (0.8ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL)
231
+  (0.8ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
232
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
233
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
234
+  (0.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
235
+  (0.1ms) SELECT version FROM "schema_migrations"
236
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130708084009')
237
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054001')
238
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054142')
239
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308144915')
240
+ Connecting to database specified by database.yml
241
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
242
+  (0.2ms) select sqlite_version(*)
243
+  (2.7ms) CREATE TABLE "posable_ones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer) 
244
+  (1.2ms) CREATE TABLE "posable_twos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(255), "private" boolean, "user_id" integer)
245
+  (0.6ms) CREATE TABLE "pose_assignments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "word_id" integer NOT NULL, "posable_id" integer NOT NULL, "posable_type" varchar(60) NOT NULL) 
207
246
   (0.8ms) CREATE INDEX "index_pose_assignments_on_posable_id" ON "pose_assignments" ("posable_id")
208
-  (0.9ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
247
+  (0.8ms) CREATE INDEX "index_pose_assignments_on_word_id" ON "pose_assignments" ("word_id")
209
248
   (1.0ms) CREATE TABLE "pose_words" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" varchar(80) NOT NULL)
210
-  (0.9ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
211
-  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
212
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
213
-  (0.1ms) SELECT version FROM "schema_migrations"
214
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308144915')
215
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054001')
216
-  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054142')
249
+  (0.7ms) CREATE INDEX "index_pose_words_on_text" ON "pose_words" ("text")
250
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
251
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
252
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
253
+  (0.1ms) SELECT version FROM "schema_migrations"
254
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130708084009')
255
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054001')
256
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130308054142')
257
+ Connecting to database specified by database.yml
258
+ Connecting to database specified by database.yml
259
+ Connecting to database specified by database.yml