tb_blog 1.0.4 → 1.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.
- checksums.yaml +6 -14
- data/Readme.markdown +3 -2
- data/app/assets/javascripts/admin/blog/application.js +1 -0
- data/app/assets/javascripts/{spud/admin → admin/blog}/post_categories.js +0 -3
- data/app/assets/javascripts/{spud/admin → admin/blog}/posts.js +0 -6
- data/app/controllers/{spud/admin → admin}/news_posts_controller.rb +13 -11
- data/app/controllers/{spud/admin → admin}/post_categories_controller.rb +9 -7
- data/app/controllers/{spud/admin → admin}/post_comments_controller.rb +6 -7
- data/app/controllers/{spud/admin → admin}/posts_controller.rb +14 -11
- data/app/controllers/blog/sitemaps_controller.rb +10 -0
- data/app/controllers/blog_controller.rb +25 -34
- data/app/controllers/news_controller.rb +5 -21
- data/app/helpers/admin/news_posts_helper.rb +2 -0
- data/app/helpers/admin/post_categories_helper.rb +2 -0
- data/app/helpers/admin/post_comments_helper.rb +3 -0
- data/app/helpers/{spud/admin → admin}/posts_helper.rb +1 -1
- data/app/helpers/blog/sitemaps_helper.rb +2 -0
- data/app/helpers/blog_helper.rb +0 -1
- data/app/models/spud_post.rb +30 -21
- data/app/models/spud_post_categories_post.rb +2 -3
- data/app/models/spud_post_category.rb +9 -2
- data/app/models/spud_post_comment.rb +1 -3
- data/app/models/spud_post_site.rb +0 -1
- data/app/views/admin/news_posts/edit.html.erb +3 -0
- data/app/views/admin/news_posts/index.html.erb +42 -0
- data/app/views/admin/news_posts/new.html.erb +3 -0
- data/app/views/{spud/admin → admin}/post_categories/_category.html.erb +2 -2
- data/app/views/{spud/admin → admin}/post_categories/_form.html.erb +1 -1
- data/app/views/{spud/admin → admin}/post_categories/index.html.erb +1 -1
- data/app/views/admin/post_categories/new.html.erb +1 -0
- data/app/views/{spud/admin → admin}/post_comments/index.html.erb +3 -3
- data/app/views/{spud/admin → admin}/posts/_category.html.erb +1 -1
- data/app/views/{spud/admin → admin}/posts/_form.html.erb +3 -3
- data/app/views/admin/posts/edit.html.erb +3 -0
- data/app/views/admin/posts/index.html.erb +48 -0
- data/app/views/admin/posts/new.html.erb +3 -0
- data/app/views/blog/_comment.html.erb +6 -4
- data/app/views/blog/_comment_form.html.erb +0 -2
- data/app/views/blog/index.html.erb +30 -28
- data/app/views/blog/show.html.erb +35 -31
- data/app/views/news/index.html.erb +26 -24
- data/app/views/news/show.html.erb +25 -21
- data/config/routes.rb +14 -15
- data/lib/spud_blog/configuration.rb +1 -2
- data/lib/spud_blog/engine.rb +13 -10
- data/lib/spud_blog/version.rb +1 -1
- data/lib/tb_blog.rb +1 -1
- data/spec/controllers/admin/posts_controller_spec.rb +5 -0
- data/spec/dummy/config/application.rb +5 -2
- data/spec/dummy/config/environments/production.rb +1 -1
- data/spec/dummy/config/environments/test.rb +5 -6
- data/spec/dummy/config/initializers/secret_token.rb +1 -0
- data/spec/dummy/db/migrate/20140110180411_create_spud_roles.tb_core.rb +11 -0
- data/spec/dummy/db/migrate/20140110180412_create_spud_permissions.tb_core.rb +11 -0
- data/spec/dummy/db/migrate/20140110180413_create_spud_role_permissions.tb_core.rb +12 -0
- data/spec/dummy/db/migrate/20140110180414_drop_spud_admin_permissions.tb_core.rb +16 -0
- data/spec/dummy/db/migrate/20140110180415_create_spud_permalinks.tb_permalinks.rb +12 -0
- data/spec/dummy/db/migrate/20140110180416_add_site_id_to_spud_permalinks.tb_permalinks.rb +7 -0
- data/spec/dummy/db/migrate/20140110180417_modify_site_id_for_spud_permalinks.tb_permalinks.rb +12 -0
- data/spec/dummy/db/migrate/20140110180418_create_spud_posts.tb_blog.rb +16 -0
- data/spec/dummy/db/migrate/20140110180419_create_spud_post_categories.tb_blog.rb +14 -0
- data/spec/dummy/db/migrate/20140110180420_create_spud_post_comments.tb_blog.rb +14 -0
- data/spec/dummy/db/migrate/20140110180421_add_url_to_spud_posts.tb_blog.rb +7 -0
- data/spec/dummy/db/migrate/20140110180422_add_url_to_spud_post_categories.tb_blog.rb +9 -0
- data/spec/dummy/db/migrate/20140110180423_add_is_news_to_spud_posts.tb_blog.rb +7 -0
- data/spec/dummy/db/migrate/20140110180424_add_meta_to_posts.tb_blog.rb +7 -0
- data/spec/dummy/db/migrate/20140110180425_add_comments_counter_to_spud_posts.tb_blog.rb +13 -0
- data/spec/dummy/db/migrate/20140110180426_create_spud_post_sites.tb_blog.rb +12 -0
- data/spec/dummy/db/migrate/20140110180427_add_spam_fields_to_spud_post_comments.tb_blog.rb +9 -0
- data/spec/dummy/db/migrate/20140110180428_add_permalink_to_spud_post_comments.tb_blog.rb +6 -0
- data/spec/dummy/db/migrate/20140110180429_add_nested_set_to_post_categories.tb_blog.rb +22 -0
- data/spec/dummy/db/migrate/20140110180430_add_content_format_to_spud_posts.tb_blog.rb +6 -0
- data/spec/dummy/db/migrate/20140110180431_add_content_processed_to_spud_post.tb_blog.rb +6 -0
- data/spec/dummy/db/migrate/20140113162805_create_tb_liquid_spud_liquid_tags.tb_liquid.rb +13 -0
- data/spec/dummy/db/schema.rb +100 -59
- metadata +123 -104
- data/app/assets/javascripts/spud/blog/sitemaps.js +0 -2
- data/app/assets/javascripts/spud/blog.js +0 -41
- data/app/assets/stylesheets/news.css +0 -4
- data/app/assets/stylesheets/spud/blog/sitemaps.css +0 -4
- data/app/assets/stylesheets/spud/blog/validity.css +0 -3
- data/app/controllers/spud/blog/sitemaps_controller.rb +0 -9
- data/app/helpers/spud/admin/news_posts_helper.rb +0 -2
- data/app/helpers/spud/admin/post_categories_helper.rb +0 -2
- data/app/helpers/spud/admin/post_comments_helper.rb +0 -3
- data/app/helpers/spud/blog/sitemaps_helper.rb +0 -2
- data/app/models/spud_post_category_sweeper.rb +0 -41
- data/app/models/spud_post_comment_sweeper.rb +0 -33
- data/app/models/spud_post_sweeper.rb +0 -47
- data/app/views/spud/admin/news_posts/edit.html.erb +0 -3
- data/app/views/spud/admin/news_posts/index.html.erb +0 -44
- data/app/views/spud/admin/news_posts/new.html.erb +0 -3
- data/app/views/spud/admin/post_categories/new.html.erb +0 -1
- data/app/views/spud/admin/posts/edit.html.erb +0 -3
- data/app/views/spud/admin/posts/index.html.erb +0 -49
- data/app/views/spud/admin/posts/new.html.erb +0 -3
- data/spec/controllers/spud/admin/posts_controller_spec.rb +0 -5
- data/spec/dummy/log/development.log +0 -263
- data/spec/dummy/log/test.log +0 -3339
- /data/app/assets/javascripts/{spud/admin → admin/blog}/post_comments.js +0 -0
- /data/app/assets/stylesheets/{spud/admin/posts.css.scss → admin/blog/application.css.scss} +0 -0
- /data/app/views/{spud/admin → admin}/post_categories/edit.html.erb +0 -0
- /data/app/views/{spud/blog → blog}/sitemaps/show.xml.builder +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
Dummy::Application.configure do
|
1
|
+
Dummy::Application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
@@ -11,8 +11,10 @@ Dummy::Application.configure do
|
|
11
11
|
config.serve_static_assets = true
|
12
12
|
config.static_cache_control = "public, max-age=3600"
|
13
13
|
|
14
|
-
#
|
15
|
-
|
14
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
15
|
+
# just for the purpose of running a single test. If you are using a tool that
|
16
|
+
# preloads Rails for running tests, you may have to set it to true.
|
17
|
+
config.eager_load = false
|
16
18
|
|
17
19
|
# Show full error reports and disable caching
|
18
20
|
config.consider_all_requests_local = true
|
@@ -29,9 +31,6 @@ Dummy::Application.configure do
|
|
29
31
|
# ActionMailer::Base.deliveries array.
|
30
32
|
config.action_mailer.delivery_method = :test
|
31
33
|
|
32
|
-
# Raise exception on mass assignment protection for Active Record models
|
33
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
34
|
-
|
35
34
|
# Print deprecation notices to the stderr
|
36
35
|
config.active_support.deprecation = :stderr
|
37
36
|
end
|
@@ -5,3 +5,4 @@
|
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
7
|
Dummy::Application.config.secret_token = '3a89d4b95c1fd9c3d43623d8e2b5a907988d00bfdbfb6de2ae26b760a49fcdc86937728b8cdf3301e4df1342c5f44a3d8d83410d857e341f1907c9c467b9bcf4'
|
8
|
+
Dummy::Application.config.secret_key_base = '83ed28f1288f2f059bc8f642f2acb0606ed8b46a3490bee501c1223d3acac326c325b2a97f3b984dda20828815aa123c911970579df1faaedefa21613b05630d'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20130620143010)
|
2
|
+
class CreateSpudRoles < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_roles do |t|
|
5
|
+
t.string :name
|
6
|
+
t.timestamps
|
7
|
+
end
|
8
|
+
add_column :spud_users, :spud_role_id, :integer
|
9
|
+
add_index :spud_users, :spud_role_id
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20130620143941)
|
2
|
+
class CreateSpudPermissions < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_permissions do |t|
|
5
|
+
t.string :name, :null => false
|
6
|
+
t.string :tag, :null => false
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :spud_permissions, :tag, :unique => true
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20130620151132)
|
2
|
+
class CreateSpudRolePermissions < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_role_permissions do |t|
|
5
|
+
t.integer :spud_role_id, :null => false
|
6
|
+
t.string :spud_permission_tag, :null => false
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :spud_role_permissions, :spud_role_id
|
10
|
+
add_index :spud_role_permissions, :spud_permission_tag
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20130620163144)
|
2
|
+
class DropSpudAdminPermissions < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
drop_table :spud_admin_permissions
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
create_table :spud_admin_permissions do |t|
|
9
|
+
t.integer :user_id
|
10
|
+
t.string :name
|
11
|
+
t.boolean :access
|
12
|
+
t.string :scope
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_permalinks (originally 20120306195503)
|
2
|
+
class CreateSpudPermalinks < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_permalinks do |t|
|
5
|
+
t.string :url_name
|
6
|
+
t.string :attachment_type
|
7
|
+
t.integer :attachment_id
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :spud_permalinks, [:attachment_type,:attachment_id], :name => "idx_permalink_attachment"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# This migration comes from tb_permalinks (originally 20120329135522)
|
2
|
+
class AddSiteIdToSpudPermalinks < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :spud_permalinks, :site_id, :integer
|
5
|
+
add_index :spud_permalinks, :site_id, :name => "idx_permalinks_site_id"
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_permalinks (originally 20120912123700)
|
2
|
+
class ModifySiteIdForSpudPermalinks < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
change_column :spud_permalinks, :site_id, :integer, :default => 0, :null => false
|
5
|
+
SpudPermalink.where(:site_id => nil).each {|f| f.site_id = 0 ; f.save}
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
change_column :spud_permalinks, :site_id, :integer, :default => nil, :null => true
|
10
|
+
SpudPermalink.where(:site_id => 0).each {|f| f.site_id = nil ; f.save}
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This migration comes from tb_blog (originally 20120125180945)
|
2
|
+
class CreateSpudPosts < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_posts do |t|
|
5
|
+
t.integer :spud_user_id
|
6
|
+
t.string :title
|
7
|
+
t.text :content
|
8
|
+
t.boolean :comments_enabled, :default => false
|
9
|
+
t.boolean :visible, :default => true
|
10
|
+
t.datetime :published_at
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
add_index :spud_posts, :spud_user_id
|
14
|
+
add_index :spud_posts, :visible
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This migration comes from tb_blog (originally 20120125181022)
|
2
|
+
class CreateSpudPostCategories < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_post_categories do |t|
|
5
|
+
t.string :name
|
6
|
+
t.timestamps
|
7
|
+
end
|
8
|
+
create_table :spud_post_categories_posts, :id => false do |t|
|
9
|
+
t.integer :spud_post_id
|
10
|
+
t.integer :spud_post_category_id
|
11
|
+
end
|
12
|
+
add_index :spud_post_categories_posts, :spud_post_category_id
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This migration comes from tb_blog (originally 20120125181359)
|
2
|
+
class CreateSpudPostComments < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_post_comments do |t|
|
5
|
+
t.integer :spud_post_id
|
6
|
+
t.string :author
|
7
|
+
t.text :content
|
8
|
+
t.boolean :approved, :default => false
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :spud_post_comments, :spud_post_id
|
12
|
+
add_index :spud_post_comments, :approved
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This migration comes from tb_blog (originally 20120127144942)
|
2
|
+
class AddUrlToSpudPostCategories < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :spud_post_categories, :parent_id, :integer, :default => 0
|
5
|
+
add_column :spud_post_categories, :url_name, :string
|
6
|
+
add_index :spud_post_categories, :parent_id
|
7
|
+
add_index :spud_post_categories, :url_name
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This migration comes from tb_blog (originally 20120413020437)
|
2
|
+
class AddCommentsCounterToSpudPosts < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_column :spud_posts, :comments_count, :integer, :default => 0
|
5
|
+
SpudPost.find_each do |post|
|
6
|
+
post.comments_count = post.comments.count
|
7
|
+
post.save
|
8
|
+
end
|
9
|
+
end
|
10
|
+
def self.down
|
11
|
+
remove_column :spud_posts, :comments_count
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_blog (originally 20120713150446)
|
2
|
+
class CreateSpudPostSites < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_post_sites do |t|
|
5
|
+
t.integer :spud_post_id, :null => false
|
6
|
+
t.integer :spud_site_id, :null => false
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :spud_post_sites, :spud_post_id
|
10
|
+
add_index :spud_post_sites, :spud_site_id
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This migration comes from tb_blog (originally 20120825142547)
|
2
|
+
class AddSpamFieldsToSpudPostComments < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :spud_post_comments, :spam, :boolean
|
5
|
+
add_column :spud_post_comments, :user_ip, :string
|
6
|
+
add_column :spud_post_comments, :user_agent, :string
|
7
|
+
add_column :spud_post_comments, :referrer, :string
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This migration comes from tb_blog (originally 20121113135812)
|
2
|
+
class AddNestedSetToPostCategories < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
change_table :spud_post_categories do |t|
|
5
|
+
t.integer :lft
|
6
|
+
t.integer :rgt
|
7
|
+
t.integer :depth
|
8
|
+
end
|
9
|
+
|
10
|
+
# Populates lft, rgt, and depth values for nested set
|
11
|
+
SpudPostCategory.where(:parent_id => 0).update_all({:parent_id => nil})
|
12
|
+
SpudPostCategory.rebuild!
|
13
|
+
end
|
14
|
+
|
15
|
+
def down
|
16
|
+
change_table :spud_post_categories do |t|
|
17
|
+
t.remove :ltf
|
18
|
+
t.remove :rgt
|
19
|
+
t.remove :depth
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This migration comes from tb_liquid (originally 20140110142037)
|
2
|
+
class CreateTbLiquidSpudLiquidTags < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_liquid_tags do |t|
|
5
|
+
t.integer :attachment_id
|
6
|
+
t.string :attachment_type
|
7
|
+
t.string :tag_name
|
8
|
+
t.string :value
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :spud_liquid_tags, [:tag_name, :value]
|
12
|
+
end
|
13
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -9,47 +9,70 @@
|
|
9
9
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
10
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
11
|
#
|
12
|
-
# It's strongly recommended
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:
|
14
|
+
ActiveRecord::Schema.define(version: 20140113162805) do
|
15
15
|
|
16
|
-
create_table "
|
17
|
-
t.integer "
|
18
|
-
t.string "
|
19
|
-
t.
|
20
|
-
t.
|
21
|
-
t.datetime "
|
22
|
-
t.
|
16
|
+
create_table "spud_liquid_tags", force: true do |t|
|
17
|
+
t.integer "attachment_id"
|
18
|
+
t.string "attachment_type"
|
19
|
+
t.string "tag_name"
|
20
|
+
t.string "value"
|
21
|
+
t.datetime "created_at"
|
22
|
+
t.datetime "updated_at"
|
23
|
+
end
|
24
|
+
|
25
|
+
add_index "spud_liquid_tags", ["tag_name", "value"], name: "index_spud_liquid_tags_on_tag_name_and_value", using: :btree
|
26
|
+
|
27
|
+
create_table "spud_permalinks", force: true do |t|
|
28
|
+
t.string "url_name"
|
29
|
+
t.string "attachment_type"
|
30
|
+
t.integer "attachment_id"
|
31
|
+
t.datetime "created_at"
|
32
|
+
t.datetime "updated_at"
|
33
|
+
t.integer "site_id", default: 0, null: false
|
34
|
+
end
|
35
|
+
|
36
|
+
add_index "spud_permalinks", ["attachment_type", "attachment_id"], name: "idx_permalink_attachment", using: :btree
|
37
|
+
add_index "spud_permalinks", ["site_id"], name: "idx_permalinks_site_id", using: :btree
|
38
|
+
|
39
|
+
create_table "spud_permissions", force: true do |t|
|
40
|
+
t.string "name", null: false
|
41
|
+
t.string "tag", null: false
|
42
|
+
t.datetime "created_at"
|
43
|
+
t.datetime "updated_at"
|
23
44
|
end
|
24
45
|
|
25
|
-
|
46
|
+
add_index "spud_permissions", ["tag"], name: "index_spud_permissions_on_tag", unique: true, using: :btree
|
47
|
+
|
48
|
+
create_table "spud_post_categories", force: true do |t|
|
26
49
|
t.string "name"
|
27
|
-
t.datetime "created_at"
|
28
|
-
t.datetime "updated_at"
|
29
|
-
t.integer "parent_id", :
|
50
|
+
t.datetime "created_at"
|
51
|
+
t.datetime "updated_at"
|
52
|
+
t.integer "parent_id", default: 0
|
30
53
|
t.string "url_name"
|
31
54
|
t.integer "lft"
|
32
55
|
t.integer "rgt"
|
33
56
|
t.integer "depth"
|
34
57
|
end
|
35
58
|
|
36
|
-
add_index "spud_post_categories", ["parent_id"], :
|
37
|
-
add_index "spud_post_categories", ["url_name"], :
|
59
|
+
add_index "spud_post_categories", ["parent_id"], name: "index_spud_post_categories_on_parent_id", using: :btree
|
60
|
+
add_index "spud_post_categories", ["url_name"], name: "index_spud_post_categories_on_url_name", using: :btree
|
38
61
|
|
39
|
-
create_table "spud_post_categories_posts", :
|
62
|
+
create_table "spud_post_categories_posts", id: false, force: true do |t|
|
40
63
|
t.integer "spud_post_id"
|
41
64
|
t.integer "spud_post_category_id"
|
42
65
|
end
|
43
66
|
|
44
|
-
add_index "spud_post_categories_posts", ["spud_post_category_id"], :
|
67
|
+
add_index "spud_post_categories_posts", ["spud_post_category_id"], name: "index_spud_post_categories_posts_on_spud_post_category_id", using: :btree
|
45
68
|
|
46
|
-
create_table "spud_post_comments", :
|
69
|
+
create_table "spud_post_comments", force: true do |t|
|
47
70
|
t.integer "spud_post_id"
|
48
71
|
t.string "author"
|
49
72
|
t.text "content"
|
50
|
-
t.boolean "approved", :
|
51
|
-
t.datetime "created_at"
|
52
|
-
t.datetime "updated_at"
|
73
|
+
t.boolean "approved", default: false
|
74
|
+
t.datetime "created_at"
|
75
|
+
t.datetime "updated_at"
|
53
76
|
t.boolean "spam"
|
54
77
|
t.string "user_ip"
|
55
78
|
t.string "user_agent"
|
@@ -57,74 +80,92 @@ ActiveRecord::Schema.define(:version => 20130121130612) do
|
|
57
80
|
t.string "permalink"
|
58
81
|
end
|
59
82
|
|
60
|
-
add_index "spud_post_comments", ["approved"], :
|
61
|
-
add_index "spud_post_comments", ["spud_post_id"], :
|
83
|
+
add_index "spud_post_comments", ["approved"], name: "index_spud_post_comments_on_approved", using: :btree
|
84
|
+
add_index "spud_post_comments", ["spud_post_id"], name: "index_spud_post_comments_on_spud_post_id", using: :btree
|
62
85
|
|
63
|
-
create_table "spud_post_sites", :
|
64
|
-
t.integer "spud_post_id", :
|
65
|
-
t.integer "spud_site_id", :
|
66
|
-
t.datetime "created_at"
|
67
|
-
t.datetime "updated_at"
|
86
|
+
create_table "spud_post_sites", force: true do |t|
|
87
|
+
t.integer "spud_post_id", null: false
|
88
|
+
t.integer "spud_site_id", null: false
|
89
|
+
t.datetime "created_at"
|
90
|
+
t.datetime "updated_at"
|
68
91
|
end
|
69
92
|
|
70
|
-
add_index "spud_post_sites", ["spud_post_id"], :
|
71
|
-
add_index "spud_post_sites", ["spud_site_id"], :
|
93
|
+
add_index "spud_post_sites", ["spud_post_id"], name: "index_spud_post_sites_on_spud_post_id", using: :btree
|
94
|
+
add_index "spud_post_sites", ["spud_site_id"], name: "index_spud_post_sites_on_spud_site_id", using: :btree
|
72
95
|
|
73
|
-
create_table "spud_posts", :
|
96
|
+
create_table "spud_posts", force: true do |t|
|
74
97
|
t.integer "spud_user_id"
|
75
98
|
t.string "title"
|
76
99
|
t.text "content"
|
77
|
-
t.boolean "comments_enabled", :
|
78
|
-
t.boolean "visible", :
|
100
|
+
t.boolean "comments_enabled", default: false
|
101
|
+
t.boolean "visible", default: true
|
79
102
|
t.datetime "published_at"
|
80
|
-
t.datetime "created_at"
|
81
|
-
t.datetime "updated_at"
|
103
|
+
t.datetime "created_at"
|
104
|
+
t.datetime "updated_at"
|
82
105
|
t.string "url_name"
|
83
|
-
t.boolean "is_news", :
|
106
|
+
t.boolean "is_news", default: false
|
84
107
|
t.string "meta_keywords"
|
85
108
|
t.text "meta_description"
|
86
|
-
t.integer "comments_count", :
|
87
|
-
t.string "content_format", :
|
109
|
+
t.integer "comments_count", default: 0
|
110
|
+
t.string "content_format", default: "HTML"
|
88
111
|
t.text "content_processed"
|
89
112
|
end
|
90
113
|
|
91
|
-
add_index "spud_posts", ["is_news"], :
|
92
|
-
add_index "spud_posts", ["spud_user_id"], :
|
93
|
-
add_index "spud_posts", ["url_name"], :
|
94
|
-
add_index "spud_posts", ["visible"], :
|
114
|
+
add_index "spud_posts", ["is_news"], name: "index_spud_posts_on_is_news", using: :btree
|
115
|
+
add_index "spud_posts", ["spud_user_id"], name: "index_spud_posts_on_spud_user_id", using: :btree
|
116
|
+
add_index "spud_posts", ["url_name"], name: "index_spud_posts_on_url_name", using: :btree
|
117
|
+
add_index "spud_posts", ["visible"], name: "index_spud_posts_on_visible", using: :btree
|
118
|
+
|
119
|
+
create_table "spud_role_permissions", force: true do |t|
|
120
|
+
t.integer "spud_role_id", null: false
|
121
|
+
t.string "spud_permission_tag", null: false
|
122
|
+
t.datetime "created_at"
|
123
|
+
t.datetime "updated_at"
|
124
|
+
end
|
125
|
+
|
126
|
+
add_index "spud_role_permissions", ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag", using: :btree
|
127
|
+
add_index "spud_role_permissions", ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id", using: :btree
|
128
|
+
|
129
|
+
create_table "spud_roles", force: true do |t|
|
130
|
+
t.string "name"
|
131
|
+
t.datetime "created_at"
|
132
|
+
t.datetime "updated_at"
|
133
|
+
end
|
95
134
|
|
96
|
-
create_table "spud_user_settings", :
|
135
|
+
create_table "spud_user_settings", force: true do |t|
|
97
136
|
t.integer "spud_user_id"
|
98
137
|
t.string "key"
|
99
138
|
t.string "value"
|
100
|
-
t.datetime "created_at"
|
101
|
-
t.datetime "updated_at"
|
139
|
+
t.datetime "created_at"
|
140
|
+
t.datetime "updated_at"
|
102
141
|
end
|
103
142
|
|
104
|
-
create_table "spud_users", :
|
143
|
+
create_table "spud_users", force: true do |t|
|
105
144
|
t.string "first_name"
|
106
145
|
t.string "last_name"
|
107
146
|
t.boolean "super_admin"
|
108
|
-
t.string "login",
|
109
|
-
t.string "email",
|
110
|
-
t.string "crypted_password",
|
111
|
-
t.string "password_salt",
|
112
|
-
t.string "persistence_token",
|
113
|
-
t.string "single_access_token",
|
114
|
-
t.string "perishable_token",
|
115
|
-
t.integer "login_count", :
|
116
|
-
t.integer "failed_login_count", :
|
147
|
+
t.string "login", null: false
|
148
|
+
t.string "email", null: false
|
149
|
+
t.string "crypted_password", null: false
|
150
|
+
t.string "password_salt", null: false
|
151
|
+
t.string "persistence_token", null: false
|
152
|
+
t.string "single_access_token", null: false
|
153
|
+
t.string "perishable_token", null: false
|
154
|
+
t.integer "login_count", default: 0, null: false
|
155
|
+
t.integer "failed_login_count", default: 0, null: false
|
117
156
|
t.datetime "last_request_at"
|
118
157
|
t.datetime "current_login_at"
|
119
158
|
t.datetime "last_login_at"
|
120
159
|
t.string "current_login_ip"
|
121
160
|
t.string "last_login_ip"
|
122
|
-
t.datetime "created_at"
|
123
|
-
t.datetime "updated_at"
|
161
|
+
t.datetime "created_at"
|
162
|
+
t.datetime "updated_at"
|
124
163
|
t.string "time_zone"
|
164
|
+
t.integer "spud_role_id"
|
125
165
|
end
|
126
166
|
|
127
|
-
add_index "spud_users", ["email"], :
|
128
|
-
add_index "spud_users", ["login"], :
|
167
|
+
add_index "spud_users", ["email"], name: "index_spud_users_on_email", using: :btree
|
168
|
+
add_index "spud_users", ["login"], name: "index_spud_users_on_login", using: :btree
|
169
|
+
add_index "spud_users", ["spud_role_id"], name: "index_spud_users_on_spud_role_id", using: :btree
|
129
170
|
|
130
171
|
end
|