spud_banners 0.9.0.2 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -1,3 +1,4 @@
1
+ [![Build Status](https://travis-ci.org/spud-rails/spud_banners.png?branch=master)](https://travis-ci.org/spud-rails/spud_banners)
1
2
  # Spud Banners
2
3
 
3
4
  Spud Banners is an engine for creating and managing rotating banner sets, designed for use with [Spud][spud].
@@ -14,18 +15,20 @@ Spud Banners is an engine for creating and managing rotating banner sets, design
14
15
  bundle exec rake railties:install:migrations
15
16
  rake db:migrate
16
17
 
17
- 4. Run a rails server instance and point your browser to /spud/admin
18
+ 4. Run a rails server instance and point your browser to `/spud/admin`
18
19
 
19
20
  ## Configuration
20
21
 
21
22
  Spud Banners accepts the following configuration options:
22
23
 
23
- Spud::Banners.configure do |config|
24
- config.paperclip_storage = :filesystem #use :s3 to use s3 storage (aws gem required)
25
- config.s3_credentials = "#{Rails.root}/config/s3.yml"
26
- config.storage_path = ":rails_root/public/system/spud_banners/:id/:style/:basename.:extension"
27
- config.storage_url = "/system/spud_banners/:id/:style/:basename.:extension"
28
- end
24
+ ```ruby
25
+ Spud::Banners.configure do |config|
26
+ config.paperclip_storage = :filesystem #use :s3 to use s3 storage (aws gem required)
27
+ config.s3_credentials = "#{Rails.root}/config/s3.yml"
28
+ config.storage_path = ":rails_root/public/system/spud_banners/:id/:style/:basename.:extension"
29
+ config.storage_url = "/system/spud_banners/:id/:style/:basename.:extension"
30
+ end
31
+ ```
29
32
 
30
33
  ## Creating a Banner Set
31
34
 
@@ -42,30 +45,37 @@ Once a Set has been created, you can begin adding banners to it. Banners contain
42
45
 
43
46
  ## View Helpers
44
47
 
45
- A number of view helpers are provided for displaying banners in your templates.
48
+ A number of view helpers are provided for displaying banners in your templates.
46
49
 
47
50
  `spud_banners_for_set(set_or_identifier, options)`
48
51
 
49
- Accepts the banner set name as a String or Symbol and returns an html template. Options hash accepts a `:limit` parameter for limiting the number of banners returned. This helper also accepts a block argument for rendering custom html.
52
+ Accepts the banner set name as a String or Symbol and returns an html template. Options hash accepts a `:limit` parameter for limiting the number of banners returned. This helper also accepts a block argument for rendering custom html.
50
53
 
51
- `spud_banner_tag(banner)`
54
+ ```ruby
55
+ spud_banner_tag(banner)
56
+ ```
52
57
 
53
58
  Accepts a banner model object and returns a banner image wrapped in a link tag. Link tag is omitted if the `link_to` property of the banner is blank.
54
59
 
55
- `spud_banner_image_tag(banner)`
60
+ ```ruby
61
+ spud_banner_image_tag(banner)
62
+ ```
56
63
 
57
- Accepts a banner model and returns only the image tag, no link.
64
+ Accepts a banner model and returns only the image tag, no link.
58
65
 
59
66
  ## Examples
60
67
 
61
68
  Displaying banners using the standard helper.
62
69
 
70
+ ```erb
63
71
  <div id="banners">
64
72
  <%= spud_banners_for_set(:promotions) %>
65
73
  </div>
74
+ ```
66
75
 
67
76
  Displaying banners using the helper, with a block for custom html.
68
77
 
78
+ ```erb
69
79
  <ul id="slides">
70
80
  <% spud_banners_for_set(:promotions) do |banner| %>
71
81
  <li class="custom_slide">
@@ -73,9 +83,11 @@ Displaying banners using the helper, with a block for custom html.
73
83
  </li>
74
84
  <% end %>
75
85
  </ul>
86
+ ```
76
87
 
77
88
  Displaying banners using the helper, with a block for even more custom html.
78
89
 
90
+ ```erb
79
91
  <ul id="slides">
80
92
  <% spud_banners_for_set(:promotions) do |banner| %>
81
93
  <li class="custom_slide">
@@ -84,21 +96,25 @@ Displaying banners using the helper, with a block for even more custom html.
84
96
  </li>
85
97
  <% end %>
86
98
  </ul>
99
+ ```
87
100
 
88
101
  ## Liquid
89
102
 
90
- Spud Banners comes with its own custom [Liquid][liquid] tag. For now the liquid tag only supports rendering the standard html as generated by the `spud_banners_for_set`. Will provide support more advanced options in the future.
103
+ Spud Banners comes with its own custom [Liquid][liquid] tag. For now the liquid tag only supports rendering the standard html as generated by the `spud_banners_for_set`. Will provide support more advanced options in the future.
91
104
 
92
105
  Usage:
93
106
 
107
+ ```erb
94
108
  <%= raw Liquid::Template.parse("{% spud_banner_set Promotions %}").render %>
109
+ ```
95
110
 
96
111
  ## Slideshows
97
112
 
98
- Spud Banners does not provide a built-in slideshow animation library. Instead, we make it easy for you to integrate into any number of popular JavaScript slideshow plugins available on the web, or even to write your own from scratch.
113
+ Spud Banners does not provide a built-in slideshow animation library. Instead, we make it easy for you to integrate into any number of popular JavaScript slideshow plugins available on the web, or even to write your own from scratch.
99
114
 
100
115
  Below is an example of integration with [SlidesJs][slidesjs], a jQuery plugin.
101
116
 
117
+ ```erb
102
118
  <style type="text/css" media="screen">
103
119
  .spud_banner_set {
104
120
  width: 600px;
@@ -122,7 +138,8 @@ Below is an example of integration with [SlidesJs][slidesjs], a jQuery plugin.
122
138
  });
123
139
  });
124
140
  </script>
141
+ ```
125
142
 
126
143
  [spud]:https://github.com/spud-rails/spud_core_admin
127
144
  [slidesjs]:http://www.slidesjs.com
128
- [liquid]:https://github.com/Shopify/liquid
145
+ [liquid]:https://github.com/Shopify/liquid
@@ -1,6 +1,6 @@
1
1
  class SpudBanner < ActiveRecord::Base
2
2
  attr_accessible :banner, :link_to, :link_target, :title, :alt, :sort_order
3
- belongs_to :owner, :class_name => 'SpudBannerSet', :foreign_key => 'spud_banner_set_id'
3
+ belongs_to :owner, :class_name => 'SpudBannerSet', :foreign_key => 'spud_banner_set_id', :inverse_of => :banners
4
4
 
5
5
  has_attached_file :banner,
6
6
  :styles => lambda { |attachment| attachment.instance.dynamic_styles },
@@ -28,22 +28,6 @@ class SpudBanner < ActiveRecord::Base
28
28
  return styles
29
29
  end
30
30
 
31
- def self.banners_for_set(identifier)
32
- case identifier.class
33
- when String
34
- banner_set = SpudBannerSet.find_by_name(identifier)
35
- when Symbol
36
- banner_set = SpudBannerSet.find_by_name(identifier.to_s.titleize)
37
- when Number
38
- banner_set = SpudBannerSet.find(identifier)
39
- end
40
- if banner_set
41
- return banner_set.banners
42
- else
43
- return []
44
- end
45
- end
46
-
47
31
  def set_name
48
32
  return owner.name
49
33
  end
@@ -1,6 +1,6 @@
1
1
  class SpudBannerSet < ActiveRecord::Base
2
2
  attr_accessible :cropped, :height, :name, :short_name, :width
3
- has_many :banners, :class_name => 'SpudBanner', :order => 'sort_order asc', :dependent => :destroy
3
+ has_many :banners, :class_name => 'SpudBanner', :order => 'sort_order asc', :dependent => :destroy, :inverse_of => :owner
4
4
 
5
5
  validates_presence_of :name
6
6
  validates_uniqueness_of :name
@@ -28,7 +28,7 @@ private
28
28
  if defined?(Spud::Cms)
29
29
  values = [record.set_name]
30
30
  values << @old_name if !@old_name.blank?
31
- SpudPageLiquidTag.where(:tag_name => "snippet",:value => values).includes(:attachment).each do |tag|
31
+ SpudPageLiquidTag.where(:tag_name => "banner_set",:value => values).includes(:attachment).each do |tag|
32
32
  partial = tag.attachment
33
33
  partial.postprocess_content
34
34
  partial.save
@@ -41,4 +41,4 @@ private
41
41
  end
42
42
  end
43
43
 
44
- end
44
+ end
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Banners
3
- VERSION = "0.9.0.2"
3
+ VERSION = "0.9.1"
4
4
  end
5
5
  end
@@ -34,9 +34,9 @@ ActiveRecord::Schema.define(:version => 20121127192250) do
34
34
  add_index "spud_banner_sets", ["name"], :name => "index_spud_banner_sets_on_name", :unique => true
35
35
 
36
36
  create_table "spud_banners", :force => true do |t|
37
- t.integer "spud_banner_set_id", :null => false
37
+ t.integer "spud_banner_set_id", :null => false
38
38
  t.string "link_to"
39
- t.string "link_target"
39
+ t.string "link_target", :default => "_self"
40
40
  t.string "title"
41
41
  t.string "alt"
42
42
  t.integer "sort_order", :default => 0
@@ -44,8 +44,8 @@ ActiveRecord::Schema.define(:version => 20121127192250) do
44
44
  t.string "banner_content_type"
45
45
  t.integer "banner_file_size"
46
46
  t.datetime "banner_updated_at"
47
- t.datetime "created_at", :null => false
48
- t.datetime "updated_at", :null => false
47
+ t.datetime "created_at", :null => false
48
+ t.datetime "updated_at", :null => false
49
49
  end
50
50
 
51
51
  add_index "spud_banners", ["spud_banner_set_id"], :name => "index_spud_banners_on_spud_banner_set_id"
@@ -1,72 +1,53 @@
1
1
  Connecting to database specified by database.yml
2
-  (35.6ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
3
-  (26.2ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
4
-  (2.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
2
+  (20.6ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
3
+  (19.3ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
4
+  (1.5ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
5
5
  Migrating to CreateSpudBanners (20121116195139)
6
-  (15.6ms) CREATE TABLE `spud_banners` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_banner_set_id` int(11) NOT NULL, `link_to` varchar(255), `link_target` varchar(255), `title` varchar(255), `alt` varchar(255), `sort_order` int(11) DEFAULT 0, `banner_file_name` varchar(255), `banner_content_type` varchar(255), `banner_file_size` int(11), `banner_updated_at` datetime, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
7
-  (14.2ms) CREATE INDEX `index_spud_banners_on_spud_banner_set_id` ON `spud_banners` (`spud_banner_set_id`)
8
-  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121116195139')
6
+  (9.8ms) CREATE TABLE `spud_banners` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_banner_set_id` int(11) NOT NULL, `link_to` varchar(255), `link_target` varchar(255) DEFAULT '_self', `title` varchar(255), `alt` varchar(255), `sort_order` int(11) DEFAULT 0, `banner_file_name` varchar(255), `banner_content_type` varchar(255), `banner_file_size` int(11), `banner_updated_at` datetime, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
7
+  (14.6ms) CREATE INDEX `index_spud_banners_on_spud_banner_set_id` ON `spud_banners` (`spud_banner_set_id`)
8
+  (0.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121116195139')
9
9
  Migrating to CreateSpudBannerSets (20121116195312)
10
-  (14.5ms) CREATE TABLE `spud_banner_sets` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `width` int(11) NOT NULL, `height` int(11) NOT NULL, `cropped` tinyint(1) DEFAULT 1, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
11
-  (9.1ms) CREATE UNIQUE INDEX `index_spud_banner_sets_on_name` ON `spud_banner_sets` (`name`)
10
+  (11.0ms) CREATE TABLE `spud_banner_sets` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `width` int(11) NOT NULL, `height` int(11) NOT NULL, `cropped` tinyint(1) DEFAULT 1, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
11
+  (15.5ms) CREATE UNIQUE INDEX `index_spud_banner_sets_on_name` ON `spud_banner_sets` (`name`)
12
12
   (0.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121116195312')
13
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
14
- Connecting to database specified by database.yml
15
-  (1.7ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
16
-  (2.2ms) DROP DATABASE IF EXISTS `spud_banners_test`
17
-  (0.4ms) CREATE DATABASE `spud_banners_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
18
-  (13.1ms) CREATE TABLE `spud_banner_sets` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `width` int(11) NOT NULL, `height` int(11) NOT NULL, `cropped` tinyint(1) DEFAULT 1, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
19
-  (14.6ms) CREATE UNIQUE INDEX `index_spud_banner_sets_on_name` ON `spud_banner_sets` (`name`)
20
-  (9.7ms) CREATE TABLE `spud_banners` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_banner_set_id` int(11) NOT NULL, `link_to` varchar(255), `link_target` varchar(255), `title` varchar(255), `alt` varchar(255), `sort_order` int(11) DEFAULT 0, `banner_file_name` varchar(255), `banner_content_type` varchar(255), `banner_file_size` int(11), `banner_updated_at` datetime, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
21
-  (13.6ms) CREATE INDEX `index_spud_banners_on_spud_banner_set_id` ON `spud_banners` (`spud_banner_set_id`)
22
-  (8.7ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
23
-  (13.8ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
24
-  (0.1ms) SELECT version FROM `schema_migrations`
25
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20121116195312')
26
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20121116195139')
27
- Connecting to database specified by database.yml
28
- Connecting to database specified by database.yml
29
-  (1.7ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
30
- Migrating to CreateSpudBanners (20121116195139)
31
- Migrating to CreateSpudBannerSets (20121116195312)
32
13
  Migrating to CreateSpudAdminPermissions (20121127192246)
33
-  (16.9ms) 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
34
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192246')
14
+  (8.5ms) 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
15
+  (0.2ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192246')
35
16
  Migrating to CreateSpudUsers (20121127192247)
36
-  (16.0ms) 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
37
-  (10.5ms) CREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)
38
-  (14.1ms) CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
39
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192247')
17
+  (9.8ms) 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
18
+  (11.7ms) CREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)
19
+  (11.7ms) CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
20
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192247')
40
21
  Migrating to AddTimeZoneToSpudUser (20121127192248)
41
-  (12.6ms) ALTER TABLE `spud_users` ADD `time_zone` varchar(255)
22
+  (14.0ms) ALTER TABLE `spud_users` ADD `time_zone` varchar(255)
42
23
   (0.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192248')
43
24
  Migrating to AddScopeToSpudAdminPermissions (20121127192249)
44
-  (16.9ms) ALTER TABLE `spud_admin_permissions` ADD `scope` varchar(255)
45
-  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192249')
25
+  (18.3ms) ALTER TABLE `spud_admin_permissions` ADD `scope` varchar(255)
26
+  (0.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192249')
46
27
  Migrating to CreateSpudUserSettings (20121127192250)
47
-  (13.1ms) 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
48
-  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192250')
49
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
28
+  (8.4ms) 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
29
+  (0.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121127192250')
30
+  (0.3ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
50
31
  Connecting to database specified by database.yml
51
-  (2.0ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
52
-  (1.9ms) DROP DATABASE IF EXISTS `spud_banners_test`
53
-  (0.3ms) CREATE DATABASE `spud_banners_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
54
-  (17.7ms) 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
55
-  (16.1ms) CREATE TABLE `spud_banner_sets` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `width` int(11) NOT NULL, `height` int(11) NOT NULL, `cropped` tinyint(1) DEFAULT 1, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
56
-  (14.6ms) CREATE UNIQUE INDEX `index_spud_banner_sets_on_name` ON `spud_banner_sets` (`name`)
57
-  (12.2ms) CREATE TABLE `spud_banners` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_banner_set_id` int(11) NOT NULL, `link_to` varchar(255), `link_target` varchar(255), `title` varchar(255), `alt` varchar(255), `sort_order` int(11) DEFAULT 0, `banner_file_name` varchar(255), `banner_content_type` varchar(255), `banner_file_size` int(11), `banner_updated_at` datetime, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
58
-  (18.0ms) CREATE INDEX `index_spud_banners_on_spud_banner_set_id` ON `spud_banners` (`spud_banner_set_id`)
59
-  (13.3ms) 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
60
-  (14.6ms) 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, `time_zone` varchar(255)) ENGINE=InnoDB
61
-  (15.8ms) CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
62
-  (16.3ms) CREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)
63
-  (14.5ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
64
-  (59.9ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
65
-  (0.2ms) SELECT version FROM `schema_migrations`
66
-  (0.4ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192250')
67
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192246')
68
-  (0.6ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192247')
69
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192248')
70
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192249')
71
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20121116195139')
72
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20121116195312')
32
+  (1.5ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
33
+  (0.3ms) DROP DATABASE IF EXISTS `spud_banners_test`
34
+  (0.2ms) CREATE DATABASE `spud_banners_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
35
+  (13.0ms) 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
36
+  (10.7ms) CREATE TABLE `spud_banner_sets` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `width` int(11) NOT NULL, `height` int(11) NOT NULL, `cropped` tinyint(1) DEFAULT 1, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
37
+  (13.7ms) CREATE UNIQUE INDEX `index_spud_banner_sets_on_name` ON `spud_banner_sets` (`name`)
38
+  (9.6ms) CREATE TABLE `spud_banners` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_banner_set_id` int(11) NOT NULL, `link_to` varchar(255), `link_target` varchar(255) DEFAULT '_self', `title` varchar(255), `alt` varchar(255), `sort_order` int(11) DEFAULT 0, `banner_file_name` varchar(255), `banner_content_type` varchar(255), `banner_file_size` int(11), `banner_updated_at` datetime, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
39
+  (14.9ms) CREATE INDEX `index_spud_banners_on_spud_banner_set_id` ON `spud_banners` (`spud_banner_set_id`)
40
+  (9.7ms) 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
41
+  (12.5ms) 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, `time_zone` varchar(255)) ENGINE=InnoDB
42
+  (12.4ms) CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
43
+  (12.2ms) CREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)
44
+  (16.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
45
+  (15.5ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
46
+  (0.1ms) SELECT version FROM `schema_migrations`
47
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192250')
48
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192246')
49
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192247')
50
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192248')
51
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20121127192249')
52
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20121116195139')
53
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20121116195312')