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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/spec.yml +12 -14
  3. data/Appraisals +10 -7
  4. data/CHANGELOG.md +22 -3
  5. data/CONTRIBUTING.md +3 -3
  6. data/Gemfile +0 -1
  7. data/README.md +16 -4
  8. data/acts-as-taggable-on.gemspec +5 -5
  9. data/db/migrate/1_acts_as_taggable_on_migration.rb +0 -1
  10. data/gemfiles/activerecord_7.0.gemfile +2 -2
  11. data/gemfiles/{activerecord_6.0.gemfile → activerecord_7.1.gemfile} +2 -2
  12. data/gemfiles/{activerecord_6.1.gemfile → activerecord_7.2.gemfile} +2 -2
  13. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tag.rb +4 -3
  14. data/lib/acts-as-taggable-on/taggable/caching.rb +46 -0
  15. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/collection.rb +5 -4
  16. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/core.rb +4 -6
  17. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/ownership.rb +5 -7
  18. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/query_base.rb +11 -2
  19. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable.rb +8 -8
  20. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tagger.rb +5 -13
  21. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tagging.rb +1 -1
  22. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/utils.rb +0 -4
  23. data/lib/{acts_as_taggable_on → acts-as-taggable-on}/version.rb +1 -1
  24. data/lib/acts-as-taggable-on.rb +14 -29
  25. data/lib/tasks/example/acts-as-taggable-on.rb.example +8 -0
  26. data/lib/tasks/install_initializer.rake +23 -0
  27. data/spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb +5 -10
  28. data/spec/acts_as_taggable_on/acts_as_tagger_spec.rb +2 -2
  29. data/spec/acts_as_taggable_on/caching_spec.rb +0 -4
  30. data/spec/acts_as_taggable_on/tag_list_spec.rb +3 -3
  31. data/spec/acts_as_taggable_on/tag_spec.rb +45 -2
  32. data/spec/acts_as_taggable_on/taggable_spec.rb +51 -44
  33. data/spec/acts_as_taggable_on/tagger_spec.rb +8 -8
  34. data/spec/acts_as_taggable_on/tagging_spec.rb +28 -2
  35. data/spec/support/database.rb +3 -11
  36. data/spec/support/database_cleaner.rb +4 -0
  37. metadata +57 -36
  38. data/lib/acts_as_taggable_on/taggable/cache.rb +0 -92
  39. data/lib/acts_as_taggable_on.rb +0 -6
  40. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/default_parser.rb +0 -0
  41. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/engine.rb +0 -0
  42. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/generic_parser.rb +0 -0
  43. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/tag_list.rb +0 -0
  44. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/related.rb +0 -0
  45. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tag_list_type.rb +0 -0
  46. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/all_tags_query.rb +0 -0
  47. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/any_tags_query.rb +0 -0
  48. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query/exclude_tags_query.rb +0 -0
  49. /data/lib/{acts_as_taggable_on → acts-as-taggable-on}/taggable/tagged_with_query.rb +0 -0
  50. /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: 9.0.0
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: 2022-01-04 00:00:00.000000000 Z
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: '6.0'
20
+ version: '7.0'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '7.1'
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: '6.0'
30
+ version: '7.0'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '7.1'
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/acts_as_taggable_on.rb
138
- - lib/acts_as_taggable_on/default_parser.rb
139
- - lib/acts_as_taggable_on/engine.rb
140
- - lib/acts_as_taggable_on/generic_parser.rb
141
- - lib/acts_as_taggable_on/tag.rb
142
- - lib/acts_as_taggable_on/tag_list.rb
143
- - lib/acts_as_taggable_on/taggable.rb
144
- - lib/acts_as_taggable_on/taggable/cache.rb
145
- - lib/acts_as_taggable_on/taggable/collection.rb
146
- - lib/acts_as_taggable_on/taggable/core.rb
147
- - lib/acts_as_taggable_on/taggable/ownership.rb
148
- - lib/acts_as_taggable_on/taggable/related.rb
149
- - lib/acts_as_taggable_on/taggable/tag_list_type.rb
150
- - lib/acts_as_taggable_on/taggable/tagged_with_query.rb
151
- - lib/acts_as_taggable_on/taggable/tagged_with_query/all_tags_query.rb
152
- - lib/acts_as_taggable_on/taggable/tagged_with_query/any_tags_query.rb
153
- - lib/acts_as_taggable_on/taggable/tagged_with_query/exclude_tags_query.rb
154
- - lib/acts_as_taggable_on/taggable/tagged_with_query/query_base.rb
155
- - lib/acts_as_taggable_on/tagger.rb
156
- - lib/acts_as_taggable_on/tagging.rb
157
- - lib/acts_as_taggable_on/tags_helper.rb
158
- - lib/acts_as_taggable_on/utils.rb
159
- - lib/acts_as_taggable_on/version.rb
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: 2.5.0
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.2.22
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
@@ -1,6 +0,0 @@
1
- $stderr.puts <<EOF
2
- You are requiring 'acts_as_taggable_on' in the 'acts-as-taggable-on' gem.
3
-
4
- Please change your require to 'acts-as-taggable-on'.
5
- EOF
6
- require_relative 'acts-as-taggable-on'