effective_posts 0.6.1 → 0.6.4

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: 2d902aeb10c1c3b6086f2906b32ed4630a4f42837e8d9026b21f8b86057d447f
4
- data.tar.gz: 524d6be015661d16c72e3937bda35566d278e7d26b7a0d4eda321896613bd8b8
3
+ metadata.gz: f2cd2dff889cc85033be8e660ba9e5f6296f18334701d6da2c512de3271a7125
4
+ data.tar.gz: 91610327601b259b5c5b96472380b93b9ef42ee84d30030cde4edcd329e03b13
5
5
  SHA512:
6
- metadata.gz: ad28ff26d3d39f18666da90cd4bb7c7274785b1a8b6323d5190732661aa1e72e950128b488471b7aafd1e1e28023ad19ccde4a486ae83912813c0905eef9a4b7
7
- data.tar.gz: 74f3535129b89d932ddb941501aa818134d6813742234af6cdefb157be6c8d141fe6daa29882767a89d196c90ae89e593750bd0864b4ea53f3dcd659e4ffce5a
6
+ metadata.gz: 8b2579f990e55413dab83e8de5cbdeb920c7ff95beef6021c9b490974594ca02713b5744bee52ce6b2542335eb71c23695a6ea9ef8c72801ac551aa8de0e1d3e
7
+ data.tar.gz: 0276bb57efbad3f7f84c691f53ddd3f2f9d1ccd8ef804c0993a094040f4bee12fe1b9f425f7c1ef8d86807c49da5a7c5c4ff58e4e8e9838f4549239fe69fe3e2
@@ -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?
@@ -7,4 +7,4 @@
7
7
 
8
8
  %hr
9
9
 
10
- = render file: '/effective/posts/show'
10
+ = render template: '/effective/posts/show'
@@ -1,3 +1,3 @@
1
1
  module EffectivePosts
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.6.4'.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.1
4
+ version: 0.6.4
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-10-16 00:00:00.000000000 Z
11
+ date: 2022-03-31 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.