tb_blog 1.4.0 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +1 -1
- data/Readme.md +1 -1
- data/app/assets/javascripts/admin/blog/posts.js +1 -1
- data/app/controllers/admin/post_categories_controller.rb +3 -3
- data/app/controllers/admin/posts_controller.rb +4 -12
- data/app/controllers/concerns/render_post_action.rb +7 -0
- data/app/controllers/posts_controller.rb +11 -12
- data/app/helpers/admin/posts_helper.rb +1 -1
- data/app/helpers/blog_helper.rb +1 -1
- data/app/models/spud_post.rb +1 -1
- data/app/models/spud_post_category.rb +7 -4
- data/app/models/spud_post_site.rb +1 -1
- data/app/models/{spud → tb_core}/spud_post_model.rb +10 -7
- data/app/views/posts/index.rss.builder +5 -5
- data/lib/generators/spud/blog/random_posts_generator.rb +1 -1
- data/lib/spud_blog/engine.rb +8 -8
- data/lib/spud_blog/version.rb +1 -1
- data/spec/controllers/admin/posts_controller_spec.rb +2 -2
- data/spec/controllers/posts_controller_spec.rb +9 -1
- data/spec/dummy/app/controllers/application_controller.rb +1 -1
- data/spec/dummy/config/environments/development.rb +0 -7
- data/spec/dummy/config/environments/production.rb +0 -4
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/db/migrate/20180730141254_create_active_storage_tables.active_storage.rb +26 -0
- data/spec/dummy/db/schema.rb +95 -74
- data/spec/factories/spud_post_factories.rb +3 -3
- data/spec/helpers/admin/posts_helper_spec.rb +1 -1
- data/spec/helpers/blog_helper_spec.rb +1 -1
- data/spec/models/spud_post_spec.rb +2 -2
- data/spec/rails_helper.rb +2 -5
- metadata +68 -75
- data/app/controllers/concerns/post_view_for_action.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9226a2245883ac42138a159a7085f7fec750ffe32a0047aba6180198475be2b1
|
4
|
+
data.tar.gz: de4ce2858d15e93b737240a2204fe7b2edb444311e7d15dac1a41ec2e77d134c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0338d759fc7d720db08f7d6c1d9f9d7c1ce9d7313d1137e15586c5f3a183ac050c9c2bafbfca2f0de6bdab9d5857adba62192bfbbda44c7a52671bcfac2010ac'
|
7
|
+
data.tar.gz: 159779f63af0fb9be205e44ebb4f5f0dae255ff819e2b5f1432c046273a3432118876029eb3800a87101ea1766ee3a854296fe6dad83ca0232401eed696b51e4
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
20
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
21
|
end
|
22
22
|
|
23
|
-
APP_RAKEFILE = File.expand_path('
|
23
|
+
APP_RAKEFILE = File.expand_path('spec/dummy/Rakefile', __dir__)
|
24
24
|
load 'rails/tasks/engine.rake'
|
25
25
|
|
26
26
|
Bundler::GemHelper.install_tasks
|
data/Readme.md
CHANGED
@@ -68,7 +68,7 @@ The `is_news` column is being left on the `SpudPost` model for the time being to
|
|
68
68
|
|
69
69
|
TB Blog offers a mechanism for limitting who can see what posts. Supply a lambda to the `query_for_user` config, which takes a single `user` argument. The value you return will be supplied directly to the `where()` query used to find posts.
|
70
70
|
|
71
|
-
The example below is from an application that allows subscribers to view subscriber-only content.
|
71
|
+
The example below is from an application that allows subscribers to view subscriber-only content.
|
72
72
|
|
73
73
|
Spud::Blog.query_for_user = ->(user){
|
74
74
|
if !user.try(:has_paid_subscription?)
|
@@ -120,7 +120,7 @@ var clickedPreviewButton = function(e){
|
|
120
120
|
// Cross site scripting tag
|
121
121
|
var csrf = document.createElement('input');
|
122
122
|
csrf.name = 'authenticity_token';
|
123
|
-
csrf.value =
|
123
|
+
csrf.value = Rails.csrfToken();
|
124
124
|
$previewForm.append(csrf);
|
125
125
|
|
126
126
|
// Submit it
|
@@ -15,11 +15,11 @@ class Admin::PostCategoriesController < Admin::ApplicationController
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def update
|
18
|
-
if @post_category.
|
18
|
+
if @post_category.update(category_params)
|
19
19
|
flash.now[:notice] = 'Post Category was successfully updated'
|
20
20
|
respond_with @post_category, location: admin_post_categories_path
|
21
21
|
else
|
22
|
-
render 'new', status:
|
22
|
+
render 'new', status: :unprocessable_entity
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -34,7 +34,7 @@ class Admin::PostCategoriesController < Admin::ApplicationController
|
|
34
34
|
flash.now[:notice] = 'Post Category was successfully created'
|
35
35
|
respond_with @post_category, location: admin_post_categories_path
|
36
36
|
else
|
37
|
-
render 'new', status:
|
37
|
+
render 'new', status: :unprocessable_entity
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Admin::PostsController < Admin::ApplicationController
|
2
2
|
include BlogUrlHelpers
|
3
|
-
include
|
3
|
+
include RenderPostAction
|
4
4
|
|
5
5
|
respond_to :html, :xml, :json
|
6
6
|
before_action :load_blog
|
@@ -21,9 +21,7 @@ class Admin::PostsController < Admin::ApplicationController
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def update
|
24
|
-
if @post.
|
25
|
-
flash[:notice] = 'Post was successfully updated.'
|
26
|
-
end
|
24
|
+
flash[:notice] = 'Post was successfully updated.' if @post.update(post_params)
|
27
25
|
respond_with @post, location: admin_posts_path
|
28
26
|
end
|
29
27
|
|
@@ -51,11 +49,7 @@ class Admin::PostsController < Admin::ApplicationController
|
|
51
49
|
SpudPost.new
|
52
50
|
end
|
53
51
|
@post.assign_attributes(post_params)
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
def render_preview
|
58
|
-
render template: post_view_for_action(:show), controller: :posts, layout: @config.layout
|
52
|
+
render_post_action :show, controller: :posts, layout: @config.layout
|
59
53
|
end
|
60
54
|
|
61
55
|
private
|
@@ -70,9 +64,7 @@ class Admin::PostsController < Admin::ApplicationController
|
|
70
64
|
|
71
65
|
def post_params
|
72
66
|
permitted = [:published_at, :title, :content, :spud_user_id, :url_name, :visible, :comments_enabled, :meta_keywords, :meta_description, :content_format, :custom_author, category_ids: []]
|
73
|
-
if Spud::Blog.permitted_attributes.present?
|
74
|
-
permitted += Spud::Blog.permitted_attributes
|
75
|
-
end
|
67
|
+
permitted += Spud::Blog.permitted_attributes if Spud::Blog.permitted_attributes.present?
|
76
68
|
p = params.require(:spud_post).permit(permitted)
|
77
69
|
p[:updated_at] = DateTime.now
|
78
70
|
return p
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class PostsController < ApplicationController
|
2
2
|
include BlogUrlHelpers
|
3
|
-
include
|
3
|
+
include RenderPostAction
|
4
4
|
|
5
5
|
respond_to :html, :json, :rss
|
6
6
|
|
@@ -13,18 +13,18 @@ class PostsController < ApplicationController
|
|
13
13
|
@posts = @posts.search(params[:search]) if params[:search]
|
14
14
|
respond_with @posts do |format|
|
15
15
|
format.html do
|
16
|
-
|
16
|
+
render_post_action :index
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
# The sole purpose of this action is to redirect from a POST to an seo-friendly url
|
22
22
|
def filter
|
23
|
-
if
|
23
|
+
if params[:category_url_name].present? && params[:archive_date].present?
|
24
24
|
redirect_to post_category_archive_path(params[:category_url_name], params[:archive_date])
|
25
|
-
elsif
|
25
|
+
elsif params[:category_url_name].present?
|
26
26
|
redirect_to post_category_path(params[:category_url_name])
|
27
|
-
elsif
|
27
|
+
elsif params[:archive_date].present?
|
28
28
|
redirect_to post_archive_path(params[:archive_date])
|
29
29
|
else
|
30
30
|
redirect_to posts_path
|
@@ -33,26 +33,26 @@ class PostsController < ApplicationController
|
|
33
33
|
|
34
34
|
def category
|
35
35
|
if @post_category = SpudPostCategory.find_by(url_name: params[:category_url_name])
|
36
|
-
@posts = @post_category.posts.for_user(current_user).visible.for_blog(params[:blog_key]).from_archive(params[:archive_date]).paginate(page: @page_number, per_page: Spud::Blog.config.posts_per_page)
|
36
|
+
@posts = @post_category.posts.for_user(current_user).visible.for_blog(params[:blog_key]).from_archive(params[:archive_date]).ordered.paginate(page: @page_number, per_page: Spud::Blog.config.posts_per_page)
|
37
37
|
else
|
38
38
|
redirect_to posts_path
|
39
39
|
return
|
40
40
|
end
|
41
41
|
respond_with @posts do |format|
|
42
|
-
format.html {
|
42
|
+
format.html { render_post_action :index }
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
def archive
|
47
47
|
@posts = SpudPost.for_user(current_user).visible.for_blog(params[:blog_key]).from_archive(params[:archive_date]).paginate(page: @page_number, per_page: Spud::Blog.config.posts_per_page)
|
48
48
|
respond_with @posts do |format|
|
49
|
-
format.html {
|
49
|
+
format.html { render_post_action :index }
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
53
|
def show
|
54
54
|
respond_with @post do |format|
|
55
|
-
format.html {
|
55
|
+
format.html { render_post_action :show }
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -60,7 +60,7 @@ class PostsController < ApplicationController
|
|
60
60
|
|
61
61
|
def find_post
|
62
62
|
@post = SpudPost.for_user(current_user).for_blog(params[:blog_key]).where(url_name: params[:id]).first
|
63
|
-
raise
|
63
|
+
raise TbCore::NotFoundError, item: 'post' if @post.blank? || @post.is_private?
|
64
64
|
end
|
65
65
|
|
66
66
|
def load_page_number
|
@@ -81,8 +81,7 @@ class PostsController < ApplicationController
|
|
81
81
|
def load_blog
|
82
82
|
@config = SpudBlogConfig.find(params[:blog_key])
|
83
83
|
if @config.blank?
|
84
|
-
raise
|
85
|
-
return false
|
84
|
+
raise TbCore::NotFoundError(item: 'blog')
|
86
85
|
else
|
87
86
|
self.class.layout(@config.layout)
|
88
87
|
end
|
@@ -13,7 +13,7 @@ module Admin::PostsHelper
|
|
13
13
|
|
14
14
|
def link_to_disqus_comment_count(post)
|
15
15
|
# TODO: It would be great to link directly to the thread
|
16
|
-
#
|
16
|
+
# ie: https://myblog.disqus.com/admin/moderate/#/all/search/thread:4584301535
|
17
17
|
#
|
18
18
|
# However, we do not know the thread ID at this time. We may be able to fetch it
|
19
19
|
# via the Disqus JavaScript API.
|
data/app/helpers/blog_helper.rb
CHANGED
@@ -19,7 +19,7 @@ module BlogHelper
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def spud_blog_rss_link
|
22
|
-
return tag :link, rel: 'alternate', type: 'application/rss+xml', title: "#{
|
22
|
+
return tag :link, rel: 'alternate', type: 'application/rss+xml', title: "#{TbCore.site_name} Blog RSS", href: posts_path(format: :rss)
|
23
23
|
end
|
24
24
|
|
25
25
|
def disqus_comment_count_for_post(post)
|
data/app/models/spud_post.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
class SpudPostCategory < ActiveRecord::Base
|
2
|
-
spud_searchable
|
3
2
|
|
4
|
-
|
3
|
+
has_many :spud_post_categories_posts,
|
4
|
+
foreign_key: :spud_post_category_id,
|
5
|
+
inverse_of: :spud_post_category
|
6
|
+
has_many :posts,
|
5
7
|
class_name: 'SpudPost',
|
6
|
-
|
7
|
-
|
8
|
+
through: :spud_post_categories_posts,
|
9
|
+
source: :spud_post,
|
10
|
+
inverse_of: :categories
|
8
11
|
|
9
12
|
validates :name, :url_name, presence: true
|
10
13
|
validates :name, :url_name, uniqueness: true
|
@@ -1,15 +1,16 @@
|
|
1
|
-
class
|
1
|
+
class TbCore::SpudPostModel < ActiveRecord::Base
|
2
2
|
include TbRedirects::HasRedirects
|
3
3
|
|
4
4
|
self.table_name = 'spud_posts'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
has_many :spud_post_categories_posts,
|
7
|
+
foreign_key: :spud_post_id,
|
8
|
+
inverse_of: :spud_post
|
9
9
|
has_many :categories,
|
10
10
|
class_name: 'SpudPostCategory',
|
11
11
|
through: :spud_post_categories_posts,
|
12
|
-
source: :spud_post_category
|
12
|
+
source: :spud_post_category,
|
13
|
+
inverse_of: :posts
|
13
14
|
|
14
15
|
belongs_to :author, class_name: 'SpudUser', foreign_key: 'spud_user_id'
|
15
16
|
|
@@ -54,7 +55,7 @@ class Spud::SpudPostModel < ActiveRecord::Base
|
|
54
55
|
def self.from_archive(date_string)
|
55
56
|
date = Date.strptime(date_string, '%Y-%b')
|
56
57
|
return where(published_at: date..date.end_of_month)
|
57
|
-
rescue
|
58
|
+
rescue StandardError
|
58
59
|
logger.debug 'fallback'
|
59
60
|
return where('')
|
60
61
|
end
|
@@ -112,8 +113,10 @@ class Spud::SpudPostModel < ActiveRecord::Base
|
|
112
113
|
def author_name
|
113
114
|
if custom_author.present?
|
114
115
|
custom_author
|
115
|
-
|
116
|
+
elsif author.present?
|
116
117
|
author.full_name
|
118
|
+
else
|
119
|
+
''
|
117
120
|
end
|
118
121
|
end
|
119
122
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
xml.instruct! :xml, :
|
2
|
-
xml.rss :
|
1
|
+
xml.instruct! :xml, version: '1.0'
|
2
|
+
xml.rss version: '2.0' do
|
3
3
|
xml.channel do
|
4
|
-
xml.title "#{
|
5
|
-
xml.description "Blog articles for #{
|
6
|
-
xml.link posts_path(:
|
4
|
+
xml.title "#{TbCore.site_name} Blog Articles"
|
5
|
+
xml.description "Blog articles for #{TbCore.site_name}"
|
6
|
+
xml.link posts_path(format: :rss)
|
7
7
|
|
8
8
|
for article in @posts
|
9
9
|
xml.item do
|
data/lib/spud_blog/engine.rb
CHANGED
@@ -45,22 +45,22 @@ module Spud
|
|
45
45
|
url: "admin/#{config.key}",
|
46
46
|
thumbnail: 'admin/posts_thumb.png'
|
47
47
|
}
|
48
|
-
|
48
|
+
TbCore.config.admin_applications += [blog_app]
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
initializer 'tb_blog.assets' do
|
53
|
-
|
54
|
-
|
53
|
+
TbCore.append_admin_javascripts('admin/blog/application')
|
54
|
+
TbCore.append_admin_stylesheets('admin/blog/application')
|
55
55
|
Rails.application.config.assets.precompile += ['admin/posts_thumb.png', 'admin/news_thumb.png']
|
56
56
|
end
|
57
57
|
|
58
58
|
# Triggers a I18n.enforce_available_locales deprecation warning. Why?
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
59
|
+
initializer 'tb_blog.user_association', after: 'tb_core.model_overrides' do
|
60
|
+
SpudUser.class_eval do
|
61
|
+
has_many :posts, class_name: 'SpudPost', dependent: :nullify
|
62
|
+
end
|
63
|
+
end
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
data/lib/spud_blog/version.rb
CHANGED
@@ -8,7 +8,7 @@ describe Admin::PostsController, type: :controller do
|
|
8
8
|
|
9
9
|
describe '#create_redirect_if_necessary' do
|
10
10
|
before(:each) do
|
11
|
-
@post =
|
11
|
+
@post = FactoryBot.create(:spud_post)
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'should create a redirect' do
|
@@ -34,7 +34,7 @@ describe Admin::PostsController, type: :controller do
|
|
34
34
|
end
|
35
35
|
context 'with an existing post' do
|
36
36
|
it 'should set the attributes without saving' do
|
37
|
-
@post =
|
37
|
+
@post = FactoryBot.create(:spud_post)
|
38
38
|
expect do
|
39
39
|
post :preview, params: { blog_key: @post.blog_key, post_id: @post.id, spud_post: { title: 'Hello World' } }
|
40
40
|
@post.reload
|
@@ -8,7 +8,7 @@ describe PostsController, type: :controller do
|
|
8
8
|
|
9
9
|
describe 'index' do
|
10
10
|
it 'should display a list of posts' do
|
11
|
-
2.times { |_i|
|
11
|
+
2.times { |_i| FactoryBot.create(:spud_post) }
|
12
12
|
get :index, params: { blog_key: 'blog' }
|
13
13
|
expect(assigns(:posts).count).to be > 1
|
14
14
|
end
|
@@ -27,4 +27,12 @@ describe PostsController, type: :controller do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
describe 'show' do
|
31
|
+
it 'renders the post' do
|
32
|
+
post = FactoryBot.create(:spud_post)
|
33
|
+
get :show, params: { blog_key: post.blog_key, id: post.url_name }
|
34
|
+
expect(response).to have_http_status(:success)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
30
38
|
end
|
@@ -22,13 +22,6 @@ Dummy::Application.configure do
|
|
22
22
|
# Only use best-standards-support built into browsers
|
23
23
|
config.action_dispatch.best_standards_support = :builtin
|
24
24
|
|
25
|
-
# Raise exception on mass assignment protection for Active Record models
|
26
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
-
|
28
|
-
# Log the query plan for queries taking more than this (works
|
29
|
-
# with SQLite, MySQL, and PostgreSQL)
|
30
|
-
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
-
|
32
25
|
# Do not compress assets
|
33
26
|
config.assets.compress = false
|
34
27
|
|
@@ -60,8 +60,4 @@ Dummy::Application.configure do
|
|
60
60
|
|
61
61
|
# Send deprecation notices to registered listeners
|
62
62
|
config.active_support.deprecation = :notify
|
63
|
-
|
64
|
-
# Log the query plan for queries taking more than this (works
|
65
|
-
# with SQLite, MySQL, and PostgreSQL)
|
66
|
-
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
67
63
|
end
|
@@ -4,5 +4,5 @@
|
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
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
|
-
Dummy::Application.config.secret_token = '3a89d4b95c1fd9c3d43623d8e2b5a907988d00bfdbfb6de2ae26b760a49fcdc86937728b8cdf3301e4df1342c5f44a3d8d83410d857e341f1907c9c467b9bcf4'
|
7
|
+
# Dummy::Application.config.secret_token = '3a89d4b95c1fd9c3d43623d8e2b5a907988d00bfdbfb6de2ae26b760a49fcdc86937728b8cdf3301e4df1342c5f44a3d8d83410d857e341f1907c9c467b9bcf4'
|
8
8
|
Dummy::Application.config.secret_key_base = '83ed28f1288f2f059bc8f642f2acb0606ed8b46a3490bee501c1223d3acac326c325b2a97f3b984dda20828815aa123c911970579df1faaedefa21613b05630d'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This migration comes from active_storage (originally 20170806125915)
|
2
|
+
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
|
3
|
+
def change
|
4
|
+
create_table :active_storage_blobs do |t|
|
5
|
+
t.string :key, null: false
|
6
|
+
t.string :filename, null: false
|
7
|
+
t.string :content_type
|
8
|
+
t.text :metadata
|
9
|
+
t.bigint :byte_size, null: false
|
10
|
+
t.string :checksum, null: false
|
11
|
+
t.datetime :created_at, null: false
|
12
|
+
|
13
|
+
t.index [ :key ], unique: true
|
14
|
+
end
|
15
|
+
|
16
|
+
create_table :active_storage_attachments do |t|
|
17
|
+
t.string :name, null: false
|
18
|
+
t.references :record, null: false, polymorphic: true, index: false
|
19
|
+
t.references :blob, null: false
|
20
|
+
|
21
|
+
t.datetime :created_at, null: false
|
22
|
+
|
23
|
+
t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -10,117 +10,138 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 2018_07_30_141254) do
|
14
14
|
|
15
|
-
create_table "
|
16
|
-
t.string
|
17
|
-
t.string
|
15
|
+
create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
16
|
+
t.string "name", null: false
|
17
|
+
t.string "record_type", null: false
|
18
|
+
t.bigint "record_id", null: false
|
19
|
+
t.bigint "blob_id", null: false
|
20
|
+
t.datetime "created_at", null: false
|
21
|
+
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
22
|
+
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table "active_storage_blobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
26
|
+
t.string "key", null: false
|
27
|
+
t.string "filename", null: false
|
28
|
+
t.string "content_type"
|
29
|
+
t.text "metadata"
|
30
|
+
t.bigint "byte_size", null: false
|
31
|
+
t.string "checksum", null: false
|
32
|
+
t.datetime "created_at", null: false
|
33
|
+
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
34
|
+
end
|
35
|
+
|
36
|
+
create_table "spud_permissions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
37
|
+
t.string "name", null: false
|
38
|
+
t.string "tag", null: false
|
18
39
|
t.datetime "created_at"
|
19
40
|
t.datetime "updated_at"
|
20
|
-
t.index ["tag"], name: "index_spud_permissions_on_tag", unique: true
|
41
|
+
t.index ["tag"], name: "index_spud_permissions_on_tag", unique: true
|
21
42
|
end
|
22
43
|
|
23
|
-
create_table "spud_post_categories",
|
24
|
-
t.string
|
44
|
+
create_table "spud_post_categories", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
45
|
+
t.string "name"
|
25
46
|
t.datetime "created_at"
|
26
47
|
t.datetime "updated_at"
|
27
|
-
t.string
|
28
|
-
t.index ["url_name"], name: "index_spud_post_categories_on_url_name"
|
48
|
+
t.string "url_name"
|
49
|
+
t.index ["url_name"], name: "index_spud_post_categories_on_url_name"
|
29
50
|
end
|
30
51
|
|
31
|
-
create_table "spud_post_categories_posts",
|
52
|
+
create_table "spud_post_categories_posts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
32
53
|
t.integer "spud_post_id"
|
33
54
|
t.integer "spud_post_category_id"
|
34
|
-
t.index ["spud_post_category_id"], name: "index_spud_post_categories_posts_on_spud_post_category_id"
|
55
|
+
t.index ["spud_post_category_id"], name: "index_spud_post_categories_posts_on_spud_post_category_id"
|
35
56
|
end
|
36
57
|
|
37
|
-
create_table "spud_posts",
|
38
|
-
t.integer
|
39
|
-
t.string
|
40
|
-
t.text
|
41
|
-
t.boolean
|
42
|
-
t.boolean
|
58
|
+
create_table "spud_posts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
59
|
+
t.integer "spud_user_id"
|
60
|
+
t.string "title"
|
61
|
+
t.text "content"
|
62
|
+
t.boolean "comments_enabled", default: false
|
63
|
+
t.boolean "visible", default: true
|
43
64
|
t.datetime "published_at"
|
44
65
|
t.datetime "created_at"
|
45
66
|
t.datetime "updated_at"
|
46
|
-
t.string
|
47
|
-
t.boolean
|
48
|
-
t.string
|
49
|
-
t.text
|
50
|
-
t.string
|
51
|
-
t.text
|
52
|
-
t.string
|
53
|
-
t.string
|
54
|
-
t.string
|
55
|
-
t.index ["blog_key"], name: "index_spud_posts_on_blog_key"
|
56
|
-
t.index ["identifier"], name: "index_spud_posts_on_identifier", unique: true
|
57
|
-
t.index ["is_news"], name: "index_spud_posts_on_is_news"
|
58
|
-
t.index ["spud_user_id"], name: "index_spud_posts_on_spud_user_id"
|
59
|
-
t.index ["url_name"], name: "index_spud_posts_on_url_name"
|
60
|
-
t.index ["visible"], name: "index_spud_posts_on_visible"
|
67
|
+
t.string "url_name"
|
68
|
+
t.boolean "is_news", default: false
|
69
|
+
t.string "meta_keywords"
|
70
|
+
t.text "meta_description"
|
71
|
+
t.string "content_format", default: "HTML"
|
72
|
+
t.text "content_processed"
|
73
|
+
t.string "blog_key"
|
74
|
+
t.string "custom_author"
|
75
|
+
t.string "identifier"
|
76
|
+
t.index ["blog_key"], name: "index_spud_posts_on_blog_key"
|
77
|
+
t.index ["identifier"], name: "index_spud_posts_on_identifier", unique: true
|
78
|
+
t.index ["is_news"], name: "index_spud_posts_on_is_news"
|
79
|
+
t.index ["spud_user_id"], name: "index_spud_posts_on_spud_user_id"
|
80
|
+
t.index ["url_name"], name: "index_spud_posts_on_url_name"
|
81
|
+
t.index ["visible"], name: "index_spud_posts_on_visible"
|
61
82
|
end
|
62
83
|
|
63
|
-
create_table "spud_role_permissions",
|
64
|
-
t.integer
|
65
|
-
t.string
|
84
|
+
create_table "spud_role_permissions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
85
|
+
t.integer "spud_role_id", null: false
|
86
|
+
t.string "spud_permission_tag", null: false
|
66
87
|
t.datetime "created_at"
|
67
88
|
t.datetime "updated_at"
|
68
|
-
t.index ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag"
|
69
|
-
t.index ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id"
|
89
|
+
t.index ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag"
|
90
|
+
t.index ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id"
|
70
91
|
end
|
71
92
|
|
72
|
-
create_table "spud_roles",
|
73
|
-
t.string
|
93
|
+
create_table "spud_roles", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
94
|
+
t.string "name"
|
74
95
|
t.datetime "created_at"
|
75
96
|
t.datetime "updated_at"
|
76
97
|
end
|
77
98
|
|
78
|
-
create_table "spud_user_settings",
|
79
|
-
t.integer
|
80
|
-
t.string
|
81
|
-
t.string
|
99
|
+
create_table "spud_user_settings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
100
|
+
t.integer "spud_user_id"
|
101
|
+
t.string "key"
|
102
|
+
t.string "value"
|
82
103
|
t.datetime "created_at"
|
83
104
|
t.datetime "updated_at"
|
84
105
|
end
|
85
106
|
|
86
|
-
create_table "spud_users",
|
87
|
-
t.string
|
88
|
-
t.string
|
89
|
-
t.boolean
|
90
|
-
t.string
|
91
|
-
t.string
|
92
|
-
t.string
|
93
|
-
t.string
|
94
|
-
t.string
|
95
|
-
t.string
|
96
|
-
t.string
|
97
|
-
t.integer
|
98
|
-
t.integer
|
107
|
+
create_table "spud_users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
108
|
+
t.string "first_name"
|
109
|
+
t.string "last_name"
|
110
|
+
t.boolean "super_admin"
|
111
|
+
t.string "login", null: false
|
112
|
+
t.string "email", null: false
|
113
|
+
t.string "crypted_password", null: false
|
114
|
+
t.string "password_salt", null: false
|
115
|
+
t.string "persistence_token", null: false
|
116
|
+
t.string "single_access_token", null: false
|
117
|
+
t.string "perishable_token", null: false
|
118
|
+
t.integer "login_count", default: 0, null: false
|
119
|
+
t.integer "failed_login_count", default: 0, null: false
|
99
120
|
t.datetime "last_request_at"
|
100
121
|
t.datetime "current_login_at"
|
101
122
|
t.datetime "last_login_at"
|
102
|
-
t.string
|
103
|
-
t.string
|
123
|
+
t.string "current_login_ip"
|
124
|
+
t.string "last_login_ip"
|
104
125
|
t.datetime "created_at"
|
105
126
|
t.datetime "updated_at"
|
106
|
-
t.string
|
107
|
-
t.integer
|
108
|
-
t.boolean
|
109
|
-
t.index ["email"], name: "index_spud_users_on_email"
|
110
|
-
t.index ["login"], name: "index_spud_users_on_login"
|
111
|
-
t.index ["spud_role_id"], name: "index_spud_users_on_spud_role_id"
|
127
|
+
t.string "time_zone"
|
128
|
+
t.integer "spud_role_id"
|
129
|
+
t.boolean "requires_password_change", default: false
|
130
|
+
t.index ["email"], name: "index_spud_users_on_email"
|
131
|
+
t.index ["login"], name: "index_spud_users_on_login"
|
132
|
+
t.index ["spud_role_id"], name: "index_spud_users_on_spud_role_id"
|
112
133
|
end
|
113
134
|
|
114
|
-
create_table "tb_redirects",
|
115
|
-
t.string
|
116
|
-
t.integer
|
117
|
-
t.string
|
118
|
-
t.string
|
119
|
-
t.string
|
120
|
-
t.datetime "created_at",
|
121
|
-
t.datetime "updated_at",
|
122
|
-
t.index ["owner_type", "owner_id"], name: "index_tb_redirects_on_owner_type_and_owner_id"
|
123
|
-
t.index ["source"], name: "index_tb_redirects_on_source", unique: true
|
135
|
+
create_table "tb_redirects", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
136
|
+
t.string "owner_type"
|
137
|
+
t.integer "owner_id"
|
138
|
+
t.string "source", null: false
|
139
|
+
t.string "destination", null: false
|
140
|
+
t.string "created_by"
|
141
|
+
t.datetime "created_at", null: false
|
142
|
+
t.datetime "updated_at", null: false
|
143
|
+
t.index ["owner_type", "owner_id"], name: "index_tb_redirects_on_owner_type_and_owner_id"
|
144
|
+
t.index ["source"], name: "index_tb_redirects_on_source", unique: true
|
124
145
|
end
|
125
146
|
|
126
147
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
|
3
3
|
sequence :spud_post_title do |n|
|
4
4
|
"Test Blog Post #{n}"
|
5
5
|
end
|
6
6
|
|
7
7
|
factory :spud_post do
|
8
|
-
author {
|
9
|
-
title {
|
8
|
+
author { FactoryBot.create(:spud_user) }
|
9
|
+
title { FactoryBot.generate(:spud_post_title) }
|
10
10
|
content 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
11
11
|
comments_enabled true
|
12
12
|
visible true
|
@@ -4,7 +4,7 @@ RSpec.describe Admin::PostsHelper, type: :helper do
|
|
4
4
|
|
5
5
|
describe '#link_to_disqus_comment_count' do
|
6
6
|
it 'should return a link with the disqus identifier' do
|
7
|
-
post =
|
7
|
+
post = FactoryBot.create(:spud_post)
|
8
8
|
result = helper.link_to_disqus_comment_count(post)
|
9
9
|
|
10
10
|
expect(result).to include("data-disqus-identifier=\"#{post.identifier}\"")
|
@@ -4,7 +4,7 @@ RSpec.describe BlogHelper, type: :helper do
|
|
4
4
|
|
5
5
|
describe '#disqus_comment_count_for_post' do
|
6
6
|
it 'should return a tag with the disqus identifier' do
|
7
|
-
post =
|
7
|
+
post = FactoryBot.create(:spud_post)
|
8
8
|
result = helper.disqus_comment_count_for_post(post)
|
9
9
|
expect(result).to include("data-disqus-identifier=\"#{post.identifier}\"")
|
10
10
|
end
|
@@ -4,14 +4,14 @@ RSpec.describe SpudPost, type: :model do
|
|
4
4
|
|
5
5
|
describe '#display_date' do
|
6
6
|
it 'should return a date string' do
|
7
|
-
post =
|
7
|
+
post = FactoryBot.create(:spud_post)
|
8
8
|
expect(post.display_date).to eq(post.published_at.strftime('%b %d, %Y'))
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe '#set_identifier' do
|
13
13
|
it 'should set a random identifier' do
|
14
|
-
post =
|
14
|
+
post = FactoryBot.create(:spud_post, identifier: nil)
|
15
15
|
expect(post.identifier).to be_a(String)
|
16
16
|
end
|
17
17
|
end
|
data/spec/rails_helper.rb
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
2
|
ENV['RAILS_ENV'] ||= 'test'
|
3
3
|
|
4
|
-
require File.expand_path('
|
4
|
+
require File.expand_path('dummy/config/environment.rb', __dir__)
|
5
5
|
require 'spec_helper'
|
6
6
|
require 'rspec/rails'
|
7
7
|
require 'rails-controller-testing'
|
8
8
|
require 'database_cleaner'
|
9
|
-
require '
|
10
|
-
require 'factory_girl_rails'
|
9
|
+
require 'factory_bot_rails'
|
11
10
|
require 'tb_core/test_helper'
|
12
11
|
|
13
|
-
SimpleCov.start 'rails'
|
14
|
-
|
15
12
|
# Add additional requires below this line. Rails is not loaded until this point!
|
16
13
|
|
17
14
|
# Requires supporting ruby files with custom matchers and macros, etc, in
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tb_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moser Consulting
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.5.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: tb_redirects
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0
|
47
|
+
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0
|
54
|
+
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: truncate_html
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: database_cleaner
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: factory_bot_rails
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,35 +95,27 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: pg
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
103
|
+
version: '0.18'
|
104
|
+
- - "<"
|
109
105
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: factory_girl_rails
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
106
|
+
version: '2.0'
|
118
107
|
type: :development
|
119
108
|
prerelease: false
|
120
109
|
version_requirements: !ruby/object:Gem::Requirement
|
121
110
|
requirements:
|
122
111
|
- - ">="
|
123
112
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
113
|
+
version: '0.18'
|
114
|
+
- - "<"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '2.0'
|
125
117
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
118
|
+
name: rails-controller-testing
|
127
119
|
requirement: !ruby/object:Gem::Requirement
|
128
120
|
requirements:
|
129
121
|
- - ">="
|
@@ -137,7 +129,7 @@ dependencies:
|
|
137
129
|
- !ruby/object:Gem::Version
|
138
130
|
version: '0'
|
139
131
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
132
|
+
name: rspec-rails
|
141
133
|
requirement: !ruby/object:Gem::Requirement
|
142
134
|
requirements:
|
143
135
|
- - ">="
|
@@ -183,7 +175,7 @@ files:
|
|
183
175
|
- app/controllers/admin/post_categories_controller.rb
|
184
176
|
- app/controllers/admin/posts_controller.rb
|
185
177
|
- app/controllers/concerns/blog_url_helpers.rb
|
186
|
-
- app/controllers/concerns/
|
178
|
+
- app/controllers/concerns/render_post_action.rb
|
187
179
|
- app/controllers/posts_controller.rb
|
188
180
|
- app/helpers/admin/news_posts_helper.rb
|
189
181
|
- app/helpers/admin/post_categories_helper.rb
|
@@ -191,12 +183,12 @@ files:
|
|
191
183
|
- app/helpers/blog/sitemaps_helper.rb
|
192
184
|
- app/helpers/blog_helper.rb
|
193
185
|
- app/helpers/news_helper.rb
|
194
|
-
- app/models/spud/spud_post_model.rb
|
195
186
|
- app/models/spud_blog_config.rb
|
196
187
|
- app/models/spud_post.rb
|
197
188
|
- app/models/spud_post_categories_post.rb
|
198
189
|
- app/models/spud_post_category.rb
|
199
190
|
- app/models/spud_post_site.rb
|
191
|
+
- app/models/tb_core/spud_post_model.rb
|
200
192
|
- app/views/admin/post_categories/_category.html.erb
|
201
193
|
- app/views/admin/post_categories/_form.html.erb
|
202
194
|
- app/views/admin/post_categories/edit.html.erb
|
@@ -294,6 +286,7 @@ files:
|
|
294
286
|
- spec/dummy/db/migrate/20161020155450_drop_spud_post_sites.tb_blog.rb
|
295
287
|
- spec/dummy/db/migrate/20161020155451_add_custom_author_to_post.tb_blog.rb
|
296
288
|
- spec/dummy/db/migrate/20161020155452_add_identifier_to_spud_posts.tb_blog.rb
|
289
|
+
- spec/dummy/db/migrate/20180730141254_create_active_storage_tables.active_storage.rb
|
297
290
|
- spec/dummy/db/schema.rb
|
298
291
|
- spec/dummy/public/404.html
|
299
292
|
- spec/dummy/public/422.html
|
@@ -309,7 +302,7 @@ files:
|
|
309
302
|
homepage: http://bitbucket.org/moser-inc/tb_blog
|
310
303
|
licenses: []
|
311
304
|
metadata: {}
|
312
|
-
post_install_message:
|
305
|
+
post_install_message:
|
313
306
|
rdoc_options: []
|
314
307
|
require_paths:
|
315
308
|
- lib
|
@@ -324,74 +317,74 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
324
317
|
- !ruby/object:Gem::Version
|
325
318
|
version: '0'
|
326
319
|
requirements: []
|
327
|
-
|
328
|
-
|
329
|
-
signing_key:
|
320
|
+
rubygems_version: 3.1.6
|
321
|
+
signing_key:
|
330
322
|
specification_version: 4
|
331
323
|
summary: Twice Baked Blog Engine.
|
332
324
|
test_files:
|
333
|
-
- spec/
|
334
|
-
- spec/controllers/
|
335
|
-
- spec/
|
325
|
+
- spec/spec_helper.rb
|
326
|
+
- spec/dummy/app/controllers/application_controller.rb
|
327
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
336
328
|
- spec/dummy/app/assets/javascripts/application.js
|
337
329
|
- spec/dummy/app/assets/stylesheets/application.css
|
338
|
-
- spec/dummy/app/controllers/application_controller.rb
|
339
330
|
- spec/dummy/app/helpers/application_helper.rb
|
340
|
-
- spec/dummy/
|
341
|
-
- spec/dummy/config/
|
342
|
-
- spec/dummy/config/boot.rb
|
343
|
-
- spec/dummy/config/database.yml
|
344
|
-
- spec/dummy/config/environment.rb
|
345
|
-
- spec/dummy/config/environments/development.rb
|
331
|
+
- spec/dummy/config/routes.rb
|
332
|
+
- spec/dummy/config/locales/en.yml
|
346
333
|
- spec/dummy/config/environments/production.rb
|
334
|
+
- spec/dummy/config/environments/development.rb
|
347
335
|
- spec/dummy/config/environments/test.rb
|
336
|
+
- spec/dummy/config/environment.rb
|
337
|
+
- spec/dummy/config/application.rb
|
338
|
+
- spec/dummy/config/database.yml
|
339
|
+
- spec/dummy/config/boot.rb
|
348
340
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
349
|
-
- spec/dummy/config/initializers/inflections.rb
|
350
341
|
- spec/dummy/config/initializers/mime_types.rb
|
351
|
-
- spec/dummy/config/initializers/secret_token.rb
|
352
342
|
- spec/dummy/config/initializers/session_store.rb
|
353
343
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
354
|
-
- spec/dummy/config/
|
355
|
-
- spec/dummy/config/
|
344
|
+
- spec/dummy/config/initializers/secret_token.rb
|
345
|
+
- spec/dummy/config/initializers/inflections.rb
|
356
346
|
- spec/dummy/config.ru
|
357
|
-
- spec/dummy/
|
358
|
-
- spec/dummy/
|
359
|
-
- spec/dummy/
|
360
|
-
- spec/dummy/
|
361
|
-
- spec/dummy/
|
362
|
-
- spec/dummy/
|
347
|
+
- spec/dummy/script/rails
|
348
|
+
- spec/dummy/Rakefile
|
349
|
+
- spec/dummy/public/favicon.ico
|
350
|
+
- spec/dummy/public/422.html
|
351
|
+
- spec/dummy/public/500.html
|
352
|
+
- spec/dummy/public/404.html
|
353
|
+
- spec/dummy/db/schema.rb
|
363
354
|
- spec/dummy/db/migrate/20161020155431_create_spud_permissions.tb_core.rb
|
364
|
-
- spec/dummy/db/migrate/20161020155432_create_spud_role_permissions.tb_core.rb
|
365
|
-
- spec/dummy/db/migrate/20161020155433_drop_spud_admin_permissions.tb_core.rb
|
366
|
-
- spec/dummy/db/migrate/20161020155434_add_requires_password_change_to_spud_users.tb_core.rb
|
367
355
|
- spec/dummy/db/migrate/20161020155435_create_tb_redirects.tb_redirects.rb
|
356
|
+
- spec/dummy/db/migrate/20161020155425_create_spud_admin_permissions.tb_core.rb
|
357
|
+
- spec/dummy/db/migrate/20161020155442_add_meta_to_posts.tb_blog.rb
|
358
|
+
- spec/dummy/db/migrate/20161020155428_add_scope_to_spud_admin_permissions.tb_core.rb
|
368
359
|
- spec/dummy/db/migrate/20161020155437_create_spud_posts.tb_blog.rb
|
369
360
|
- spec/dummy/db/migrate/20161020155438_create_spud_post_categories.tb_blog.rb
|
370
|
-
- spec/dummy/db/migrate/20161020155439_add_url_to_spud_posts.tb_blog.rb
|
371
|
-
- spec/dummy/db/migrate/20161020155440_add_url_to_spud_post_categories.tb_blog.rb
|
372
|
-
- spec/dummy/db/migrate/20161020155441_add_is_news_to_spud_posts.tb_blog.rb
|
373
|
-
- spec/dummy/db/migrate/20161020155442_add_meta_to_posts.tb_blog.rb
|
374
|
-
- spec/dummy/db/migrate/20161020155443_create_spud_post_sites.tb_blog.rb
|
375
|
-
- spec/dummy/db/migrate/20161020155444_add_nested_set_to_post_categories.tb_blog.rb
|
376
361
|
- spec/dummy/db/migrate/20161020155445_add_content_format_to_spud_posts.tb_blog.rb
|
377
|
-
- spec/dummy/db/migrate/
|
378
|
-
- spec/dummy/db/migrate/
|
379
|
-
- spec/dummy/db/migrate/20161020155448_remove_awesome_nested_set_columns_from_spud_post_categories.tb_blog.rb
|
362
|
+
- spec/dummy/db/migrate/20180730141254_create_active_storage_tables.active_storage.rb
|
363
|
+
- spec/dummy/db/migrate/20161020155433_drop_spud_admin_permissions.tb_core.rb
|
380
364
|
- spec/dummy/db/migrate/20161020155449_add_blog_key_to_spud_posts.tb_blog.rb
|
365
|
+
- spec/dummy/db/migrate/20161020155432_create_spud_role_permissions.tb_core.rb
|
381
366
|
- spec/dummy/db/migrate/20161020155450_drop_spud_post_sites.tb_blog.rb
|
367
|
+
- spec/dummy/db/migrate/20161020155427_add_time_zone_to_spud_user.tb_core.rb
|
368
|
+
- spec/dummy/db/migrate/20161020155429_create_spud_user_settings.tb_core.rb
|
382
369
|
- spec/dummy/db/migrate/20161020155451_add_custom_author_to_post.tb_blog.rb
|
370
|
+
- spec/dummy/db/migrate/20161020155440_add_url_to_spud_post_categories.tb_blog.rb
|
371
|
+
- spec/dummy/db/migrate/20161020155426_create_spud_users.tb_core.rb
|
372
|
+
- spec/dummy/db/migrate/20161020155444_add_nested_set_to_post_categories.tb_blog.rb
|
373
|
+
- spec/dummy/db/migrate/20161020155439_add_url_to_spud_posts.tb_blog.rb
|
374
|
+
- spec/dummy/db/migrate/20161020155448_remove_awesome_nested_set_columns_from_spud_post_categories.tb_blog.rb
|
375
|
+
- spec/dummy/db/migrate/20161020155443_create_spud_post_sites.tb_blog.rb
|
376
|
+
- spec/dummy/db/migrate/20161020155430_create_spud_roles.tb_core.rb
|
377
|
+
- spec/dummy/db/migrate/20161020155447_add_primary_key_to_spud_post_categories_posts.tb_blog.rb
|
378
|
+
- spec/dummy/db/migrate/20161020155441_add_is_news_to_spud_posts.tb_blog.rb
|
383
379
|
- spec/dummy/db/migrate/20161020155452_add_identifier_to_spud_posts.tb_blog.rb
|
384
|
-
- spec/dummy/db/
|
385
|
-
- spec/dummy/
|
386
|
-
- spec/dummy/public/422.html
|
387
|
-
- spec/dummy/public/500.html
|
388
|
-
- spec/dummy/public/favicon.ico
|
389
|
-
- spec/dummy/Rakefile
|
380
|
+
- spec/dummy/db/migrate/20161020155446_add_content_processed_to_spud_post.tb_blog.rb
|
381
|
+
- spec/dummy/db/migrate/20161020155434_add_requires_password_change_to_spud_users.tb_core.rb
|
390
382
|
- spec/dummy/README.rdoc
|
391
|
-
- spec/
|
383
|
+
- spec/models/spud_post_spec.rb
|
392
384
|
- spec/factories/spud_post_factories.rb
|
385
|
+
- spec/controllers/posts_controller_spec.rb
|
386
|
+
- spec/controllers/admin/posts_controller_spec.rb
|
387
|
+
- spec/rails_helper.rb
|
393
388
|
- spec/helpers/admin/posts_helper_spec.rb
|
394
389
|
- spec/helpers/blog_helper_spec.rb
|
395
|
-
- spec/
|
396
|
-
- spec/rails_helper.rb
|
397
|
-
- spec/spec_helper.rb
|
390
|
+
- spec/authlogic_helper.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module PostViewForAction
|
2
|
-
extend ActiveSupport::Concern
|
3
|
-
|
4
|
-
def post_view_for_action(action)
|
5
|
-
if File.exist?(Rails.root.join("app/views/#{@config.key}/#{action}.html.erb"))
|
6
|
-
return "/#{@config.key}/#{action}"
|
7
|
-
else
|
8
|
-
return "/posts/#{action}"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|