acts-as-taggable-on 9.0.0 → 11.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/spec.yml +12 -14
- data/Appraisals +10 -7
- data/CHANGELOG.md +22 -3
- data/CONTRIBUTING.md +3 -3
- data/Gemfile +0 -1
- data/README.md +16 -4
- data/acts-as-taggable-on.gemspec +5 -5
- data/db/migrate/1_acts_as_taggable_on_migration.rb +0 -1
- data/gemfiles/activerecord_7.0.gemfile +2 -2
- data/gemfiles/{activerecord_6.0.gemfile → activerecord_7.1.gemfile} +2 -2
- data/gemfiles/{activerecord_6.1.gemfile → activerecord_7.2.gemfile} +2 -2
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tag.rb +4 -3
- data/lib/acts-as-taggable-on/taggable/caching.rb +46 -0
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/collection.rb +5 -4
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/core.rb +4 -6
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/ownership.rb +5 -7
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/query_base.rb +11 -2
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable.rb +8 -8
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tagger.rb +5 -13
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tagging.rb +1 -1
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/utils.rb +0 -4
- data/lib/{acts_as_taggable_on → acts-as-taggable-on}/version.rb +1 -1
- data/lib/acts-as-taggable-on.rb +14 -29
- data/lib/tasks/example/acts-as-taggable-on.rb.example +8 -0
- data/lib/tasks/install_initializer.rake +23 -0
- data/spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb +5 -10
- data/spec/acts_as_taggable_on/acts_as_tagger_spec.rb +2 -2
- data/spec/acts_as_taggable_on/caching_spec.rb +0 -4
- data/spec/acts_as_taggable_on/tag_list_spec.rb +3 -3
- data/spec/acts_as_taggable_on/tag_spec.rb +45 -2
- data/spec/acts_as_taggable_on/taggable_spec.rb +51 -44
- data/spec/acts_as_taggable_on/tagger_spec.rb +8 -8
- data/spec/acts_as_taggable_on/tagging_spec.rb +28 -2
- data/spec/support/database.rb +3 -11
- data/spec/support/database_cleaner.rb +4 -0
- metadata +57 -36
- data/lib/acts_as_taggable_on/taggable/cache.rb +0 -92
- data/lib/acts_as_taggable_on.rb +0 -6
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/default_parser.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/engine.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/generic_parser.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tag_list.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/related.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tag_list_type.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/all_tags_query.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/any_tags_query.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/exclude_tags_query.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query.rb +0 -0
- /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tags_helper.rb +0 -0
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts-as-taggable-on
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bleigh
|
8
8
|
- Joost Baaij
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -17,20 +17,40 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '7.0'
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '8.0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
28
|
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: '
|
30
|
+
version: '7.0'
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '8.0'
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: zeitwerk
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.4'
|
41
|
+
- - "<"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '2.4'
|
51
|
+
- - "<"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.0'
|
34
54
|
- !ruby/object:Gem::Dependency
|
35
55
|
name: rspec-rails
|
36
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,33 +150,34 @@ files:
|
|
130
150
|
- db/migrate/6_add_missing_indexes_on_taggings.rb
|
131
151
|
- db/migrate/7_add_tenant_to_taggings.rb
|
132
152
|
- docker-compose.yml
|
133
|
-
- gemfiles/activerecord_6.0.gemfile
|
134
|
-
- gemfiles/activerecord_6.1.gemfile
|
135
153
|
- gemfiles/activerecord_7.0.gemfile
|
154
|
+
- gemfiles/activerecord_7.1.gemfile
|
155
|
+
- gemfiles/activerecord_7.2.gemfile
|
136
156
|
- lib/acts-as-taggable-on.rb
|
137
|
-
- lib/
|
138
|
-
- lib/
|
139
|
-
- lib/
|
140
|
-
- lib/
|
141
|
-
- lib/
|
142
|
-
- lib/
|
143
|
-
- lib/
|
144
|
-
- lib/
|
145
|
-
- lib/
|
146
|
-
- lib/
|
147
|
-
- lib/
|
148
|
-
- lib/
|
149
|
-
- lib/
|
150
|
-
- lib/
|
151
|
-
- lib/
|
152
|
-
- lib/
|
153
|
-
- lib/
|
154
|
-
- lib/
|
155
|
-
- lib/
|
156
|
-
- lib/
|
157
|
-
- lib/
|
158
|
-
- lib/
|
159
|
-
- lib/
|
157
|
+
- lib/acts-as-taggable-on/default_parser.rb
|
158
|
+
- lib/acts-as-taggable-on/engine.rb
|
159
|
+
- lib/acts-as-taggable-on/generic_parser.rb
|
160
|
+
- lib/acts-as-taggable-on/tag.rb
|
161
|
+
- lib/acts-as-taggable-on/tag_list.rb
|
162
|
+
- lib/acts-as-taggable-on/taggable.rb
|
163
|
+
- lib/acts-as-taggable-on/taggable/caching.rb
|
164
|
+
- lib/acts-as-taggable-on/taggable/collection.rb
|
165
|
+
- lib/acts-as-taggable-on/taggable/core.rb
|
166
|
+
- lib/acts-as-taggable-on/taggable/ownership.rb
|
167
|
+
- lib/acts-as-taggable-on/taggable/related.rb
|
168
|
+
- lib/acts-as-taggable-on/taggable/tag_list_type.rb
|
169
|
+
- lib/acts-as-taggable-on/taggable/tagged_with_query.rb
|
170
|
+
- lib/acts-as-taggable-on/taggable/tagged_with_query/all_tags_query.rb
|
171
|
+
- lib/acts-as-taggable-on/taggable/tagged_with_query/any_tags_query.rb
|
172
|
+
- lib/acts-as-taggable-on/taggable/tagged_with_query/exclude_tags_query.rb
|
173
|
+
- lib/acts-as-taggable-on/taggable/tagged_with_query/query_base.rb
|
174
|
+
- lib/acts-as-taggable-on/tagger.rb
|
175
|
+
- lib/acts-as-taggable-on/tagging.rb
|
176
|
+
- lib/acts-as-taggable-on/tags_helper.rb
|
177
|
+
- lib/acts-as-taggable-on/utils.rb
|
178
|
+
- lib/acts-as-taggable-on/version.rb
|
179
|
+
- lib/tasks/example/acts-as-taggable-on.rb.example
|
180
|
+
- lib/tasks/install_initializer.rake
|
160
181
|
- lib/tasks/tags_collate_utf8.rake
|
161
182
|
- spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb
|
162
183
|
- spec/acts_as_taggable_on/acts_as_tagger_spec.rb
|
@@ -199,7 +220,7 @@ homepage: https://github.com/mbleigh/acts-as-taggable-on
|
|
199
220
|
licenses:
|
200
221
|
- MIT
|
201
222
|
metadata: {}
|
202
|
-
post_install_message:
|
223
|
+
post_install_message:
|
203
224
|
rdoc_options: []
|
204
225
|
require_paths:
|
205
226
|
- lib
|
@@ -207,15 +228,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
228
|
requirements:
|
208
229
|
- - ">="
|
209
230
|
- !ruby/object:Gem::Version
|
210
|
-
version:
|
231
|
+
version: 3.0.0
|
211
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
233
|
requirements:
|
213
234
|
- - ">="
|
214
235
|
- !ruby/object:Gem::Version
|
215
236
|
version: '0'
|
216
237
|
requirements: []
|
217
|
-
rubygems_version: 3.
|
218
|
-
signing_key:
|
238
|
+
rubygems_version: 3.5.6
|
239
|
+
signing_key:
|
219
240
|
specification_version: 4
|
220
241
|
summary: Advanced tagging for Rails.
|
221
242
|
test_files:
|
@@ -1,92 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActsAsTaggableOn
|
4
|
-
module Taggable
|
5
|
-
module Cache
|
6
|
-
def self.included(base)
|
7
|
-
# When included, conditionally adds tag caching methods when the model
|
8
|
-
# has any "cached_#{tag_type}_list" column
|
9
|
-
base.extend Columns
|
10
|
-
end
|
11
|
-
|
12
|
-
module Columns
|
13
|
-
# ActiveRecord::Base.columns makes a database connection and caches the
|
14
|
-
# calculated columns hash for the record as @columns. Since we don't
|
15
|
-
# want to add caching methods until we confirm the presence of a
|
16
|
-
# caching column, and we don't want to force opening a database
|
17
|
-
# connection when the class is loaded, here we intercept and cache
|
18
|
-
# the call to :columns as @acts_as_taggable_on_cache_columns
|
19
|
-
# to mimic the underlying behavior. While processing this first
|
20
|
-
# call to columns, we do the caching column check and dynamically add
|
21
|
-
# the class and instance methods
|
22
|
-
# FIXME: this method cannot compile in rubinius
|
23
|
-
def columns
|
24
|
-
@acts_as_taggable_on_cache_columns ||= begin
|
25
|
-
db_columns = super
|
26
|
-
_add_tags_caching_methods if _has_tags_cache_columns?(db_columns)
|
27
|
-
db_columns
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def reset_column_information
|
32
|
-
super
|
33
|
-
@acts_as_taggable_on_cache_columns = nil
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
# @private
|
39
|
-
def _has_tags_cache_columns?(db_columns)
|
40
|
-
db_column_names = db_columns.map(&:name)
|
41
|
-
tag_types.any? do |context|
|
42
|
-
db_column_names.include?("cached_#{context.to_s.singularize}_list")
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# @private
|
47
|
-
def _add_tags_caching_methods
|
48
|
-
send :include, ActsAsTaggableOn::Taggable::Cache::InstanceMethods
|
49
|
-
extend ActsAsTaggableOn::Taggable::Cache::ClassMethods
|
50
|
-
|
51
|
-
before_save :save_cached_tag_list
|
52
|
-
|
53
|
-
initialize_tags_cache
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
module ClassMethods
|
58
|
-
def initialize_tags_cache
|
59
|
-
tag_types.map(&:to_s).each do |tag_type|
|
60
|
-
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
61
|
-
def self.caching_#{tag_type.singularize}_list?
|
62
|
-
caching_tag_list_on?("#{tag_type}")
|
63
|
-
end
|
64
|
-
RUBY
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def acts_as_taggable_on(*args)
|
69
|
-
super(*args)
|
70
|
-
initialize_tags_cache
|
71
|
-
end
|
72
|
-
|
73
|
-
def caching_tag_list_on?(context)
|
74
|
-
column_names.include?("cached_#{context.to_s.singularize}_list")
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
module InstanceMethods
|
79
|
-
def save_cached_tag_list
|
80
|
-
tag_types.map(&:to_s).each do |tag_type|
|
81
|
-
if self.class.send("caching_#{tag_type.singularize}_list?") && tag_list_cache_set_on(tag_type)
|
82
|
-
list = tag_list_cache_on(tag_type).to_a.flatten.compact.join("#{ActsAsTaggableOn.delimiter} ")
|
83
|
-
self["cached_#{tag_type.singularize}_list"] = list
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
true
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
data/lib/acts_as_taggable_on.rb
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/all_tags_query.rb
RENAMED
File without changes
|
/data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/any_tags_query.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|