tb_blog 1.4.3 → 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/Readme.md +1 -1
- data/app/models/spud_post_category.rb +7 -3
- data/app/models/tb_core/spud_post_model.rb +5 -2
- data/lib/spud_blog/version.rb +1 -1
- data/spec/rails_helper.rb +0 -3
- metadata +16 -25
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/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?)
|
@@ -1,9 +1,13 @@
|
|
1
1
|
class SpudPostCategory < ActiveRecord::Base
|
2
2
|
|
3
|
-
|
3
|
+
has_many :spud_post_categories_posts,
|
4
|
+
foreign_key: :spud_post_category_id,
|
5
|
+
inverse_of: :spud_post_category
|
6
|
+
has_many :posts,
|
4
7
|
class_name: 'SpudPost',
|
5
|
-
|
6
|
-
|
8
|
+
through: :spud_post_categories_posts,
|
9
|
+
source: :spud_post,
|
10
|
+
inverse_of: :categories
|
7
11
|
|
8
12
|
validates :name, :url_name, presence: true
|
9
13
|
validates :name, :url_name, uniqueness: true
|
@@ -3,11 +3,14 @@ class TbCore::SpudPostModel < ActiveRecord::Base
|
|
3
3
|
|
4
4
|
self.table_name = 'spud_posts'
|
5
5
|
|
6
|
-
has_many :spud_post_categories_posts,
|
6
|
+
has_many :spud_post_categories_posts,
|
7
|
+
foreign_key: :spud_post_id,
|
8
|
+
inverse_of: :spud_post
|
7
9
|
has_many :categories,
|
8
10
|
class_name: 'SpudPostCategory',
|
9
11
|
through: :spud_post_categories_posts,
|
10
|
-
source: :spud_post_category
|
12
|
+
source: :spud_post_category,
|
13
|
+
inverse_of: :posts
|
11
14
|
|
12
15
|
belongs_to :author, class_name: 'SpudUser', foreign_key: 'spud_user_id'
|
13
16
|
|
data/lib/spud_blog/version.rb
CHANGED
data/spec/rails_helper.rb
CHANGED
@@ -6,12 +6,9 @@ require 'spec_helper'
|
|
6
6
|
require 'rspec/rails'
|
7
7
|
require 'rails-controller-testing'
|
8
8
|
require 'database_cleaner'
|
9
|
-
require 'simplecov'
|
10
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
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
|
@@ -95,19 +95,25 @@ 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'
|
103
|
+
version: '0.18'
|
104
|
+
- - "<"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '2.0'
|
104
107
|
type: :development
|
105
108
|
prerelease: false
|
106
109
|
version_requirements: !ruby/object:Gem::Requirement
|
107
110
|
requirements:
|
108
111
|
- - ">="
|
109
112
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
113
|
+
version: '0.18'
|
114
|
+
- - "<"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '2.0'
|
111
117
|
- !ruby/object:Gem::Dependency
|
112
118
|
name: rails-controller-testing
|
113
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,20 +156,6 @@ dependencies:
|
|
150
156
|
- - ">="
|
151
157
|
- !ruby/object:Gem::Version
|
152
158
|
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: simplecov
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
159
|
description: Twice Baked blogging/news and rss engine.
|
168
160
|
email:
|
169
161
|
- greg.woods@moserit.com
|
@@ -325,8 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
325
317
|
- !ruby/object:Gem::Version
|
326
318
|
version: '0'
|
327
319
|
requirements: []
|
328
|
-
|
329
|
-
rubygems_version: 2.6.12
|
320
|
+
rubygems_version: 3.1.6
|
330
321
|
signing_key:
|
331
322
|
specification_version: 4
|
332
323
|
summary: Twice Baked Blog Engine.
|