has_moderated 1.0.alpha2 → 1.0.beta
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.
- data/README.rdoc +36 -13
- data/lib/has_moderated/associations/base.rb +4 -4
- data/lib/has_moderated/associations/collection.rb +0 -1
- data/lib/has_moderated/carrier_wave.rb +69 -46
- data/lib/has_moderated/moderated_create.rb +1 -1
- data/lib/has_moderated/moderation_model.rb +7 -3
- data/lib/has_moderated/version.rb +1 -1
- data/lib/has_moderated.rb +2 -1
- data/test/dummy/Guardfile +0 -1
- data/test/dummy/app/models/photo.rb +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20120520215008_initial_schema.rb +48 -0
- data/test/dummy/db/migrate/20120520215224_create_photos.rb +13 -0
- data/test/dummy/db/schema.rb +11 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +56 -0
- data/test/dummy/log/test.log +8211 -0
- data/test/dummy/public/uploads/{task_photo/photo → photo/avatar}/1/test.jpg +0 -0
- data/test/dummy/public/uploads/{task_photo/photo → photo/avatar}/1/thumb_test.jpg +0 -0
- data/test/dummy/spec/models/photo_spec.rb +95 -0
- data/test/dummy/spec/models/task_spec.rb +74 -4
- data/test/dummy/spec/support/photos.rb +6 -2
- metadata +15 -79
- data/lib/has_moderated/associations/has_many.rb +0 -15
- data/test/dummy/db/migrate/20110901013205_create_tasks.rb +0 -10
- data/test/dummy/db/migrate/20110901013228_create_subtasks.rb +0 -11
- data/test/dummy/db/migrate/20110901013618_create_moderations.rb +0 -15
- data/test/dummy/db/migrate/20110908025410_create_task_alls.rb +0 -10
- data/test/dummy/db/migrate/20110908025606_add_task_all_id_to_subtasks.rb +0 -5
- data/test/dummy/db/migrate/20111003205633_create_photos.rb +0 -9
- data/test/dummy/db/migrate/20111003234101_create_task_photos.rb +0 -10
- data/test/dummy/db/migrate/20111004153147_create_hook_tests.rb +0 -10
- data/test/dummy/db/migrate/20111004164509_create_photo_holders.rb +0 -10
- data/test/dummy/db/migrate/20111008195728_create_hone_tests.rb +0 -9
- data/test/dummy/db/migrate/20111008195809_create_hjoin_tests.rb +0 -13
- data/test/dummy/db/migrate/20111009193145_fix_join_table.rb +0 -8
- data/test/dummy/db/migrate/20111009201729_add_title_to_hone_tests.rb +0 -5
- data/test/dummy/db/migrate/20111009205517_create_hmanythrough_tests.rb +0 -9
- data/test/dummy/db/migrate/20111009205545_create_hmanythrough_joins.rb +0 -11
- data/test/dummy/db/migrate/20111018172409_create_hone_as_tests.rb +0 -11
- data/test/dummy/db/migrate/20111018174319_create_hmany_fk_tests.rb +0 -10
- data/test/dummy/db/migrate/20111018180207_create_habtm_name_tests.rb +0 -13
- data/test/dummy/db/migrate/20120209045206_create_photo_relateds.rb +0 -10
- data/test/dummy/db/migrate/20120515155730_create_moderations2.rb +0 -20
- data/test/dummy/db/migrate/20120515174306_prepare_for_new_tests.rb +0 -36
- data/test/dummy/db/migrate/20120515175621_remove_photo_relateds.rb +0 -8
- data/test/dummy/spec/factories/habtm_name_tests.rb +0 -7
- data/test/dummy/spec/factories/hjoin_tests.rb +0 -7
- data/test/dummy/spec/factories/hmany_fk_tests.rb +0 -8
- data/test/dummy/spec/factories/hmanythrough_joins.rb +0 -9
- data/test/dummy/spec/factories/hmanythrough_tests.rb +0 -7
- data/test/dummy/spec/factories/hone_as_tests.rb +0 -9
- data/test/dummy/spec/factories/hone_tests.rb +0 -7
- data/test/dummy/spec/factories/hook_tests.rb +0 -8
- data/test/dummy/spec/factories/photo_holders.rb +0 -7
- data/test/dummy/spec/factories/photo_relateds.rb +0 -8
- data/test/dummy/spec/factories/photos.rb +0 -7
- data/test/dummy/spec/factories/task_alls.rb +0 -8
- data/test/dummy/spec/factories/task_photos.rb +0 -7
data/README.rdoc
CHANGED
@@ -88,9 +88,13 @@ You can also see moderations for a specific record. For example, if you have Pos
|
|
88
88
|
post = Post.first
|
89
89
|
post.moderations
|
90
90
|
|
91
|
-
Moderation is a normal ActiveRecord model, you can inspect it in rails console to see what it holds. Data is serialized in YAML format
|
91
|
+
Moderation is a normal ActiveRecord model, you can inspect it in rails console to see what it holds. Data is serialized in YAML format
|
92
92
|
|
93
|
-
|
93
|
+
moderation.data
|
94
|
+
|
95
|
+
The data can be deserialized using YAML::load, but this has already been done for you
|
96
|
+
|
97
|
+
moderation.parsed_data
|
94
98
|
|
95
99
|
To accept a moderation, call
|
96
100
|
|
@@ -139,24 +143,48 @@ This is just one example how you can do it. You need the attr_accessor here beca
|
|
139
143
|
|
140
144
|
== CarrierWave support
|
141
145
|
|
142
|
-
There is support for CarrierWave uploads to be moderated.
|
146
|
+
There is support for CarrierWave uploads to be moderated. If you need some more customization look at this module in lib/has_moderated/carrier_wave.rb and make your own version.
|
147
|
+
|
148
|
+
=== Example of moderating uploads
|
149
|
+
|
150
|
+
This will moderate the upload no matter if the record is being created, or updated. Other unmoderated fields will be saved normally.
|
143
151
|
|
152
|
+
mount_uploader :avatar, GenericUploader
|
144
153
|
include HasModerated::CarrierWave
|
154
|
+
has_moderated_carrierwave_field :avatar
|
155
|
+
has_moderated :avatar
|
145
156
|
|
146
|
-
|
157
|
+
=== Example of moderating create of the whole model using a CarrierWave uploader
|
147
158
|
|
148
|
-
|
149
|
-
If you want to moderate changes to the photo on this model itself (e.g. not only when its associated to something else), add also
|
159
|
+
This will moderate creating the whole record (all its fields), including the upload.
|
150
160
|
|
151
|
-
|
161
|
+
mount_uploader :avatar, GenericUploader
|
162
|
+
has_moderated_create
|
163
|
+
include HasModerated::CarrierWave
|
164
|
+
has_moderated_carrierwave_field :avatar
|
165
|
+
|
166
|
+
To moderate later changes to the upload (avatar), additionally add
|
152
167
|
|
153
|
-
|
168
|
+
has_moderated :avatar
|
169
|
+
|
170
|
+
=== Example of moderating on association
|
171
|
+
|
172
|
+
If you are moderating some other model, and the model with the upload is an association to it, you still need to add this
|
173
|
+
|
174
|
+
mount_uploader :avatar, GenericUploader
|
175
|
+
include HasModerated::CarrierWave
|
176
|
+
has_moderated_carrierwave_field :avatar
|
177
|
+
|
178
|
+
This will only moderate the upload when it's being saved through an association which has
|
179
|
+
|
180
|
+
has_moderated_association :photos
|
154
181
|
|
155
182
|
== Tests
|
156
183
|
|
157
184
|
I've tested this project using RSpec. You can find the tests in
|
158
185
|
|
159
186
|
test/dummy/spec/models/task_spec.rb
|
187
|
+
test/dummy/spec/models/photo_spec.rb
|
160
188
|
|
161
189
|
You can run the tests by running
|
162
190
|
|
@@ -187,11 +215,6 @@ to make it possible to support other than activerecord, use activemodel when its
|
|
187
215
|
|
188
216
|
use YARD for docs
|
189
217
|
check again railscasts episodes for gems (e.g. railties)
|
190
|
-
-
|
191
|
-
|
192
|
-
make hasone, hasmany etc. each a separate "extension" (like carrierwave). for tests just use 2 models (task, subtask) and dont define has_many in model but in test
|
193
|
-
|
194
|
-
Amend moderations... Eg if you create a new record and save it, then change something additionally and save again.
|
195
218
|
Preview method which gives changed object but doesnt save it.
|
196
219
|
|
197
220
|
== License
|
@@ -30,14 +30,14 @@ module HasModerated
|
|
30
30
|
assoc_names.map{ |name| self.reflections[name] }.each do |assoc|
|
31
31
|
case assoc.macro
|
32
32
|
when :has_many then
|
33
|
-
self.send :extend, HasModerated::Associations::
|
34
|
-
|
33
|
+
self.send :extend, HasModerated::Associations::Collection::ClassMethods
|
34
|
+
has_moderated_collection_association(assoc)
|
35
35
|
when :has_one then
|
36
36
|
self.send :extend, HasModerated::Associations::HasOne::ClassMethods
|
37
37
|
has_moderated_has_one_association(assoc)
|
38
38
|
when :has_and_belongs_to_many then
|
39
|
-
|
40
|
-
|
39
|
+
self.send :extend, HasModerated::Associations::Collection::ClassMethods
|
40
|
+
has_moderated_collection_association(assoc)
|
41
41
|
else raise "don't know how to moderate association macro #{assoc.macro}"
|
42
42
|
end
|
43
43
|
end
|
@@ -79,7 +79,6 @@ module HasModerated
|
|
79
79
|
def self.add_assoc_to_record_hm(to, record, reflection)
|
80
80
|
fk = HasModerated::Adapters::ActiveRecord::foreign_key(reflection).try(:to_s)
|
81
81
|
field = if !reflection.options[:as].blank?
|
82
|
-
# todo: extract
|
83
82
|
reflection.options[:as].to_s
|
84
83
|
elsif !fk.blank?
|
85
84
|
all_keys = []
|
@@ -4,10 +4,6 @@ module HasModerated
|
|
4
4
|
|
5
5
|
def self.included(base)
|
6
6
|
base.send :extend, ClassMethods
|
7
|
-
base.send :include, InstanceMethods
|
8
|
-
|
9
|
-
base.alias_method_chain :store_photo!, :moderation
|
10
|
-
base.alias_method_chain :write_photo_identifier, :moderation
|
11
7
|
end
|
12
8
|
|
13
9
|
def self.photo_tmp_delete(value)
|
@@ -29,57 +25,84 @@ module HasModerated
|
|
29
25
|
end
|
30
26
|
|
31
27
|
module ClassMethods
|
28
|
+
def has_moderated_carrierwave_field field_names
|
29
|
+
base = self
|
30
|
+
base.send :include, InstanceMethods
|
31
|
+
|
32
|
+
cattr_accessor :moderated_carrierwave_fields
|
33
|
+
|
34
|
+
field_names = [field_names] unless field_names.kind_of? Array
|
35
|
+
|
36
|
+
field_names.each do |field_name|
|
37
|
+
field_name = field_name.to_s
|
38
|
+
self.moderated_carrierwave_fields ||= []
|
39
|
+
self.moderated_carrierwave_fields.push(field_name)
|
40
|
+
|
41
|
+
base.send :define_method, "#{field_name}_tmp_file=" do |value|
|
42
|
+
self.send("#{field_name}=", File.open(value))
|
43
|
+
HasModerated::CarrierWave::photo_tmp_delete(value)
|
44
|
+
end
|
45
|
+
|
46
|
+
base.send :define_method, "store_#{field_name}_with_moderation!" do
|
47
|
+
is_moderated = self.class.respond_to?(:moderated_attributes) &&
|
48
|
+
self.class.moderated_attributes.include?(field_name)
|
49
|
+
if !is_moderated || self.moderation_disabled || !self.send("#{field_name}_changed?")
|
50
|
+
self.send("store_#{field_name}_without_moderation!")
|
51
|
+
else
|
52
|
+
self.create_moderation_with_hooks!({
|
53
|
+
:attributes => {
|
54
|
+
"#{field_name}_tmp_file" => self.send(field_name).file.file
|
55
|
+
}
|
56
|
+
})
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
base.send :define_method, "write_#{field_name}_identifier_with_moderation" do
|
61
|
+
is_moderated = self.class.respond_to?(:moderated_attributes) &&
|
62
|
+
self.class.moderated_attributes.include?(field_name)
|
63
|
+
if !is_moderated || self.moderation_disabled || !self.send("#{field_name}_changed?")
|
64
|
+
self.send("write_#{field_name}_identifier_without_moderation")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
base.alias_method_chain :get_moderation_attributes, :carrierwave unless base.instance_methods.include?("get_moderation_attributes_without_carrierwave")
|
69
|
+
base.alias_method_chain "store_#{field_name}!", :moderation
|
70
|
+
base.alias_method_chain "write_#{field_name}_identifier", :moderation
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
32
74
|
# use class method because we only operate on hash parameters, not with a real record
|
33
75
|
# here we can delete the photo from tmp
|
34
76
|
def moderatable_discard(moderation)
|
35
|
-
value = moderation.
|
36
|
-
|
37
|
-
|
38
|
-
value
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
77
|
+
value = moderation.parsed_data
|
78
|
+
|
79
|
+
moderated_carrierwave_fields.each do |field_name|
|
80
|
+
if value.kind_of? Hash
|
81
|
+
if value.has_key?(:create) && value[:create].has_key?(:attributes)
|
82
|
+
value = value[:create]
|
83
|
+
end
|
84
|
+
if value.has_key?(:attributes) && value[:attributes].has_key?("#{field_name}_tmp_file")
|
85
|
+
value = value[:attributes].send("#{field_name}_tmp_file")
|
86
|
+
if value.present?
|
87
|
+
HasModerated::CarrierWave::photo_tmp_delete(value)
|
88
|
+
end
|
89
|
+
else
|
90
|
+
return # we dont want to process anything else than the above
|
91
|
+
end
|
92
|
+
end
|
45
93
|
end
|
46
94
|
end
|
47
95
|
end
|
48
96
|
|
49
97
|
module InstanceMethods
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
}) if self.photo && self.photo.file
|
57
|
-
end
|
58
|
-
|
59
|
-
def photo_tmp_file=(value)
|
60
|
-
self.photo = File.open(value)
|
61
|
-
HasModerated::CarrierWave::photo_tmp_delete(value)
|
62
|
-
end
|
63
|
-
|
64
|
-
def store_photo_with_moderation!
|
65
|
-
is_moderated = self.class.respond_to?(:moderated_attributes) &&
|
66
|
-
self.class.moderated_attributes.include?("carrierwave_photo")
|
67
|
-
if self.moderation_disabled || !is_moderated || !self.photo_changed?
|
68
|
-
store_photo_without_moderation!
|
69
|
-
else
|
70
|
-
self.moderations.create!({
|
71
|
-
:attr_name => "photo_tmp_file",
|
72
|
-
:attr_value => self.photo.file.file
|
73
|
-
})
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def write_photo_identifier_with_moderation
|
78
|
-
is_moderated = self.class.respond_to?(:moderated_attributes) &&
|
79
|
-
self.class.moderated_attributes.include?("carrierwave_photo")
|
80
|
-
if self.moderation_disabled || !is_moderated || !self.photo_changed?
|
81
|
-
write_photo_identifier_without_moderation
|
98
|
+
def get_moderation_attributes_with_carrierwave
|
99
|
+
attrs = get_moderation_attributes_without_carrierwave
|
100
|
+
self.class.moderated_carrierwave_fields.each do |field_name|
|
101
|
+
attrs = attrs.merge({
|
102
|
+
"#{field_name}_tmp_file" => self.send(field_name).file.file
|
103
|
+
}) if self.send(field_name) && self.send(field_name).file
|
82
104
|
end
|
105
|
+
attrs
|
83
106
|
end
|
84
107
|
end
|
85
108
|
end
|
@@ -26,7 +26,7 @@ module HasModerated
|
|
26
26
|
rec.send(key.to_s+"=", val) unless key.to_s == 'id'
|
27
27
|
end
|
28
28
|
rec.without_moderation { rec.save(:validate => false) }
|
29
|
-
moderation.moderatable = rec
|
29
|
+
moderation.moderatable = rec # just so associations can be applied in next line
|
30
30
|
HasModerated::Associations::Base::ApplyModeration::apply(moderation, value[:create])
|
31
31
|
end
|
32
32
|
end
|
@@ -1,10 +1,14 @@
|
|
1
1
|
module HasModerated
|
2
2
|
module ModerationModel
|
3
|
+
def parsed_data
|
4
|
+
@parsed_data ||= YAML::load(data)
|
5
|
+
end
|
6
|
+
|
3
7
|
def accept
|
4
|
-
loaded_val =
|
5
|
-
HasModerated::Associations::Base::ApplyModeration::apply(self, loaded_val)
|
6
|
-
HasModerated::ModeratedAttributes::ApplyModeration::apply(self, loaded_val)
|
8
|
+
loaded_val = parsed_data
|
7
9
|
HasModerated::ModeratedCreate::ApplyModeration::apply(self, loaded_val)
|
10
|
+
HasModerated::ModeratedAttributes::ApplyModeration::apply(self, loaded_val)
|
11
|
+
HasModerated::Associations::Base::ApplyModeration::apply(self, loaded_val)
|
8
12
|
HasModerated::ModeratedDestroy::ApplyModeration::apply(self, loaded_val)
|
9
13
|
self.destroy
|
10
14
|
end
|
data/lib/has_moderated.rb
CHANGED
@@ -7,13 +7,14 @@ require 'has_moderated/adapters/active_record'
|
|
7
7
|
require 'has_moderated/associations/base'
|
8
8
|
require 'has_moderated/associations/has_one'
|
9
9
|
require 'has_moderated/associations/collection'
|
10
|
-
require 'has_moderated/associations/has_many'
|
11
10
|
|
12
11
|
|
13
12
|
require 'has_moderated/moderated_attributes'
|
14
13
|
require 'has_moderated/moderated_create'
|
15
14
|
require 'has_moderated/moderated_destroy'
|
16
15
|
|
16
|
+
require 'has_moderated/carrier_wave'
|
17
|
+
|
17
18
|
module HasModerated
|
18
19
|
def self.included(base)
|
19
20
|
HasModerated::Common::included(base)
|
data/test/dummy/Guardfile
CHANGED
@@ -5,7 +5,6 @@ guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAIL
|
|
5
5
|
watch(%r{^config/initializers/.+\.rb$})
|
6
6
|
watch('Gemfile')
|
7
7
|
watch('Gemfile.lock')
|
8
|
-
watch('../../lib/has_moderated/associations/base.rb')
|
9
8
|
watch('spec/spec_helper.rb') { :rspec }
|
10
9
|
watch('test/test_helper.rb') { :test_unit }
|
11
10
|
watch(%r{features/support/}) { :cucumber }
|
Binary file
|
@@ -0,0 +1,48 @@
|
|
1
|
+
class InitialSchema < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table "moderations", :force => true do |t|
|
4
|
+
t.integer "moderatable_id"
|
5
|
+
t.string "moderatable_type"
|
6
|
+
t.text "data", :null => false
|
7
|
+
t.datetime "created_at", :null => false
|
8
|
+
t.datetime "updated_at", :null => false
|
9
|
+
end
|
10
|
+
|
11
|
+
create_table "subtasks", :force => true do |t|
|
12
|
+
t.integer "task_id"
|
13
|
+
t.string "title"
|
14
|
+
t.string "desc"
|
15
|
+
t.datetime "created_at"
|
16
|
+
t.datetime "updated_at"
|
17
|
+
t.integer "parentable_id"
|
18
|
+
t.string "parentable_type"
|
19
|
+
end
|
20
|
+
|
21
|
+
create_table "task_connections", :force => true do |t|
|
22
|
+
t.string "title"
|
23
|
+
t.integer "m1_id"
|
24
|
+
t.integer "m2_id"
|
25
|
+
t.datetime "created_at", :null => false
|
26
|
+
t.datetime "updated_at", :null => false
|
27
|
+
end
|
28
|
+
|
29
|
+
create_table "task_photos", :force => true do |t|
|
30
|
+
t.string "photo"
|
31
|
+
t.integer "task_id"
|
32
|
+
t.datetime "created_at"
|
33
|
+
t.datetime "updated_at"
|
34
|
+
end
|
35
|
+
|
36
|
+
create_table "tasks", :force => true do |t|
|
37
|
+
t.string "title"
|
38
|
+
t.string "desc"
|
39
|
+
t.datetime "created_at"
|
40
|
+
t.datetime "updated_at"
|
41
|
+
end
|
42
|
+
|
43
|
+
create_table "tasks_jointable", :id => false, :force => true do |t|
|
44
|
+
t.integer "m1_id"
|
45
|
+
t.integer "m2_id"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/test/dummy/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended to check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(:version =>
|
13
|
+
ActiveRecord::Schema.define(:version => 20120520215224) do
|
14
14
|
|
15
15
|
create_table "moderations", :force => true do |t|
|
16
16
|
t.integer "moderatable_id"
|
@@ -20,6 +20,16 @@ ActiveRecord::Schema.define(:version => 20120515175621) do
|
|
20
20
|
t.datetime "updated_at", :null => false
|
21
21
|
end
|
22
22
|
|
23
|
+
create_table "photos", :force => true do |t|
|
24
|
+
t.string "avatar"
|
25
|
+
t.string "picture"
|
26
|
+
t.integer "parentable_id"
|
27
|
+
t.string "parentable_type"
|
28
|
+
t.string "title"
|
29
|
+
t.datetime "created_at", :null => false
|
30
|
+
t.datetime "updated_at", :null => false
|
31
|
+
end
|
32
|
+
|
23
33
|
create_table "subtasks", :force => true do |t|
|
24
34
|
t.integer "task_id"
|
25
35
|
t.string "title"
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -7472,3 +7472,59 @@ Migrating to CreateModerations2 (20120515155730)
|
|
7472
7472
|
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7473
7473
|
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7474
7474
|
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7475
|
+
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7476
|
+
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7477
|
+
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7478
|
+
[1m[36m (0.2ms)[0m [1mselect sqlite_version(*)[0m
|
7479
|
+
[1m[35m (1.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
7480
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
7481
|
+
[1m[35m (1.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
7482
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
7483
|
+
Migrating to InitialSchema (20120520215008)
|
7484
|
+
[1m[35m (0.0ms)[0m begin transaction
|
7485
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "moderations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "moderatable_id" integer, "moderatable_type" varchar(255), "data" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
7486
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "subtasks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "task_id" integer, "title" varchar(255), "desc" varchar(255), "created_at" datetime, "updated_at" datetime, "parentable_id" integer, "parentable_type" varchar(255))
|
7487
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "task_connections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "m1_id" integer, "m2_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
7488
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "task_photos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "photo" varchar(255), "task_id" integer, "created_at" datetime, "updated_at" datetime)
|
7489
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "tasks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "desc" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
7490
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "tasks_jointable" ("m1_id" integer, "m2_id" integer)
|
7491
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20120520215008')[0m
|
7492
|
+
[1m[35m (1.6ms)[0m commit transaction
|
7493
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
7494
|
+
[1m[35m (0.1ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
7495
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("moderations")[0m
|
7496
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("subtasks")
|
7497
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("task_connections")[0m
|
7498
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("task_photos")
|
7499
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("tasks")[0m
|
7500
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("tasks_jointable")
|
7501
|
+
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7502
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
7503
|
+
Migrating to InitialSchema (20120520215008)
|
7504
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
7505
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
7506
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("moderations")
|
7507
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("subtasks")[0m
|
7508
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("task_connections")
|
7509
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("task_photos")[0m
|
7510
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("tasks")
|
7511
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("tasks_jointable")[0m
|
7512
|
+
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7513
|
+
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)
|
7514
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
7515
|
+
Migrating to InitialSchema (20120520215008)
|
7516
|
+
Migrating to CreatePhotos (20120520215224)
|
7517
|
+
[1m[35m (0.0ms)[0m select sqlite_version(*)
|
7518
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
7519
|
+
[1m[35m (0.5ms)[0m CREATE TABLE "photos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "avatar" varchar(255), "picture" varchar(255), "parentable_id" integer, "parentable_type" varchar(255), "title" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
7520
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20120520215224')[0m
|
7521
|
+
[1m[35m (2.8ms)[0m commit transaction
|
7522
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
7523
|
+
[1m[35m (0.1ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
7524
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("moderations")[0m
|
7525
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("photos")
|
7526
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("subtasks")[0m
|
7527
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("task_connections")
|
7528
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("task_photos")[0m
|
7529
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("tasks")
|
7530
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("tasks_jointable")[0m
|