effective_posts 0.6.0 → 0.6.3

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: 619b60cdeab2dc4b8c5fbf2c474229c38e1c94204e8f965e99c0643b41f18f6a
4
- data.tar.gz: 9320a4b52e915ccf5481442bc462f1c99ae61e906001aa5f8fe077760855662b
3
+ metadata.gz: ca0ef37ecec36ad5e970fbf822f04bba0b3467a5e742bf9e58e50848ed245dee
4
+ data.tar.gz: 7161bb9f8b1fffd7cbdc371dca5d6f116b25fcbb50003ba23c424d0b9b6fe1ba
5
5
  SHA512:
6
- metadata.gz: 6571abfbafda8e103e27b351e4890bf2677038067d36afd74fe909658c2b5ec8ccd8573e17fe1af9548402fe8bc4e45216e24b1306878046c49670a368e03a4a
7
- data.tar.gz: cd79acfe803d349f1996a40d9c05a04f396fce36459b8b2ef95ac1c9dcbbff4751b54472c55ea05ad755aed44dc92f62539fde452c18341607cd79b0c87fd6eb
6
+ metadata.gz: 63c223415032de3e6e7ab000c9f5be639dcb2c449ca7ced5e0ef4a6474afc0562b63d3e9a29c3ddb57900804f0443a0c12bd55d70551d360db8ebfdbcb0b31bf
7
+ data.tar.gz: 8d858bd780ccb72acaf7c7c2f085590bab412e3f7bbb84133f9121c0015877c69317cebebb401103b3ab6306b42563bc7a1a9701c6c9704da2d2940a88af3f8c
@@ -60,7 +60,7 @@ module Admin
60
60
 
61
61
  authorize_effective_posts!
62
62
 
63
- if @post.update_attributes(post_params)
63
+ if @post.update(post_params)
64
64
  if params[:commit] == 'Save and Edit Content'
65
65
  redirect_to effective_regions.edit_path(effective_posts.post_path(@post), :exit => effective_posts.edit_admin_post_path(@post))
66
66
  elsif params[:commit] == 'Save and Add New'
@@ -107,7 +107,7 @@ module Admin
107
107
 
108
108
  authorize_effective_posts!
109
109
 
110
- if @post.update_attributes(draft: false)
110
+ if @post.update(draft: false)
111
111
  flash[:success] = 'Successfully approved post. It is now displayed on the website.'
112
112
  else
113
113
  flash[:danger] = "Unable to approve post: #{@post.errors.full_messages.join(', ')}"
@@ -83,7 +83,7 @@ module Effective
83
83
 
84
84
  EffectivePosts.authorized?(self, :update, @post)
85
85
 
86
- if @post.update_attributes(post_params)
86
+ if @post.update(post_params)
87
87
  @page_title ||= 'Post Submitted'
88
88
  flash.now[:success] = 'Successfully re-submitted post'
89
89
 
@@ -8,7 +8,7 @@ module EffectivePostsHelper
8
8
  if EffectivePosts.use_category_routes
9
9
  effective_posts.post_path(post, opts).sub('/posts', "/#{category}")
10
10
  else
11
- effective_posts.post_path(post, opts.merge(category: category))
11
+ effective_posts.post_path(post, opts)
12
12
  end
13
13
  end
14
14
 
@@ -33,7 +33,6 @@ module Effective
33
33
 
34
34
  scope :drafts, -> { where(draft: true) }
35
35
  scope :published, -> { where(draft: false).where("#{EffectivePosts.posts_table_name}.published_at < ?", Time.zone.now) }
36
- scope :with_category, -> (category) { where(category: category.to_s.downcase) }
37
36
 
38
37
  scope :posts, -> (user: nil, category: nil, drafts: false) {
39
38
  scope = (Rails::VERSION::MAJOR > 3 ? all : scoped)
@@ -48,7 +47,7 @@ module Effective
48
47
  end
49
48
 
50
49
  if category.present?
51
- scope = scope.with_category(category)
50
+ scope = scope.where(category: category)
52
51
  end
53
52
 
54
53
  if drafts.blank?
@@ -1,6 +1,6 @@
1
1
  %p A new post has been submitted and needs your approval before it may be displayed on the website:
2
2
 
3
- %p= link_to 'Approve Post', effective_posts.admin_approve_post_path(@post)
3
+ %p= link_to 'Approve Post', effective_posts.admin_approve_post_url(@post)
4
4
 
5
5
  %hr
6
6
 
@@ -19,4 +19,4 @@
19
19
 
20
20
  %hr
21
21
 
22
- %p= link_to 'Approve Post', effective_posts.admin_approve_post_path(@post)
22
+ %p= link_to 'Approve Post', effective_posts.admin_approve_post_url(@post)
@@ -1,3 +1,3 @@
1
1
  module EffectivePosts
2
- VERSION = '0.6.0'.freeze
2
+ VERSION = '0.6.3'.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: 0.6.0
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-06 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -188,7 +188,7 @@ homepage: https://github.com/code-and-effect/effective_posts
188
188
  licenses:
189
189
  - MIT
190
190
  metadata: {}
191
- post_install_message:
191
+ post_install_message:
192
192
  rdoc_options: []
193
193
  require_paths:
194
194
  - lib
@@ -203,8 +203,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  - !ruby/object:Gem::Version
204
204
  version: '0'
205
205
  requirements: []
206
- rubygems_version: 3.0.3
207
- signing_key:
206
+ rubygems_version: 3.1.2
207
+ signing_key:
208
208
  specification_version: 4
209
209
  summary: A blog implementation with WYSIWYG content editing, post scheduling, pagination
210
210
  and optional top level routes for each post category.