acts_as_favoritor 5.0.3 → 6.0.0
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 +4 -4
- data/README.md +1 -1
- data/lib/acts_as_favoritor/favoritor.rb +1 -1
- data/lib/acts_as_favoritor/favoritor_lib.rb +2 -2
- data/lib/acts_as_favoritor/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 720e4ea66b88a043a1bcd46c702dc8aa445b20fe60517e978791d8c4bcbc90af
|
4
|
+
data.tar.gz: beb07b7607a369e302816b9e39b9dae5ec8ca488ff717ff3bdb3e3b96fea1227
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1dc068b8f318a7141d2d695693245aef8aaf22ffecc2cb46484308fb9c0563cd1576d855113f336871cb4a6e7a20adf867c5b0629f7a04042fbd5862615a746
|
7
|
+
data.tar.gz: b736fbaa9e300ac44c9f83cbe99f780e8cfabcde661a9baf7bbef8a7fa88a28c61a022e8140d005269315b84524d8a69a549fa699da3a513221511613da28800
|
data/README.md
CHANGED
@@ -147,7 +147,7 @@ Using scopes with `acts_as_favoritor` enables you to Follow, Watch, Favorite, [.
|
|
147
147
|
|
148
148
|
By default all of your favorites are scoped to `'favorite'`.
|
149
149
|
|
150
|
-
You can create new scopes on the fly. Every single method takes `scope`/`scopes` as an option which
|
150
|
+
You can create new scopes on the fly. Every single method takes `scope`/`scopes` as an option which expects a symbol or an array of symbols containing your scopes.
|
151
151
|
|
152
152
|
So lets see how this works:
|
153
153
|
|
@@ -63,7 +63,7 @@ module ActsAsFavoritor
|
|
63
63
|
scopes: nil)
|
64
64
|
self.class.build_result_for_scopes(scopes || scope) do |s|
|
65
65
|
favorite_record = get_favorite(favoritable, s)
|
66
|
-
return nil
|
66
|
+
return nil if favorite_record.blank?
|
67
67
|
|
68
68
|
result = favorite_record.destroy!
|
69
69
|
dec_cache(favoritable, s) if ActsAsFavoritor.configuration.cache && result.destroyed?
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
module ActsAsFavoritor
|
4
4
|
module FavoritorLib
|
5
|
-
def build_result_for_scopes(scopes)
|
5
|
+
def build_result_for_scopes(scopes, &block)
|
6
6
|
return yield(scopes) unless scopes.is_a?(Array)
|
7
7
|
return if scopes.empty?
|
8
8
|
|
9
|
-
sanitized_scopes(scopes).
|
9
|
+
sanitized_scopes(scopes).index_with(&block)
|
10
10
|
end
|
11
11
|
|
12
12
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_favoritor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-rails
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rubocop-rspec
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,14 +173,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
173
|
requirements:
|
160
174
|
- - ">="
|
161
175
|
- !ruby/object:Gem::Version
|
162
|
-
version: '2.
|
176
|
+
version: '2.7'
|
163
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
178
|
requirements:
|
165
179
|
- - ">="
|
166
180
|
- !ruby/object:Gem::Version
|
167
181
|
version: '0'
|
168
182
|
requirements: []
|
169
|
-
rubygems_version: 3.
|
183
|
+
rubygems_version: 3.3.7
|
170
184
|
signing_key:
|
171
185
|
specification_version: 4
|
172
186
|
summary: A Rubygem to add Favorite, Follow, Vote, etc. functionality to ActiveRecord
|