effective_posts 2.4.0 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/post.rb +7 -3
- data/lib/effective_posts/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84c27105c23c603f005a3389dba3e7f04a13c88e9d46f0fe7c135a1b5f40bf07
|
4
|
+
data.tar.gz: d9d1637b7f30a5190455e5337848ad6fcbffe129d943483ccadeb8f611e426b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb22ed3626f8637052610a9d7a12cc9a08ea3bf09589953e3a7d1ee681e1f6ff73c7f250f00eb612ed7e50567f0515667c0a33c817cddcef09fb3f3bf8455266
|
7
|
+
data.tar.gz: 4ea9ec43edfd22c8c37ef8348757d8c2e4ce4208168be17a0cf93b0490df235d2b59a0cba0b679313ce1fb79941b8e4ea1ac36418c7c98b1e8057476fae213b6
|
@@ -57,15 +57,19 @@ module Effective
|
|
57
57
|
validates :start_at, presence: true, if: -> { category == 'events' }
|
58
58
|
|
59
59
|
scope :drafts, -> { where(draft: true) }
|
60
|
-
scope :published, -> { where(draft: false).where("
|
61
|
-
scope :unpublished, -> { where(draft: true).or(where("
|
60
|
+
scope :published, -> { where(draft: false).where("published_at < ?", Time.zone.now) }
|
61
|
+
scope :unpublished, -> { where(draft: true).or(where("published_at > ?", Time.zone.now)) }
|
62
62
|
scope :with_category, -> (category) { where(category: category) }
|
63
63
|
|
64
64
|
# Kind of a meta category
|
65
65
|
scope :news, -> { where(category: EffectivePosts.news_categories) }
|
66
66
|
scope :events, -> { where(category: EffectivePosts.event_categories) }
|
67
67
|
|
68
|
-
scope :deep, -> {
|
68
|
+
scope :deep, -> {
|
69
|
+
base = with_rich_text_excerpt_and_embeds.with_rich_text_body_and_embeds
|
70
|
+
base = base.includes(:pg_search_document) if defined?(PgSearch)
|
71
|
+
base
|
72
|
+
}
|
69
73
|
|
70
74
|
scope :paginate, -> (page: nil, per_page: EffectivePosts.per_page) {
|
71
75
|
page = (page || 1).to_i
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_posts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|