effective_posts 2.4.0 → 2.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3e7d5a92cf4a3f30a7d1adb086578d39ce41162c2d3a36115cceaa2ef7ff564
4
- data.tar.gz: 8f0ce9dc2350f5c1e16055bf93635218250a913f267b5771a02b8f0d25eb59d9
3
+ metadata.gz: 84c27105c23c603f005a3389dba3e7f04a13c88e9d46f0fe7c135a1b5f40bf07
4
+ data.tar.gz: d9d1637b7f30a5190455e5337848ad6fcbffe129d943483ccadeb8f611e426b4
5
5
  SHA512:
6
- metadata.gz: 6135e7161d3d75428f72907e652b91cbf7468b9ab8b107121ba2f6a645fce47b7c0c0414b8bad01b7f943b591d8fc21b926234a52f770a32327ab86968dba3b5
7
- data.tar.gz: be804eb10157afd5b90b23504b0330f4a38c98debc232fdb2974bc5d26ff4ff390cc9e847e84f26b8e0ce6a038c73d97f162d781a28179297c9418707ca1d5a1
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("#{EffectivePosts.posts_table_name}.published_at < ?", Time.zone.now) }
61
- scope :unpublished, -> { where(draft: true).or(where("#{EffectivePosts.posts_table_name}.published_at > ?", Time.zone.now)) }
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, -> { with_rich_text_excerpt_and_embeds.with_rich_text_body_and_embeds }
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
@@ -1,3 +1,3 @@
1
1
  module EffectivePosts
2
- VERSION = '2.4.0'.freeze
2
+ VERSION = '2.4.2'.freeze
3
3
  end
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.0
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-08-24 00:00:00.000000000 Z
11
+ date: 2023-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails