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.
Files changed (103) hide show
  1. checksums.yaml +6 -14
  2. data/Readme.markdown +3 -2
  3. data/app/assets/javascripts/admin/blog/application.js +1 -0
  4. data/app/assets/javascripts/{spud/admin → admin/blog}/post_categories.js +0 -3
  5. data/app/assets/javascripts/{spud/admin → admin/blog}/posts.js +0 -6
  6. data/app/controllers/{spud/admin → admin}/news_posts_controller.rb +13 -11
  7. data/app/controllers/{spud/admin → admin}/post_categories_controller.rb +9 -7
  8. data/app/controllers/{spud/admin → admin}/post_comments_controller.rb +6 -7
  9. data/app/controllers/{spud/admin → admin}/posts_controller.rb +14 -11
  10. data/app/controllers/blog/sitemaps_controller.rb +10 -0
  11. data/app/controllers/blog_controller.rb +25 -34
  12. data/app/controllers/news_controller.rb +5 -21
  13. data/app/helpers/admin/news_posts_helper.rb +2 -0
  14. data/app/helpers/admin/post_categories_helper.rb +2 -0
  15. data/app/helpers/admin/post_comments_helper.rb +3 -0
  16. data/app/helpers/{spud/admin → admin}/posts_helper.rb +1 -1
  17. data/app/helpers/blog/sitemaps_helper.rb +2 -0
  18. data/app/helpers/blog_helper.rb +0 -1
  19. data/app/models/spud_post.rb +30 -21
  20. data/app/models/spud_post_categories_post.rb +2 -3
  21. data/app/models/spud_post_category.rb +9 -2
  22. data/app/models/spud_post_comment.rb +1 -3
  23. data/app/models/spud_post_site.rb +0 -1
  24. data/app/views/admin/news_posts/edit.html.erb +3 -0
  25. data/app/views/admin/news_posts/index.html.erb +42 -0
  26. data/app/views/admin/news_posts/new.html.erb +3 -0
  27. data/app/views/{spud/admin → admin}/post_categories/_category.html.erb +2 -2
  28. data/app/views/{spud/admin → admin}/post_categories/_form.html.erb +1 -1
  29. data/app/views/{spud/admin → admin}/post_categories/index.html.erb +1 -1
  30. data/app/views/admin/post_categories/new.html.erb +1 -0
  31. data/app/views/{spud/admin → admin}/post_comments/index.html.erb +3 -3
  32. data/app/views/{spud/admin → admin}/posts/_category.html.erb +1 -1
  33. data/app/views/{spud/admin → admin}/posts/_form.html.erb +3 -3
  34. data/app/views/admin/posts/edit.html.erb +3 -0
  35. data/app/views/admin/posts/index.html.erb +48 -0
  36. data/app/views/admin/posts/new.html.erb +3 -0
  37. data/app/views/blog/_comment.html.erb +6 -4
  38. data/app/views/blog/_comment_form.html.erb +0 -2
  39. data/app/views/blog/index.html.erb +30 -28
  40. data/app/views/blog/show.html.erb +35 -31
  41. data/app/views/news/index.html.erb +26 -24
  42. data/app/views/news/show.html.erb +25 -21
  43. data/config/routes.rb +14 -15
  44. data/lib/spud_blog/configuration.rb +1 -2
  45. data/lib/spud_blog/engine.rb +13 -10
  46. data/lib/spud_blog/version.rb +1 -1
  47. data/lib/tb_blog.rb +1 -1
  48. data/spec/controllers/admin/posts_controller_spec.rb +5 -0
  49. data/spec/dummy/config/application.rb +5 -2
  50. data/spec/dummy/config/environments/production.rb +1 -1
  51. data/spec/dummy/config/environments/test.rb +5 -6
  52. data/spec/dummy/config/initializers/secret_token.rb +1 -0
  53. data/spec/dummy/db/migrate/20140110180411_create_spud_roles.tb_core.rb +11 -0
  54. data/spec/dummy/db/migrate/20140110180412_create_spud_permissions.tb_core.rb +11 -0
  55. data/spec/dummy/db/migrate/20140110180413_create_spud_role_permissions.tb_core.rb +12 -0
  56. data/spec/dummy/db/migrate/20140110180414_drop_spud_admin_permissions.tb_core.rb +16 -0
  57. data/spec/dummy/db/migrate/20140110180415_create_spud_permalinks.tb_permalinks.rb +12 -0
  58. data/spec/dummy/db/migrate/20140110180416_add_site_id_to_spud_permalinks.tb_permalinks.rb +7 -0
  59. data/spec/dummy/db/migrate/20140110180417_modify_site_id_for_spud_permalinks.tb_permalinks.rb +12 -0
  60. data/spec/dummy/db/migrate/20140110180418_create_spud_posts.tb_blog.rb +16 -0
  61. data/spec/dummy/db/migrate/20140110180419_create_spud_post_categories.tb_blog.rb +14 -0
  62. data/spec/dummy/db/migrate/20140110180420_create_spud_post_comments.tb_blog.rb +14 -0
  63. data/spec/dummy/db/migrate/20140110180421_add_url_to_spud_posts.tb_blog.rb +7 -0
  64. data/spec/dummy/db/migrate/20140110180422_add_url_to_spud_post_categories.tb_blog.rb +9 -0
  65. data/spec/dummy/db/migrate/20140110180423_add_is_news_to_spud_posts.tb_blog.rb +7 -0
  66. data/spec/dummy/db/migrate/20140110180424_add_meta_to_posts.tb_blog.rb +7 -0
  67. data/spec/dummy/db/migrate/20140110180425_add_comments_counter_to_spud_posts.tb_blog.rb +13 -0
  68. data/spec/dummy/db/migrate/20140110180426_create_spud_post_sites.tb_blog.rb +12 -0
  69. data/spec/dummy/db/migrate/20140110180427_add_spam_fields_to_spud_post_comments.tb_blog.rb +9 -0
  70. data/spec/dummy/db/migrate/20140110180428_add_permalink_to_spud_post_comments.tb_blog.rb +6 -0
  71. data/spec/dummy/db/migrate/20140110180429_add_nested_set_to_post_categories.tb_blog.rb +22 -0
  72. data/spec/dummy/db/migrate/20140110180430_add_content_format_to_spud_posts.tb_blog.rb +6 -0
  73. data/spec/dummy/db/migrate/20140110180431_add_content_processed_to_spud_post.tb_blog.rb +6 -0
  74. data/spec/dummy/db/migrate/20140113162805_create_tb_liquid_spud_liquid_tags.tb_liquid.rb +13 -0
  75. data/spec/dummy/db/schema.rb +100 -59
  76. metadata +123 -104
  77. data/app/assets/javascripts/spud/blog/sitemaps.js +0 -2
  78. data/app/assets/javascripts/spud/blog.js +0 -41
  79. data/app/assets/stylesheets/news.css +0 -4
  80. data/app/assets/stylesheets/spud/blog/sitemaps.css +0 -4
  81. data/app/assets/stylesheets/spud/blog/validity.css +0 -3
  82. data/app/controllers/spud/blog/sitemaps_controller.rb +0 -9
  83. data/app/helpers/spud/admin/news_posts_helper.rb +0 -2
  84. data/app/helpers/spud/admin/post_categories_helper.rb +0 -2
  85. data/app/helpers/spud/admin/post_comments_helper.rb +0 -3
  86. data/app/helpers/spud/blog/sitemaps_helper.rb +0 -2
  87. data/app/models/spud_post_category_sweeper.rb +0 -41
  88. data/app/models/spud_post_comment_sweeper.rb +0 -33
  89. data/app/models/spud_post_sweeper.rb +0 -47
  90. data/app/views/spud/admin/news_posts/edit.html.erb +0 -3
  91. data/app/views/spud/admin/news_posts/index.html.erb +0 -44
  92. data/app/views/spud/admin/news_posts/new.html.erb +0 -3
  93. data/app/views/spud/admin/post_categories/new.html.erb +0 -1
  94. data/app/views/spud/admin/posts/edit.html.erb +0 -3
  95. data/app/views/spud/admin/posts/index.html.erb +0 -49
  96. data/app/views/spud/admin/posts/new.html.erb +0 -3
  97. data/spec/controllers/spud/admin/posts_controller_spec.rb +0 -5
  98. data/spec/dummy/log/development.log +0 -263
  99. data/spec/dummy/log/test.log +0 -3339
  100. /data/app/assets/javascripts/{spud/admin → admin/blog}/post_comments.js +0 -0
  101. /data/app/assets/stylesheets/{spud/admin/posts.css.scss → admin/blog/application.css.scss} +0 -0
  102. /data/app/views/{spud/admin → admin}/post_categories/edit.html.erb +0 -0
  103. /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
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
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,7 @@
1
+ # This migration comes from tb_blog (originally 20120127143054)
2
+ class AddUrlToSpudPosts < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_posts, :url_name, :string
5
+ add_index :spud_posts, :url_name
6
+ end
7
+ 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,7 @@
1
+ # This migration comes from tb_blog (originally 20120210165540)
2
+ class AddIsNewsToSpudPosts < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_posts, :is_news, :boolean, :default => false
5
+ add_index :spud_posts, :is_news
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from tb_blog (originally 20120309181917)
2
+ class AddMetaToPosts < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_posts, :meta_keywords, :string
5
+ add_column :spud_posts, :meta_description, :text
6
+ end
7
+ 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,6 @@
1
+ # This migration comes from tb_blog (originally 20120825144506)
2
+ class AddPermalinkToSpudPostComments < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_post_comments, :permalink, :string
5
+ end
6
+ 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,6 @@
1
+ # This migration comes from tb_blog (originally 20130120151857)
2
+ class AddContentFormatToSpudPosts < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_posts, :content_format, :string, :default => "HTML"
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from tb_blog (originally 20130121130612)
2
+ class AddContentProcessedToSpudPost < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_posts, :content_processed, :text
5
+ end
6
+ 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
@@ -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 to check this file into your version control system.
12
+ # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20130121130612) do
14
+ ActiveRecord::Schema.define(version: 20140113162805) do
15
15
 
