spud_inquiries 0.9.1 → 0.9.2
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.markdown +16 -5
- data/app/controllers/contacts_controller.rb +23 -17
- data/app/controllers/spud/admin/inquiries_controller.rb +2 -1
- data/app/controllers/spud/admin/inquiry_forms_controller.rb +3 -5
- data/app/controllers/spud/inquiries/sitemaps_controller.rb +3 -2
- data/app/mailers/spud/inquiry_mailer.rb +3 -2
- data/app/models/spud_inquiry.rb +2 -1
- data/app/models/spud_inquiry_field.rb +1 -0
- data/app/models/spud_inquiry_form.rb +8 -6
- data/app/models/spud_inquiry_form_field.rb +2 -5
- data/app/views/contacts/_show.html.erb +7 -5
- data/app/views/contacts/_show_liquid.html.erb +34 -0
- data/app/views/contacts/show.html.erb +4 -4
- data/app/views/contacts/show.js.erb +1 -0
- data/app/views/contacts/thankyou.js.erb +1 -0
- data/app/views/spud/admin/inquiry_forms/_form.html.erb +15 -9
- data/app/views/spud/admin/inquiry_forms/_spud_inquiry_form_field_fields.html.erb +8 -2
- data/app/views/spud/admin/inquiry_forms/index.html.erb +1 -1
- data/app/views/spud/admin/inquiry_forms/new.html.erb +1 -1
- data/app/views/spud/inquiries/sitemaps/show.xml.builder +1 -1
- data/config/routes.rb +15 -21
- data/db/migrate/20120117133412_create_spud_inquiry_fields.rb +1 -1
- data/db/migrate/20120122173829_add_field_order_to_spud_inquiry_form_fields.rb +1 -1
- data/db/migrate/20120126132407_add_spud_inquiry_form_id_to_spud_inquiries.rb +2 -2
- data/db/migrate/20120127023335_add_url_name_to_spud_inquiry_forms.rb +1 -1
- data/db/migrate/20121228145215_add_thank_you_content_to_spud_inquiry_form.rb +5 -0
- data/db/migrate/20130627121030_add_placeholder_to_spud_inquiry_form_fields.rb +5 -0
- data/lib/spud_inquiries/configuration.rb +2 -1
- data/lib/spud_inquiries/engine.rb +4 -0
- data/lib/spud_inquiries/liquid_form.rb +2 -1
- data/lib/spud_inquiries/version.rb +1 -1
- data/spec/controllers/contacts_controller_spec.rb +69 -0
- data/spec/controllers/spud/admin/inquiries_controller_spec.rb +55 -0
- data/spec/controllers/spud/admin/inquiry_forms_controller_spec.rb +97 -0
- data/spec/controllers/spud/inquiries/sitemaps_controller_spec.rb +23 -0
- data/spec/dummy/config/database.yml +0 -28
- data/spec/dummy/db/schema.rb +10 -8
- data/spec/dummy/log/development.log +87 -72
- data/spec/dummy/log/test.log +1244 -0
- data/spec/models/spud_inquiry_field_spec.rb +18 -0
- data/spec/models/spud_inquiry_form_field_spec.rb +36 -0
- data/spec/models/spud_inquiry_form_spec.rb +28 -0
- data/spec/models/spud_inquiry_spec.rb +22 -0
- data/spec/spec_helper.rb +9 -0
- metadata +28 -5
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ContactsController do
|
4
|
+
before(:each) do
|
5
|
+
Spud::Core.configure do |config|
|
6
|
+
config.site_name = "Test Site"
|
7
|
+
config.multisite_mode_enabled = false
|
8
|
+
config.multisite_config = []
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe :show do
|
13
|
+
it "should return a form by url name" do
|
14
|
+
form = FactoryGirl.create(:spud_inquiry_form)
|
15
|
+
get :show, :id => form.url_name
|
16
|
+
assigns(:inquiry_form).should == form
|
17
|
+
assigns(:inquiry).should_not be_blank
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should redirect to root if inquiry not found" do
|
21
|
+
get :show, :id => 1234
|
22
|
+
response.should redirect_to "/"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe :inquire do
|
27
|
+
before(:each) do
|
28
|
+
@form = FactoryGirl.create(:spud_inquiry_form)
|
29
|
+
@field = FactoryGirl.create(:spud_inquiry_form_field,:spud_inquiry_form => @form,:name => "email",:field_type => '0', :required => true)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should fail if spam field assigned" do
|
33
|
+
post :inquire,:spud_inquiry => {:spud_inquiry_form_id => @form.id}, :other_email => "test@spamcastle.com"
|
34
|
+
flash[:error].should =~ /You must be a robot/i
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should fail if inquiry not submitted" do
|
38
|
+
post :inquire
|
39
|
+
response.should redirect_to "/"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should fail if the inquiry form is invalid" do
|
43
|
+
post :inquire,:spud_inquiry => {:spud_inquiry_form_id => @form.id + 2}
|
44
|
+
response.should redirect_to "/"
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should fail if required field is blank" do
|
48
|
+
post :inquire,:spud_inquiry => {:spud_inquiry_form_id => @form.id}
|
49
|
+
response.should be_success
|
50
|
+
response.should_not redirect_to contact_thankyou_url
|
51
|
+
end
|
52
|
+
|
53
|
+
# it "should succed if fields are valid" do
|
54
|
+
# post :inquire,:spud_inquiry => {:spud_inquiry_form_id => @form.id, "email" => "test@test.com"}
|
55
|
+
# assigns(:inquiry).should be_valid
|
56
|
+
# response.should be_success
|
57
|
+
# response.should redirect_to contact_thankyou_url
|
58
|
+
|
59
|
+
# end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
describe :thankyou do
|
64
|
+
it "should render successfully" do
|
65
|
+
get :thankyou
|
66
|
+
response.should be_success
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Spud::Admin::InquiriesController do
|
4
|
+
before(:each) do
|
5
|
+
activate_authlogic
|
6
|
+
u = SpudUser.new(:login => "testuser",:email => "test@testuser.com",:password => "test",:password_confirmation => "test")
|
7
|
+
u.super_admin = true
|
8
|
+
u.save
|
9
|
+
@user = SpudUserSession.create(u)
|
10
|
+
Spud::Core.configure do |config|
|
11
|
+
config.site_name = "Test Site"
|
12
|
+
config.multisite_mode_enabled = false
|
13
|
+
config.multisite_config = []
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe :index do
|
18
|
+
it "should return an array of menus" do
|
19
|
+
2.times {|x| s = FactoryGirl.create(:spud_inquiry)}
|
20
|
+
get :index
|
21
|
+
assigns(:inquiries).count.should be > 1
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe :show do
|
26
|
+
it "should return a preview of an inquiry" do
|
27
|
+
s = FactoryGirl.create(:spud_inquiry)
|
28
|
+
get :show, :id => s.id
|
29
|
+
assigns(:inquiry).should == s
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should redirect to index if inquiry not found" do
|
33
|
+
get :show, :id => 1234
|
34
|
+
response.should redirect_to spud_admin_inquiries_url
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe :destroy do
|
39
|
+
it "should destroy the menu" do
|
40
|
+
inquiry = FactoryGirl.create(:spud_inquiry)
|
41
|
+
lambda {
|
42
|
+
delete :destroy, :id => inquiry.id
|
43
|
+
}.should change(SpudInquiry,:count).by(-1)
|
44
|
+
response.should be_redirect
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should not destroy the menu with a wrong id" do
|
48
|
+
inquiry = FactoryGirl.create(:spud_inquiry)
|
49
|
+
lambda {
|
50
|
+
delete :destroy,:id => "23532"
|
51
|
+
}.should_not change(SpudInquiry,:count)
|
52
|
+
response.should be_redirect
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Spud::Admin::InquiryFormsController do
|
4
|
+
before(:each) do
|
5
|
+
activate_authlogic
|
6
|
+
u = SpudUser.new(:login => "testuser",:email => "test@testuser.com",:password => "test",:password_confirmation => "test")
|
7
|
+
u.super_admin = true
|
8
|
+
u.save
|
9
|
+
@user = SpudUserSession.create(u)
|
10
|
+
Spud::Core.configure do |config|
|
11
|
+
config.site_name = "Test Site"
|
12
|
+
config.multisite_mode_enabled = false
|
13
|
+
config.multisite_config = []
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe :index do
|
18
|
+
it "should return an array of menus" do
|
19
|
+
2.times {|x| s = FactoryGirl.create(:spud_inquiry_form)}
|
20
|
+
get :index
|
21
|
+
assigns(:inquiry_forms).count.should be > 1
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe :new do
|
26
|
+
it "should respond with a new form" do
|
27
|
+
get :new
|
28
|
+
assigns(:inquiry_form).should_not be_blank
|
29
|
+
response.should be_success
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe :create do
|
34
|
+
it "should create a new form with a valid form submission" do
|
35
|
+
lambda {
|
36
|
+
post :create, :spud_inquiry_form => FactoryGirl.attributes_for(:spud_inquiry_form).reject{|k,v| k == 'site_id' || k == 'id'}
|
37
|
+
}.should change(SpudInquiryForm,:count).by(1)
|
38
|
+
response.should be_redirect
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should not create a form with an invalid form entry" do
|
42
|
+
lambda {
|
43
|
+
post :create, :spud_inquiry_form => FactoryGirl.attributes_for(:spud_inquiry_form,:name => nil).reject{|k,v| k == 'site_id' || k == 'id'}
|
44
|
+
}.should_not change(SpudInquiryForm,:count)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe :edit do
|
49
|
+
it "should respond with form by id" do
|
50
|
+
form1 = FactoryGirl.create(:spud_inquiry_form)
|
51
|
+
form2 = FactoryGirl.create(:spud_inquiry_form)
|
52
|
+
get :edit,:id => form2.id
|
53
|
+
assigns(:inquiry_form).should == form2
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should redirect to index if form not found" do
|
57
|
+
get :edit,:id => 1234
|
58
|
+
response.should redirect_to spud_admin_inquiry_forms_url
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe :update do
|
63
|
+
it "should update the name when the name attribute is changed" do
|
64
|
+
form = FactoryGirl.create(:spud_inquiry_form)
|
65
|
+
new_name = 'MyForm'
|
66
|
+
lambda {
|
67
|
+
put :update,:id => form.id, :spud_inquiry_form => form.attributes.merge!(:name => new_name).reject{|k,v| k == 'site_id' || k == 'id'}
|
68
|
+
form.reload
|
69
|
+
}.should change(form,:name).to(new_name)
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should redirect to the admin forms after a successful update" do
|
74
|
+
form = FactoryGirl.create(:spud_inquiry_form)
|
75
|
+
put :update,:id => form.id,:spud_menu => form.attributes.merge!(:name => "MyMenu").reject{|k,v| k == 'site_id' || k == 'id'}
|
76
|
+
response.should redirect_to(spud_admin_inquiry_forms_url)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe :destroy do
|
81
|
+
it "should destroy the form" do
|
82
|
+
form = FactoryGirl.create(:spud_inquiry_form)
|
83
|
+
lambda {
|
84
|
+
delete :destroy, :id => form.id
|
85
|
+
}.should change(SpudInquiryForm,:count).by(-1)
|
86
|
+
response.should be_redirect
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should not destroy the form with a wrong id" do
|
90
|
+
menu = FactoryGirl.create(:spud_inquiry_form)
|
91
|
+
lambda {
|
92
|
+
delete :destroy,:id => "23532"
|
93
|
+
}.should_not change(SpudInquiryForm,:count)
|
94
|
+
response.should be_redirect
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Spud::Inquiries::SitemapsController do
|
4
|
+
describe :show do
|
5
|
+
before(:each) do
|
6
|
+
Spud::Core.configure do |config|
|
7
|
+
config.site_name = "Test Site"
|
8
|
+
config.multisite_mode_enabled = false
|
9
|
+
config.multisite_config = []
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return the sitemap urls" do
|
14
|
+
get :show, :format => :xml
|
15
|
+
assigns(:forms).should == SpudInquiryForm.all
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should only respond to an XML format" do
|
19
|
+
get :show
|
20
|
+
response.response_code.should == 406
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,37 +1,9 @@
|
|
1
|
-
# SQLite version 3.x
|
2
|
-
# gem install sqlite3
|
3
|
-
#
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
-
# gem 'sqlite3'
|
6
1
|
development:
|
7
2
|
adapter: mysql2
|
8
|
-
encoding: utf8
|
9
|
-
reconnect: true
|
10
3
|
database: spud_inquiries_development
|
11
|
-
pool: 5
|
12
4
|
username: root
|
13
|
-
password:
|
14
|
-
socket: /tmp/mysql.sock
|
15
5
|
|
16
|
-
# Warning: The database defined as "test" will be erased and
|
17
|
-
# re-generated from your development database when you run "rake".
|
18
|
-
# Do not set this db to the same as development or production.
|
19
6
|
test:
|
20
7
|
adapter: mysql2
|
21
|
-
encoding: utf8
|
22
|
-
reconnect: true
|
23
8
|
database: spud_inquiries_test
|
24
|
-
pool: 5
|
25
9
|
username: root
|
26
|
-
password:
|
27
|
-
socket: /tmp/mysql.sock
|
28
|
-
|
29
|
-
production:
|
30
|
-
adapter: mysql2
|
31
|
-
encoding: utf8
|
32
|
-
reconnect: true
|
33
|
-
database: spud_inquiries_production
|
34
|
-
pool: 5
|
35
|
-
username: root
|
36
|
-
password:
|
37
|
-
socket: /tmp/mysql.sock
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20130627121030) do
|
15
15
|
|
16
16
|
create_table "spud_admin_permissions", :force => true do |t|
|
17
17
|
t.integer "user_id"
|
@@ -32,8 +32,8 @@ ActiveRecord::Schema.define(:version => 20120610131541) do
|
|
32
32
|
t.boolean "marked_as_read", :default => false
|
33
33
|
end
|
34
34
|
|
35
|
-
add_index "spud_inquiries", ["marked_as_read"], :name => "
|
36
|
-
add_index "spud_inquiries", ["spud_inquiry_form_id"], :name => "
|
35
|
+
add_index "spud_inquiries", ["marked_as_read"], :name => "idx_inquiry_read"
|
36
|
+
add_index "spud_inquiries", ["spud_inquiry_form_id"], :name => "idx_inquiry_form"
|
37
37
|
|
38
38
|
create_table "spud_inquiry_fields", :force => true do |t|
|
39
39
|
t.string "name"
|
@@ -43,7 +43,7 @@ ActiveRecord::Schema.define(:version => 20120610131541) do
|
|
43
43
|
t.datetime "updated_at", :null => false
|
44
44
|
end
|
45
45
|
|
46
|
-
add_index "spud_inquiry_fields", ["spud_inquiry_id"], :name => "
|
46
|
+
add_index "spud_inquiry_fields", ["spud_inquiry_id"], :name => "inquiry_field_parent_id"
|
47
47
|
|
48
48
|
create_table "spud_inquiry_form_fields", :force => true do |t|
|
49
49
|
t.integer "spud_inquiry_form_id"
|
@@ -55,21 +55,23 @@ ActiveRecord::Schema.define(:version => 20120610131541) do
|
|
55
55
|
t.datetime "updated_at", :null => false
|
56
56
|
t.integer "field_order"
|
57
57
|
t.boolean "required"
|
58
|
+
t.string "placeholder"
|
58
59
|
end
|
59
60
|
|
60
|
-
add_index "spud_inquiry_form_fields", ["field_order"], :name => "
|
61
|
+
add_index "spud_inquiry_form_fields", ["field_order"], :name => "form_field_order"
|
61
62
|
|
62
63
|
create_table "spud_inquiry_forms", :force => true do |t|
|
63
64
|
t.string "name"
|
64
65
|
t.text "content"
|
65
|
-
t.datetime "created_at",
|
66
|
-
t.datetime "updated_at",
|
66
|
+
t.datetime "created_at", :null => false
|
67
|
+
t.datetime "updated_at", :null => false
|
67
68
|
t.text "recipients"
|
68
69
|
t.string "subject"
|
69
70
|
t.string "url_name"
|
71
|
+
t.text "thank_you_content"
|
70
72
|
end
|
71
73
|
|
72
|
-
add_index "spud_inquiry_forms", ["url_name"], :name => "
|
74
|
+
add_index "spud_inquiry_forms", ["url_name"], :name => "idx_form_url_name"
|
73
75
|
|
74
76
|
create_table "spud_user_settings", :force => true do |t|
|
75
77
|
t.integer "spud_user_id"
|
@@ -1,88 +1,103 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
[1m[36m (
|
1
|
+
Connecting to database specified by database.yml
|
2
|
+
Connecting to database specified by database.yml
|
3
|
+
[1m[36m (15.1ms)[0m [1mCREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB[0m
|
4
|
+
[1m[35m (7.4ms)[0m CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
|
5
|
+
[1m[36m (1.5ms)[0m [1mSELECT `schema_migrations`.`version` FROM `schema_migrations` [0m
|
4
6
|
Migrating to CreateSpudInquiries (20120117133405)
|
5
|
-
[1m[35m (
|
6
|
-
[1m[36m (0.
|
7
|
+
[1m[35m (17.2ms)[0m CREATE TABLE `spud_inquiries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `email` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
8
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120117133405')[0m
|
7
9
|
Migrating to CreateSpudInquiryFields (20120117133412)
|
8
|
-
[1m[35m (
|
9
|
-
[1m[36m (
|
10
|
-
[1m[35m (
|
10
|
+
[1m[35m (6.3ms)[0m CREATE TABLE `spud_inquiry_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `value` text, `spud_inquiry_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
11
|
+
[1m[36m (7.5ms)[0m [1mCREATE INDEX `inquiry_field_parent_id` ON `spud_inquiry_fields` (`spud_inquiry_id`)[0m
|
12
|
+
[1m[35m (0.4ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120117133412')
|
11
13
|
Migrating to CreateSpudInquiryForms (20120121194439)
|
12
|
-
[1m[36m (
|
13
|
-
[1m[35m (0.
|
14
|
+
[1m[36m (10.7ms)[0m [1mCREATE TABLE `spud_inquiry_forms` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `content` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB[0m
|
15
|
+
[1m[35m (0.4ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120121194439')
|
14
16
|
Migrating to CreateSpudInquiryFormFields (20120121194447)
|
15
|
-
[1m[36m (
|
16
|
-
[1m[35m (0.
|
17
|
+
[1m[36m (6.3ms)[0m [1mCREATE TABLE `spud_inquiry_form_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_inquiry_form_id` int(11), `field_type` varchar(255), `name` varchar(255), `options` varchar(255), `default_value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB[0m
|
18
|
+
[1m[35m (0.4ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120121194447')
|
17
19
|
Migrating to AddFieldOrderToSpudInquiryFormFields (20120122173829)
|
18
|
-
[1m[36m (
|
19
|
-
[1m[35m (
|
20
|
-
[1m[36m (
|
21
|
-
[1m[35m (
|
20
|
+
[1m[36m (6.9ms)[0m [1mALTER TABLE `spud_inquiry_form_fields` ADD `field_order` int(11)[0m
|
21
|
+
[1m[35m (8.7ms)[0m ALTER TABLE `spud_inquiry_form_fields` ADD `required` tinyint(1)
|
22
|
+
[1m[36m (19.6ms)[0m [1mCREATE INDEX `form_field_order` ON `spud_inquiry_form_fields` (`field_order`)[0m
|
23
|
+
[1m[35m (1.1ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120122173829')
|
22
24
|
Migrating to AddSpudInquiryFormIdToSpudInquiries (20120126132407)
|
23
|
-
[1m[36m (
|
24
|
-
[1m[35m (
|
25
|
-
[1m[36m (
|
26
|
-
[1m[35m (
|
27
|
-
[1m[36m (
|
28
|
-
[1m[35m (
|
29
|
-
[1m[36m (0.
|
25
|
+
[1m[36m (10.7ms)[0m [1mALTER TABLE `spud_inquiries` ADD `spud_inquiry_form_id` int(11)[0m
|
26
|
+
[1m[35m (8.5ms)[0m ALTER TABLE `spud_inquiries` ADD `recipients` text
|
27
|
+
[1m[36m (7.0ms)[0m [1mALTER TABLE `spud_inquiries` ADD `subject` varchar(255)[0m
|
28
|
+
[1m[35m (18.2ms)[0m ALTER TABLE `spud_inquiries` ADD `marked_as_read` tinyint(1) DEFAULT 0
|
29
|
+
[1m[36m (8.8ms)[0m [1mCREATE INDEX `idx_inquiry_read` ON `spud_inquiries` (`marked_as_read`)[0m
|
30
|
+
[1m[35m (10.4ms)[0m CREATE INDEX `idx_inquiry_form` ON `spud_inquiries` (`spud_inquiry_form_id`)
|
31
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120126132407')[0m
|
30
32
|
Migrating to AddRecipientsToSpudInquiryForms (20120126132522)
|
31
|
-
[1m[35m (
|
32
|
-
[1m[36m (
|
33
|
-
[1m[35m (0.
|
33
|
+
[1m[35m (17.3ms)[0m ALTER TABLE `spud_inquiry_forms` ADD `recipients` text
|
34
|
+
[1m[36m (15.7ms)[0m [1mALTER TABLE `spud_inquiry_forms` ADD `subject` varchar(255)[0m
|
35
|
+
[1m[35m (0.6ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120126132522')
|
34
36
|
Migrating to AddUrlNameToSpudInquiryForms (20120127023335)
|
35
|
-
[1m[36m (
|
36
|
-
[1m[35m (
|
37
|
-
[1m[36m (0.
|
37
|
+
[1m[36m (23.9ms)[0m [1mALTER TABLE `spud_inquiry_forms` ADD `url_name` varchar(255)[0m
|
38
|
+
[1m[35m (8.2ms)[0m CREATE INDEX `idx_form_url_name` ON `spud_inquiry_forms` (`url_name`)
|
39
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120127023335')[0m
|
38
40
|
Migrating to ChangeInquiryFormFieldsColumn (20120413124900)
|
39
|
-
[1m[35m (
|
40
|
-
[1m[36m (0.
|
41
|
+
[1m[35m (15.6ms)[0m ALTER TABLE `spud_inquiry_form_fields` CHANGE `options` `options` text DEFAULT NULL
|
42
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120413124900')[0m
|
41
43
|
Migrating to CreateSpudAdminPermissions (20120610131537)
|
42
|
-
[1m[35m (
|
44
|
+
[1m[35m (7.3ms)[0m CREATE TABLE `spud_admin_permissions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255), `access` tinyint(1), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
43
45
|
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120610131537')[0m
|
44
46
|
Migrating to CreateSpudUsers (20120610131538)
|
45
|
-
[1m[35m (
|
46
|
-
[1m[36m (
|
47
|
-
[1m[35m (
|
48
|
-
[1m[36m (0.
|
47
|
+
[1m[35m (5.5ms)[0m CREATE TABLE `spud_users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `first_name` varchar(255), `last_name` varchar(255), `super_admin` tinyint(1), `login` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `crypted_password` varchar(255) NOT NULL, `password_salt` varchar(255) NOT NULL, `persistence_token` varchar(255) NOT NULL, `single_access_token` varchar(255) NOT NULL, `perishable_token` varchar(255) NOT NULL, `login_count` int(11) DEFAULT 0 NOT NULL, `failed_login_count` int(11) DEFAULT 0 NOT NULL, `last_request_at` datetime, `current_login_at` datetime, `last_login_at` datetime, `current_login_ip` varchar(255), `last_login_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
48
|
+
[1m[36m (13.8ms)[0m [1mCREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)[0m
|
49
|
+
[1m[35m (18.0ms)[0m CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
|
50
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120610131538')[0m
|
49
51
|
Migrating to AddTimeZoneToSpudUser (20120610131539)
|
50
|
-
[1m[35m (
|
51
|
-
[1m[36m (0.
|
52
|
+
[1m[35m (20.1ms)[0m ALTER TABLE `spud_users` ADD `time_zone` varchar(255)
|
53
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120610131539')[0m
|
52
54
|
Migrating to AddScopeToSpudAdminPermissions (20120610131540)
|
53
|
-
[1m[35m (
|
54
|
-
[1m[36m (0.
|
55
|
+
[1m[35m (17.3ms)[0m ALTER TABLE `spud_admin_permissions` ADD `scope` varchar(255)
|
56
|
+
[1m[36m (0.5ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120610131540')[0m
|
55
57
|
Migrating to CreateSpudUserSettings (20120610131541)
|
56
|
-
[1m[35m (
|
57
|
-
[1m[36m (0.
|
58
|
-
|
59
|
-
[1m[
|
60
|
-
[1m[
|
61
|
-
|
62
|
-
[1m[35m (
|
63
|
-
[1m[36m (
|
64
|
-
[1m[35m (
|
65
|
-
|
66
|
-
[1m[
|
67
|
-
[1m[
|
68
|
-
[1m[
|
69
|
-
[1m[
|
70
|
-
[1m[
|
71
|
-
[1m[
|
72
|
-
[1m[
|
73
|
-
[1m[
|
74
|
-
[1m[
|
75
|
-
[1m[
|
76
|
-
[1m[
|
77
|
-
[1m[
|
58
|
+
[1m[35m (17.5ms)[0m CREATE TABLE `spud_user_settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `key` varchar(255), `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
59
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120610131541')[0m
|
60
|
+
Migrating to AddThankYouContentToSpudInquiryForm (20121228145215)
|
61
|
+
[1m[35m (7.4ms)[0m ALTER TABLE `spud_inquiry_forms` ADD `thank_you_content` text
|
62
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20121228145215')[0m
|
63
|
+
Migrating to AddPlaceholderToSpudInquiryFormFields (20130627121030)
|
64
|
+
[1m[35m (21.0ms)[0m ALTER TABLE `spud_inquiry_form_fields` ADD `placeholder` varchar(255)
|
65
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20130627121030')[0m
|
66
|
+
[1m[35m (0.2ms)[0m SELECT `schema_migrations`.`version` FROM `schema_migrations`
|
67
|
+
Connecting to database specified by database.yml
|
68
|
+
[1m[36m (1.5ms)[0m [1mSELECT `schema_migrations`.`version` FROM `schema_migrations` [0m
|
69
|
+
[1m[35m (5.3ms)[0m DROP DATABASE IF EXISTS `spud_inquiries_test`
|
70
|
+
[1m[36m (0.6ms)[0m [1mCREATE DATABASE `spud_inquiries_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`[0m
|
71
|
+
[1m[35m (40.1ms)[0m CREATE TABLE `spud_admin_permissions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255), `access` tinyint(1), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `scope` varchar(255)) ENGINE=InnoDB
|
72
|
+
[1m[36m (5.5ms)[0m [1mCREATE TABLE `spud_inquiries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `email` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `spud_inquiry_form_id` int(11), `recipients` text, `subject` varchar(255), `marked_as_read` tinyint(1) DEFAULT 0) ENGINE=InnoDB[0m
|
73
|
+
[1m[35m (7.8ms)[0m CREATE INDEX `idx_inquiry_read` ON `spud_inquiries` (`marked_as_read`)
|
74
|
+
[1m[36m (10.5ms)[0m [1mCREATE INDEX `idx_inquiry_form` ON `spud_inquiries` (`spud_inquiry_form_id`)[0m
|
75
|
+
[1m[35m (8.6ms)[0m CREATE TABLE `spud_inquiry_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `value` text, `spud_inquiry_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
76
|
+
[1m[36m (6.7ms)[0m [1mCREATE INDEX `inquiry_field_parent_id` ON `spud_inquiry_fields` (`spud_inquiry_id`)[0m
|
77
|
+
[1m[35m (21.2ms)[0m CREATE TABLE `spud_inquiry_form_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_inquiry_form_id` int(11), `field_type` varchar(255), `name` varchar(255), `options` text, `default_value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `field_order` int(11), `required` tinyint(1), `placeholder` varchar(255)) ENGINE=InnoDB
|
78
|
+
[1m[36m (10.8ms)[0m [1mCREATE INDEX `form_field_order` ON `spud_inquiry_form_fields` (`field_order`)[0m
|
79
|
+
[1m[35m (17.0ms)[0m CREATE TABLE `spud_inquiry_forms` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `content` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `recipients` text, `subject` varchar(255), `url_name` varchar(255), `thank_you_content` text) ENGINE=InnoDB
|
80
|
+
[1m[36m (7.0ms)[0m [1mCREATE INDEX `idx_form_url_name` ON `spud_inquiry_forms` (`url_name`)[0m
|
81
|
+
[1m[35m (20.8ms)[0m CREATE TABLE `spud_user_settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `key` varchar(255), `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
82
|
+
[1m[36m (6.0ms)[0m [1mCREATE TABLE `spud_users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `first_name` varchar(255), `last_name` varchar(255), `super_admin` tinyint(1), `login` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `crypted_password` varchar(255) NOT NULL, `password_salt` varchar(255) NOT NULL, `persistence_token` varchar(255) NOT NULL, `single_access_token` varchar(255) NOT NULL, `perishable_token` varchar(255) NOT NULL, `login_count` int(11) DEFAULT 0 NOT NULL, `failed_login_count` int(11) DEFAULT 0 NOT NULL, `last_request_at` datetime, `current_login_at` datetime, `last_login_at` datetime, `current_login_ip` varchar(255), `last_login_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `time_zone` varchar(255)) ENGINE=InnoDB[0m
|
83
|
+
[1m[35m (15.1ms)[0m CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
|
84
|
+
[1m[36m (20.2ms)[0m [1mCREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)[0m
|
85
|
+
[1m[35m (16.0ms)[0m CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
|
86
|
+
[1m[36m (10.8ms)[0m [1mCREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)[0m
|
78
87
|
[1m[35m (0.1ms)[0m SELECT version FROM `schema_migrations`
|
79
|
-
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('
|
80
|
-
[1m[35m (0.
|
81
|
-
[1m[36m (0.
|
82
|
-
[1m[35m (0.
|
83
|
-
[1m[36m (0.2ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('
|
84
|
-
[1m[35m (0.
|
85
|
-
[1m[36m (0.
|
86
|
-
[1m[35m (0.
|
87
|
-
[1m[36m (0.
|
88
|
-
[1m[35m (0.
|
88
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20130627121030')[0m
|
89
|
+
[1m[35m (0.2ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120610131537')
|
90
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120610131538')[0m
|
91
|
+
[1m[35m (0.1ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120610131539')
|
92
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120610131540')[0m
|
93
|
+
[1m[35m (0.2ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120610131541')
|
94
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120117133405')[0m
|
95
|
+
[1m[35m (0.1ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120117133412')
|
96
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120121194439')[0m
|
97
|
+
[1m[35m (0.5ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120121194447')
|
98
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120122173829')[0m
|
99
|
+
[1m[35m (0.2ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120126132407')
|
100
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120126132522')[0m
|
101
|
+
[1m[35m (1.0ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120127023335')
|
102
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120413124900')[0m
|
103
|
+
[1m[35m (0.2ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20121228145215')
|