acts_as_favoritor 5.0.3 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +4 -102
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e7abb0179e3a83dda0945043c82201b26b14c1b0d8308539de9739ba341a405
|
4
|
+
data.tar.gz: a6fd92d24e2ab1eeb1900f564ce9bc8b19d881095a77d40cd2d2dbde0a97129e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33cbc78fb53444ead0d3841a9d5b6ea4401efeaf2eebc98b30049823fa6afe45e4ea498780dabd39d67947d6dc4b74369910e24a0b2347fa15a68271cd83af67
|
7
|
+
data.tar.gz: f9378c666b34f2be834ae2500ec14af029db76ab2ec0275becaeab4296c439abab6ad79c37c2c2d9ec01705376f8cf2523b89305f37cf75194b12a070bc1d73e
|
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.1
|
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: 2023-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -24,104 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: factory_bot
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: pry
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rails
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec-rails
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop-rspec
|
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'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: sqlite3
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
27
|
description: acts_as_favoritor is a Rubygem to allow any ActiveRecord model to associate
|
126
28
|
any other model including the option for multiple relationships per association
|
127
29
|
with scopes. You are able to differentiate followers, favorites, watchers, votes
|
@@ -159,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
61
|
requirements:
|
160
62
|
- - ">="
|
161
63
|
- !ruby/object:Gem::Version
|
162
|
-
version: '2.
|
64
|
+
version: '2.7'
|
163
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
66
|
requirements:
|
165
67
|
- - ">="
|
166
68
|
- !ruby/object:Gem::Version
|
167
69
|
version: '0'
|
168
70
|
requirements: []
|
169
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.3.26
|
170
72
|
signing_key:
|
171
73
|
specification_version: 4
|
172
74
|
summary: A Rubygem to add Favorite, Follow, Vote, etc. functionality to ActiveRecord
|