workarea-blog 3.4.7 → 3.4.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1c8e1727a95ff4cd8f73da3558b384924fcaf8fff71ef322f4f5af28a7054ea
4
- data.tar.gz: c1fbb6fdf5b849405aec0ad85e480857bbc21a8ac735f5825ed56040d0ba9339
3
+ metadata.gz: 5e87f8cf05f4855dc05e2a61e1df898971902d7408e691db8c5d70a25e4194fc
4
+ data.tar.gz: 5fa1624cd20946a0a29c968d6861a457dead106368c55cc438dafba48629a961
5
5
  SHA512:
6
- metadata.gz: e0226d6237319795f8e6598e052cac59f1679fd3d4b58a7dfdf9c986a1259fcebb45445e40933feb987ee0e5ec88a7ea675d7a9607cf911ac5348655be130461
7
- data.tar.gz: 1043b6310f5634704e21cf2f0eef1212771faf690ba3c2b6eded8b8ac52eaec1b14e5fdbe0319c328e126b9aa71d60e98d8d6640e60a8857154b6b58e0ea3fc2
6
+ metadata.gz: 7bfd69d488b23f9616d981b78c100513c49110cedfd6232924d44295c4b4f4e88d01924a7409f607f30f3bab8105c3e1ba8e2686db556b8c1350c252ac9a45f3
7
+ data.tar.gz: b7125a6748b4ed90bf72f32150e0b64fe298b37d692e961a93594a103a49dd060a6e2d339ce5d83a2eec0e77b0694ab7f8b760701a356008fd2221a19c7918d5
data/.gitignore CHANGED
@@ -12,5 +12,5 @@ test/dummy/tmp/
12
12
  test/dummy/public/
13
13
  node_modules
14
14
  test/reports
15
- package.json
16
15
  yarn.lock
16
+ .rubocop-http*
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ Workarea Blog 3.4.8 (2019-10-01)
2
+ --------------------------------------------------------------------------------
3
+
4
+ * Fix Blog Entries Total Count
5
+
6
+ The `#total` method on `Storefront::BlogEntryViewModel` was not
7
+ returning the actual total amount of entries if they exceeded 25, due to
8
+ Kaminari's default pagination. Use `scoped_entries.total_count` here to
9
+ avoid the problem.
10
+ Tom Scott
11
+
12
+
13
+
1
14
  Workarea Blog 3.4.7 (2019-08-21)
2
15
  --------------------------------------------------------------------------------
3
16
 
data/Rakefile CHANGED
@@ -27,10 +27,10 @@ desc "Release version #{Workarea::Blog::VERSION} of the gem"
27
27
  task :release do
28
28
  host = "https://#{ENV['BUNDLE_GEMS__WEBLINC__COM']}@gems.weblinc.com"
29
29
 
30
- #Rake::Task['workarea:changelog'].execute
31
- #system 'git add CHANGELOG.md'
32
- #system 'git commit -m "Update CHANGELOG"'
33
- #system 'git push origin HEAD'
30
+ Rake::Task['workarea:changelog'].execute
31
+ system 'git add CHANGELOG.md'
32
+ system 'git commit -m "Update CHANGELOG"'
33
+ system 'git push origin HEAD'
34
34
 
35
35
  system "git tag -a v#{Workarea::Blog::VERSION} -m 'Tagging #{Workarea::Blog::VERSION}'"
36
36
  system 'git push --tags'
@@ -40,7 +40,7 @@ module Workarea
40
40
  end
41
41
 
42
42
  def total
43
- @total ||= scoped_entries.count
43
+ @total ||= scoped_entries.total_count
44
44
  end
45
45
 
46
46
  def page
@@ -1,5 +1,5 @@
1
1
  module Workarea
2
2
  module Blog
3
- VERSION = '3.4.7'.freeze
3
+ VERSION = '3.4.8'.freeze
4
4
  end
5
5
  end
@@ -143,6 +143,29 @@ module Workarea
143
143
  refute newly_published.empty?
144
144
  end
145
145
  end
146
+
147
+ def test_total
148
+ release = create_release(publish_at: 1.hour.from_now, published_at: nil)
149
+ 26.times do
150
+ @blog.entries.create!(name: 'Test', author: 'BC', active: true)
151
+ @blog.entries.create!(name: 'Unpublished', author: 'BC', active: false)
152
+ end
153
+ release.as_current do
154
+ @blog.entries.where(name: 'Unpublished').each do |entry|
155
+ entry.update!(active: true)
156
+ end
157
+ end
158
+
159
+ view_model = Workarea::Storefront::BlogViewModel.new(@blog)
160
+
161
+ assert_equal(26, view_model.total)
162
+
163
+ release.as_current do
164
+ view_model = Workarea::Storefront::BlogViewModel.new(@blog.reload)
165
+
166
+ assert_equal(52, view_model.total)
167
+ end
168
+ end
146
169
  end
147
170
  end
148
171
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.7
4
+ version: 3.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - bcrouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-21 00:00:00.000000000 Z
11
+ date: 2019-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  - !ruby/object:Gem::Version
268
268
  version: '0'
269
269
  requirements: []
270
- rubygems_version: 3.0.4
270
+ rubygems_version: 3.0.6
271
271
  signing_key:
272
272
  specification_version: 4
273
273
  summary: Blog plugin for Workarea.