16
- create_table "spud_admin_permissions", :force => true do |t|
17
- t.integer "user_id"
18
- t.string "name"
19
- t.boolean "access"
20
- t.datetime "created_at", :null => false
21
- t.datetime "updated_at", :null => false
22
- t.string "scope"
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
- create_table "spud_post_categories", :force => true do |t|
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", :null => false
28
- t.datetime "updated_at", :null => false
29
- t.integer "parent_id", :default => 0
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"], :name => "index_spud_post_categories_on_parent_id"
37
- add_index "spud_post_categories", ["url_name"], :name => "index_spud_post_categories_on_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", :id => false, :force => true do |t|
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"], :name => "index_spud_post_categories_posts_on_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", :force => true do |t|
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", :default => false
51
- t.datetime "created_at", :null => false
52
- t.datetime "updated_at", :null => false
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"], :name => "index_spud_post_comments_on_approved"
61
- add_index "spud_post_comments", ["spud_post_id"], :name => "index_spud_post_comments_on_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", :force => true do |t|
64
- t.integer "spud_post_id", :null => false
65
- t.integer "spud_site_id", :null => false
66
- t.datetime "created_at", :null => false
67
- t.datetime "updated_at", :null => false
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"], :name => "index_spud_post_sites_on_spud_post_id"
71
- add_index "spud_post_sites", ["spud_site_id"], :name => "index_spud_post_sites_on_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", :force => true do |t|
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", :default => false
78
- t.boolean "visible", :default => true
100
+ t.boolean "comments_enabled", default: false
101
+ t.boolean "visible", default: true
79
102
  t.datetime "published_at"
80
- t.datetime "created_at", :null => false
81
- t.datetime "updated_at", :null => false
103
+ t.datetime "created_at"
104
+ t.datetime "updated_at"
82
105
  t.string "url_name"
83
- t.boolean "is_news", :default => false
106
+ t.boolean "is_news", default: false
84
107
  t.string "meta_keywords"
85
108
  t.text "meta_description"
86
- t.integer "comments_count", :default => 0
87
- t.string "content_format", :default => "HTML"
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"], :name => "index_spud_posts_on_is_news"
92
- add_index "spud_posts", ["spud_user_id"], :name => "index_spud_posts_on_spud_user_id"
93
- add_index "spud_posts", ["url_name"], :name => "index_spud_posts_on_url_name"
94
- add_index "spud_posts", ["visible"], :name => "index_spud_posts_on_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", :force => true do |t|
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", :null => false
101
- t.datetime "updated_at", :null => false
139
+ t.datetime "created_at"
140
+ t.datetime "updated_at"
102
141
  end
103
142
 
104
- create_table "spud_users", :force => true do |t|
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", :null => false
109
- t.string "email", :null => false
110
- t.string "crypted_password", :null => false
111
- t.string "password_salt", :null => false
112
- t.string "persistence_token", :null => false
113
- t.string "single_access_token", :null => false
114
- t.string "perishable_token", :null => false
115
- t.integer "login_count", :default => 0, :null => false
116
- t.integer "failed_login_count", :default => 0, :null => false
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", :null => false
123
- t.datetime "updated_at", :null => false
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"], :name => "index_spud_users_on_email"
128
- add_index "spud_users", ["login"], :name => "index_spud_users_on_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