acts-as-taggable-on 7.0.0 → 8.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 +95 -0
- data/CHANGELOG.md +6 -0
- data/README.md +27 -2
- data/db/migrate/7_add_tenant_to_taggings.rb +16 -0
- data/lib/acts_as_taggable_on/tag.rb +6 -0
- data/lib/acts_as_taggable_on/taggable.rb +18 -0
- data/lib/acts_as_taggable_on/taggable/core.rb +11 -1
- data/lib/acts_as_taggable_on/tagging.rb +3 -1
- data/lib/acts_as_taggable_on/version.rb +1 -1
- data/spec/acts_as_taggable_on/tag_spec.rb +16 -1
- data/spec/acts_as_taggable_on/taggable_spec.rb +6 -2
- data/spec/acts_as_taggable_on/tagging_spec.rb +26 -0
- data/spec/internal/app/models/taggable_model.rb +2 -0
- data/spec/internal/config/database.yml.sample +4 -8
- data/spec/internal/db/schema.rb +3 -0
- metadata +7 -15
- data/.travis.yml +0 -49
- data/UPGRADING.md +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a4ab64bc795a1e9596de357c7dad4cc014e4049f6990b478cbfd5423aeea166
|
4
|
+
data.tar.gz: b5efae9e459d67584920ad0cf8aa4dac8e8889ea70897941ad580fa4cfe58508
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3456a0521ea9e853afdb316792fdbbdef01c6cbc354b34b46b7916e9ce5111c9a85085c029deb0191f93f32993cebeb3b565ed865090633892584c67e017db5
|
7
|
+
data.tar.gz: b392a57b1f80e17e88766db866bb9e802dfd8924ae175c31032e98414aef48f213f007f0b93c7ca3d272540ea40579a26b8aa8e42a6d0874cc502dea7448b1fe
|
@@ -0,0 +1,95 @@
|
|
1
|
+
name: spec
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
continue-on-error: ${{ matrix.ruby == 'head' }}
|
9
|
+
env:
|
10
|
+
DB: ${{ matrix.db }}
|
11
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby:
|
15
|
+
- 2.3
|
16
|
+
- 2.4
|
17
|
+
- 2.5
|
18
|
+
- 2.6
|
19
|
+
- 2.7
|
20
|
+
- 3.0
|
21
|
+
- head
|
22
|
+
gemfile:
|
23
|
+
- gemfiles/activerecord_5.0.gemfile
|
24
|
+
- gemfiles/activerecord_5.2.gemfile
|
25
|
+
- gemfiles/activerecord_5.1.gemfile
|
26
|
+
- gemfiles/activerecord_6.0.gemfile
|
27
|
+
- gemfiles/activerecord_6.1.gemfile
|
28
|
+
db:
|
29
|
+
- mysql
|
30
|
+
- postgresql
|
31
|
+
- sqlite3
|
32
|
+
exclude:
|
33
|
+
# Unfortunately, the mysql2 gem encounters a segfault in the ruby 2.3 environment:
|
34
|
+
- ruby: 2.3
|
35
|
+
db: mysql
|
36
|
+
# Exclude ActiveRecord 6.x for Ruby < 2.5
|
37
|
+
- ruby: 2.3
|
38
|
+
gemfile: gemfiles/activerecord_6.0.gemfile
|
39
|
+
- ruby: 2.3
|
40
|
+
gemfile: gemfiles/activerecord_6.1.gemfile
|
41
|
+
- ruby: 2.4
|
42
|
+
gemfile: gemfiles/activerecord_6.0.gemfile
|
43
|
+
- ruby: 2.4
|
44
|
+
gemfile: gemfiles/activerecord_6.1.gemfile
|
45
|
+
# Exclude ActiveRecord 5.x for Ruby >= 3.0
|
46
|
+
- ruby: 3.0
|
47
|
+
gemfile: gemfiles/activerecord_5.0.gemfile
|
48
|
+
- ruby: 3.0
|
49
|
+
gemfile: gemfiles/activerecord_5.1.gemfile
|
50
|
+
- ruby: 3.0
|
51
|
+
gemfile: gemfiles/activerecord_5.2.gemfile
|
52
|
+
- ruby: head
|
53
|
+
gemfile: gemfiles/activerecord_5.0.gemfile
|
54
|
+
- ruby: head
|
55
|
+
gemfile: gemfiles/activerecord_5.1.gemfile
|
56
|
+
- ruby: head
|
57
|
+
gemfile: gemfiles/activerecord_5.2.gemfile
|
58
|
+
|
59
|
+
services:
|
60
|
+
postgres:
|
61
|
+
image: postgres:10
|
62
|
+
env:
|
63
|
+
POSTGRES_USER: postgres
|
64
|
+
POSTGRES_DB: acts_as_taggable_on
|
65
|
+
POSTGRES_PASSWORD: postgres
|
66
|
+
ports: ['5432:5432']
|
67
|
+
options: >-
|
68
|
+
--health-cmd pg_isready
|
69
|
+
--health-interval 10s
|
70
|
+
--health-timeout 5s
|
71
|
+
--health-retries 5
|
72
|
+
mysql:
|
73
|
+
image: mysql:8
|
74
|
+
env:
|
75
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: true
|
76
|
+
ports: ['3306:3306']
|
77
|
+
options: >-
|
78
|
+
--health-cmd "mysqladmin ping"
|
79
|
+
--health-interval 10s
|
80
|
+
--health-timeout 5s
|
81
|
+
--health-retries 5
|
82
|
+
steps:
|
83
|
+
- uses: actions/checkout@v2
|
84
|
+
- name: Set up Ruby
|
85
|
+
uses: ruby/setup-ruby@v1
|
86
|
+
with:
|
87
|
+
ruby-version: ${{ matrix.ruby }}
|
88
|
+
bundler-cache: true
|
89
|
+
- name: Create MySQL test database with utf8mb4 charset
|
90
|
+
if: ${{ matrix.db == 'mysql' }}
|
91
|
+
run: |
|
92
|
+
mysql -uroot --host=127.0.0.1 -e "CREATE DATABASE acts_as_taggable_on CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
|
93
|
+
- name: Build and test with Rake
|
94
|
+
run: |
|
95
|
+
bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,12 @@ Each change should fall into categories that would affect whether the release is
|
|
10
10
|
|
11
11
|
As such, _Breaking Changes_ are major. _Features_ would map to either major or minor. _Fixes_, _Performance_, and _Misc_ are either minor or patch, the difference being kind of fuzzy for the purposes of history. Adding _Documentation_ (including tests) would be patch level.
|
12
12
|
|
13
|
+
### [v8.0.0) / 2021-06-07](https://github.com/mbleigh/acts-as-taggable-on/compare/v7.0.0...v8.0.0)
|
14
|
+
* Features
|
15
|
+
* [@lunaru Support tenants for taggings](https://github.com/mbleigh/acts-as-taggable-on/pull/1000)
|
16
|
+
* Fixes
|
17
|
+
* [@gr-eg Use none? instead of count.zero?](https://github.com/mbleigh/acts-as-taggable-on/pull/1030)
|
18
|
+
|
13
19
|
### [v7.0.0) / 2020-12-31](https://github.com/mbleigh/acts-as-taggable-on/compare/v6.5.0...v7.0.0)
|
14
20
|
* Features
|
15
21
|
* [@kvokka Rails 6.1 support](https://github.com/mbleigh/acts-as-taggable-on/pull/1013)
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
[![Join the chat at https://gitter.im/mbleigh/acts-as-taggable-on](https://badges.gitter.im/mbleigh/acts-as-taggable-on.svg)](https://gitter.im/mbleigh/acts-as-taggable-on?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
34
34
|
[![Gem Version](https://badge.fury.io/rb/acts-as-taggable-on.svg)](http://badge.fury.io/rb/acts-as-taggable-on)
|
35
|
-
[![Build Status](https://
|
35
|
+
[![Build Status](https://github.com/mbleigh/acts-as-taggable-on/workflows/spec/badge.svg)](https://github.com/mbleigh/acts-as-taggable-on/actions)
|
36
36
|
[![Code Climate](https://codeclimate.com/github/mbleigh/acts-as-taggable-on.svg)](https://codeclimate.com/github/mbleigh/acts-as-taggable-on)
|
37
37
|
[![Inline docs](http://inch-ci.org/github/mbleigh/acts-as-taggable-on.svg)](http://inch-ci.org/github/mbleigh/acts-as-taggable-on)
|
38
38
|
[![Security](https://hakiri.io/github/mbleigh/acts-as-taggable-on/master.svg)](https://hakiri.io/github/mbleigh/acts-as-taggable-on/master)
|
@@ -57,7 +57,7 @@ was used.
|
|
57
57
|
To use it, add it to your Gemfile:
|
58
58
|
|
59
59
|
```ruby
|
60
|
-
gem 'acts-as-taggable-on', '~>
|
60
|
+
gem 'acts-as-taggable-on', '~> 7.0'
|
61
61
|
```
|
62
62
|
|
63
63
|
and bundle:
|
@@ -80,6 +80,8 @@ Review the generated migrations then migrate :
|
|
80
80
|
rake db:migrate
|
81
81
|
```
|
82
82
|
|
83
|
+
If you do not wish or need to support multi-tenancy, the migration for `add_tenant_to_taggings` is optional and can be discarded safely.
|
84
|
+
|
83
85
|
#### For MySql users
|
84
86
|
You can circumvent at any time the problem of special characters [issue 623](https://github.com/mbleigh/acts-as-taggable-on/issues/623) by setting in an initializer file:
|
85
87
|
|
@@ -390,6 +392,27 @@ def remove_owned_tag
|
|
390
392
|
end
|
391
393
|
```
|
392
394
|
|
395
|
+
### Tag Tenancy
|
396
|
+
|
397
|
+
Tags support multi-tenancy. This is useful for applications where a Tag belongs to a scoped set of models:
|
398
|
+
|
399
|
+
```ruby
|
400
|
+
class Account < ActiveRecord::Base
|
401
|
+
has_many :photos
|
402
|
+
end
|
403
|
+
|
404
|
+
class User < ActiveRecord::Base
|
405
|
+
belongs_to :account
|
406
|
+
acts_as_taggable_on :tags
|
407
|
+
acts_as_taggable_tenant :account_id
|
408
|
+
end
|
409
|
+
|
410
|
+
@user1.tag_list = ["foo", "bar"] # these taggings will automatically have the tenant saved
|
411
|
+
@user2.tag_list = ["bar", "baz"]
|
412
|
+
|
413
|
+
ActsAsTaggableOn::Tag.for_tenant(@user1.account.id) # returns Tag models for "foo" and "bar", but not "baz"
|
414
|
+
```
|
415
|
+
|
393
416
|
### Dirty objects
|
394
417
|
|
395
418
|
```ruby
|
@@ -530,6 +553,8 @@ Versions >= 3.x are compatible with Ruby 1.9.3+ and Rails 3 and 4.
|
|
530
553
|
|
531
554
|
Versions >= 4.x are compatible with Ruby 2.0.0+ and Rails 4 and 5.
|
532
555
|
|
556
|
+
Versions >= 7.x are compatible with Ruby 2.3.7+ and Rails 5 and 6.
|
557
|
+
|
533
558
|
For an up-to-date roadmap, see https://github.com/mbleigh/acts-as-taggable-on/milestones
|
534
559
|
|
535
560
|
## TODO
|
@@ -0,0 +1,16 @@
|
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class AddTenantToTaggings < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class AddTenantToTaggings < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
AddTenantToTaggings.class_eval do
|
7
|
+
def self.up
|
8
|
+
add_column :taggings, :tenant, :string, limit: 128
|
9
|
+
add_index :taggings, :tenant unless index_exists? :taggings, :tenant
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
remove_column :taggings, :tenant
|
14
|
+
remove_index :taggings, :tenant
|
15
|
+
end
|
16
|
+
end
|
@@ -55,6 +55,12 @@ module ActsAsTaggableOn
|
|
55
55
|
select("DISTINCT #{ActsAsTaggableOn.tags_table}.*")
|
56
56
|
end
|
57
57
|
|
58
|
+
def self.for_tenant(tenant)
|
59
|
+
joins(:taggings).
|
60
|
+
where("#{ActsAsTaggableOn.taggings_table}.tenant = ?", tenant.to_s).
|
61
|
+
select("DISTINCT #{ActsAsTaggableOn.tags_table}.*")
|
62
|
+
end
|
63
|
+
|
58
64
|
### CLASS METHODS:
|
59
65
|
|
60
66
|
def self.find_or_create_with_like_by_name(name)
|
@@ -54,6 +54,23 @@ module ActsAsTaggableOn
|
|
54
54
|
taggable_on(true, tag_types)
|
55
55
|
end
|
56
56
|
|
57
|
+
def acts_as_taggable_tenant(tenant)
|
58
|
+
if taggable?
|
59
|
+
self.tenant_column = tenant
|
60
|
+
else
|
61
|
+
class_attribute :tenant_column
|
62
|
+
self.tenant_column = tenant
|
63
|
+
end
|
64
|
+
|
65
|
+
# each of these add context-specific methods and must be
|
66
|
+
# called on each call of taggable_on
|
67
|
+
include Core
|
68
|
+
include Collection
|
69
|
+
include Cache
|
70
|
+
include Ownership
|
71
|
+
include Related
|
72
|
+
end
|
73
|
+
|
57
74
|
private
|
58
75
|
|
59
76
|
# Make a model taggable on specified contexts
|
@@ -78,6 +95,7 @@ module ActsAsTaggableOn
|
|
78
95
|
self.tag_types = tag_types
|
79
96
|
class_attribute :preserve_tag_order
|
80
97
|
self.preserve_tag_order = preserve_tag_order
|
98
|
+
class_attribute :tenant_column
|
81
99
|
|
82
100
|
class_eval do
|
83
101
|
has_many :taggings, as: :taggable, dependent: :destroy, class_name: '::ActsAsTaggableOn::Tagging'
|
@@ -214,6 +214,12 @@ module ActsAsTaggableOn::Taggable
|
|
214
214
|
self.class.tag_types.map(&:to_s) + custom_contexts
|
215
215
|
end
|
216
216
|
|
217
|
+
def tenant
|
218
|
+
if self.class.tenant_column
|
219
|
+
read_attribute(self.class.tenant_column)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
217
223
|
def reload(*args)
|
218
224
|
self.class.tag_types.each do |context|
|
219
225
|
instance_variable_set("@#{context.to_s.singularize}_list", nil)
|
@@ -272,7 +278,11 @@ module ActsAsTaggableOn::Taggable
|
|
272
278
|
|
273
279
|
# Create new taggings:
|
274
280
|
new_tags.each do |tag|
|
275
|
-
|
281
|
+
if tenant
|
282
|
+
taggings.create!(tag_id: tag.id, context: context.to_s, taggable: self, tenant: tenant)
|
283
|
+
else
|
284
|
+
taggings.create!(tag_id: tag.id, context: context.to_s, taggable: self)
|
285
|
+
end
|
276
286
|
end
|
277
287
|
end
|
278
288
|
|
@@ -14,6 +14,8 @@ module ActsAsTaggableOn
|
|
14
14
|
scope :by_contexts, ->(contexts) { where(context: (contexts || DEFAULT_CONTEXT)) }
|
15
15
|
scope :by_context, ->(context = DEFAULT_CONTEXT) { by_contexts(context.to_s) }
|
16
16
|
|
17
|
+
scope :by_tenant, ->(tenant) { where(tenant: tenant) }
|
18
|
+
|
17
19
|
validates_presence_of :context
|
18
20
|
validates_presence_of :tag_id
|
19
21
|
|
@@ -28,7 +30,7 @@ module ActsAsTaggableOn
|
|
28
30
|
if ActsAsTaggableOn.tags_counter
|
29
31
|
tag.destroy if tag.reload.taggings_count.zero?
|
30
32
|
else
|
31
|
-
tag.destroy if tag.reload.taggings.
|
33
|
+
tag.destroy if tag.reload.taggings.none?
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
@@ -14,7 +14,7 @@ end
|
|
14
14
|
describe ActsAsTaggableOn::Tag do
|
15
15
|
before(:each) do
|
16
16
|
@tag = ActsAsTaggableOn::Tag.new
|
17
|
-
@user = TaggableModel.create(name: 'Pablo')
|
17
|
+
@user = TaggableModel.create(name: 'Pablo', tenant_id: 100)
|
18
18
|
end
|
19
19
|
|
20
20
|
|
@@ -70,6 +70,21 @@ describe ActsAsTaggableOn::Tag do
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
describe 'for tenant' do
|
74
|
+
before(:each) do
|
75
|
+
@user.skill_list.add('ruby')
|
76
|
+
@user.save
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'should return tags for the tenant' do
|
80
|
+
expect(ActsAsTaggableOn::Tag.for_tenant('100').pluck(:name)).to include('ruby')
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'should not return tags for other tenants' do
|
84
|
+
expect(ActsAsTaggableOn::Tag.for_tenant('200').pluck(:name)).to_not include('ruby')
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
73
88
|
describe 'find or create by name' do
|
74
89
|
before(:each) do
|
75
90
|
@tag.name = 'awesome'
|
@@ -109,6 +109,10 @@ describe 'Taggable' do
|
|
109
109
|
expect(@taggable.tag_types).to eq(TaggableModel.tag_types)
|
110
110
|
end
|
111
111
|
|
112
|
+
it 'should have tenant column' do
|
113
|
+
expect(TaggableModel.tenant_column).to eq(:tenant_id)
|
114
|
+
end
|
115
|
+
|
112
116
|
it 'should have tag_counts_on' do
|
113
117
|
expect(TaggableModel.tag_counts_on(:tags)).to be_empty
|
114
118
|
|
@@ -676,11 +680,11 @@ describe 'Taggable' do
|
|
676
680
|
end
|
677
681
|
|
678
682
|
it 'should return all column names joined for TaggableModel GROUP clause' do
|
679
|
-
expect(@taggable.grouped_column_names_for(TaggableModel)).to eq('taggable_models.id, taggable_models.name, taggable_models.type')
|
683
|
+
expect(@taggable.grouped_column_names_for(TaggableModel)).to eq('taggable_models.id, taggable_models.name, taggable_models.type, taggable_models.tenant_id')
|
680
684
|
end
|
681
685
|
|
682
686
|
it 'should return all column names joined for NonStandardIdTaggableModel GROUP clause' do
|
683
|
-
expect(@taggable.grouped_column_names_for(TaggableModel)).to eq("taggable_models.#{TaggableModel.primary_key}, taggable_models.name, taggable_models.type")
|
687
|
+
expect(@taggable.grouped_column_names_for(TaggableModel)).to eq("taggable_models.#{TaggableModel.primary_key}, taggable_models.name, taggable_models.type, taggable_models.tenant_id")
|
684
688
|
end
|
685
689
|
end
|
686
690
|
|
@@ -49,6 +49,22 @@ describe ActsAsTaggableOn::Tagging do
|
|
49
49
|
ActsAsTaggableOn.remove_unused_tags = previous_setting
|
50
50
|
end
|
51
51
|
|
52
|
+
it 'should destroy unused tags after tagging destroyed when not using tags_counter' do
|
53
|
+
remove_unused_tags_previous_setting = ActsAsTaggableOn.remove_unused_tags
|
54
|
+
tags_counter_previous_setting = ActsAsTaggableOn.tags_counter
|
55
|
+
ActsAsTaggableOn.remove_unused_tags = true
|
56
|
+
ActsAsTaggableOn.tags_counter = false
|
57
|
+
|
58
|
+
ActsAsTaggableOn::Tag.destroy_all
|
59
|
+
@taggable = TaggableModel.create(name: 'Bob Jones')
|
60
|
+
@taggable.update_attribute :tag_list, 'aaa,bbb,ccc'
|
61
|
+
@taggable.update_attribute :tag_list, ''
|
62
|
+
expect(ActsAsTaggableOn::Tag.count).to eql(0)
|
63
|
+
|
64
|
+
ActsAsTaggableOn.remove_unused_tags = remove_unused_tags_previous_setting
|
65
|
+
ActsAsTaggableOn.tags_counter = tags_counter_previous_setting
|
66
|
+
end
|
67
|
+
|
52
68
|
describe 'context scopes' do
|
53
69
|
before do
|
54
70
|
@tagging_2 = ActsAsTaggableOn::Tagging.new
|
@@ -61,12 +77,14 @@ describe ActsAsTaggableOn::Tagging do
|
|
61
77
|
@tagging.tag = ActsAsTaggableOn::Tag.create(name: "Physics")
|
62
78
|
@tagging.tagger = @tagger
|
63
79
|
@tagging.context = 'Science'
|
80
|
+
@tagging.tenant = 'account1'
|
64
81
|
@tagging.save
|
65
82
|
|
66
83
|
@tagging_2.taggable = TaggableModel.create(name: "Satellites")
|
67
84
|
@tagging_2.tag = ActsAsTaggableOn::Tag.create(name: "Technology")
|
68
85
|
@tagging_2.tagger = @tagger_2
|
69
86
|
@tagging_2.context = 'Science'
|
87
|
+
@tagging_2.tenant = 'account1'
|
70
88
|
@tagging_2.save
|
71
89
|
|
72
90
|
@tagging_3.taggable = TaggableModel.create(name: "Satellites")
|
@@ -98,6 +116,14 @@ describe ActsAsTaggableOn::Tagging do
|
|
98
116
|
end
|
99
117
|
end
|
100
118
|
|
119
|
+
describe '.by_tenant' do
|
120
|
+
it "should find taggings by tenant" do
|
121
|
+
expect(ActsAsTaggableOn::Tagging.by_tenant('account1').length).to eq(2);
|
122
|
+
expect(ActsAsTaggableOn::Tagging.by_tenant('account1').first).to eq(@tagging);
|
123
|
+
expect(ActsAsTaggableOn::Tagging.by_tenant('account1').second).to eq(@tagging_2);
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
101
127
|
describe '.not_owned' do
|
102
128
|
before do
|
103
129
|
@tagging_4 = ActsAsTaggableOn::Tagging.new
|
@@ -4,16 +4,12 @@ sqlite3:
|
|
4
4
|
|
5
5
|
mysql:
|
6
6
|
adapter: mysql2
|
7
|
-
host:
|
7
|
+
host: 127.0.0.1
|
8
8
|
username: root
|
9
9
|
password:
|
10
10
|
database: acts_as_taggable_on
|
11
|
-
|
11
|
+
encoding: utf8
|
12
12
|
|
13
13
|
postgresql:
|
14
|
-
|
15
|
-
|
16
|
-
username: postgres
|
17
|
-
password:
|
18
|
-
database: acts_as_taggable_on
|
19
|
-
encoding: utf8
|
14
|
+
# Needs to be given as a URL to force connection via TCP
|
15
|
+
url: postgresql://postgres:postgres@127.0.0.1:5432/acts_as_taggable_on?encoding=utf8
|
data/spec/internal/db/schema.rb
CHANGED
@@ -21,6 +21,8 @@ ActiveRecord::Schema.define version: 0 do
|
|
21
21
|
# length for MyISAM table type: http://bit.ly/vgW2Ql
|
22
22
|
t.string :context, limit: 128
|
23
23
|
|
24
|
+
t.string :tenant , limit: 128
|
25
|
+
|
24
26
|
t.datetime :created_at
|
25
27
|
end
|
26
28
|
add_index ActsAsTaggableOn.taggings_table,
|
@@ -34,6 +36,7 @@ ActiveRecord::Schema.define version: 0 do
|
|
34
36
|
create_table :taggable_models, force: true do |t|
|
35
37
|
t.column :name, :string
|
36
38
|
t.column :type, :string
|
39
|
+
t.column :tenant_id, :integer
|
37
40
|
end
|
38
41
|
|
39
42
|
create_table :columns_override_models, force: true do |t|
|
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: 8.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: 2021-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -110,9 +110,9 @@ executables: []
|
|
110
110
|
extensions: []
|
111
111
|
extra_rdoc_files: []
|
112
112
|
files:
|
113
|
+
- ".github/workflows/spec.yml"
|
113
114
|
- ".gitignore"
|
114
115
|
- ".rspec"
|
115
|
-
- ".travis.yml"
|
116
116
|
- Appraisals
|
117
117
|
- CHANGELOG.md
|
118
118
|
- CONTRIBUTING.md
|
@@ -121,7 +121,6 @@ files:
|
|
121
121
|
- LICENSE.md
|
122
122
|
- README.md
|
123
123
|
- Rakefile
|
124
|
-
- UPGRADING.md
|
125
124
|
- acts-as-taggable-on.gemspec
|
126
125
|
- db/migrate/1_acts_as_taggable_on_migration.rb
|
127
126
|
- db/migrate/2_add_missing_unique_indices.rb
|
@@ -129,6 +128,7 @@ files:
|
|
129
128
|
- db/migrate/4_add_missing_taggable_index.rb
|
130
129
|
- db/migrate/5_change_collation_for_tag_names.rb
|
131
130
|
- db/migrate/6_add_missing_indexes_on_taggings.rb
|
131
|
+
- db/migrate/7_add_tenant_to_taggings.rb
|
132
132
|
- gemfiles/activerecord_5.0.gemfile
|
133
133
|
- gemfiles/activerecord_5.1.gemfile
|
134
134
|
- gemfiles/activerecord_5.2.gemfile
|
@@ -200,15 +200,7 @@ homepage: https://github.com/mbleigh/acts-as-taggable-on
|
|
200
200
|
licenses:
|
201
201
|
- MIT
|
202
202
|
metadata: {}
|
203
|
-
post_install_message:
|
204
|
-
When upgrading
|
205
|
-
|
206
|
-
Re-run the migrations generator
|
207
|
-
|
208
|
-
rake acts_as_taggable_on_engine:install:migrations
|
209
|
-
|
210
|
-
This will create any new migrations and skip existing ones
|
211
|
-
Version 3.5.0 has a migration for mysql adapter
|
203
|
+
post_install_message:
|
212
204
|
rdoc_options: []
|
213
205
|
require_paths:
|
214
206
|
- lib
|
@@ -224,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
216
|
version: '0'
|
225
217
|
requirements: []
|
226
218
|
rubygems_version: 3.0.3
|
227
|
-
signing_key:
|
219
|
+
signing_key:
|
228
220
|
specification_version: 4
|
229
221
|
summary: Advanced tagging for Rails.
|
230
222
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
|
4
|
-
addons:
|
5
|
-
postgresql: '10'
|
6
|
-
|
7
|
-
services:
|
8
|
-
- mysql
|
9
|
-
- postgresql
|
10
|
-
|
11
|
-
rvm:
|
12
|
-
- 2.7.0
|
13
|
-
- 2.6.5
|
14
|
-
- 2.5.5
|
15
|
-
- 2.4.6
|
16
|
-
- 2.3.7
|
17
|
-
|
18
|
-
env:
|
19
|
-
- DB=sqlite3
|
20
|
-
- DB=mysql
|
21
|
-
- DB=postgresql
|
22
|
-
|
23
|
-
gemfile:
|
24
|
-
- gemfiles/activerecord_5.2.gemfile
|
25
|
-
- gemfiles/activerecord_5.1.gemfile
|
26
|
-
- gemfiles/activerecord_5.0.gemfile
|
27
|
-
- gemfiles/activerecord_6.0.gemfile
|
28
|
-
- gemfiles/activerecord_6.1.gemfile
|
29
|
-
|
30
|
-
bundler_args: '--without local_development --jobs 3 --retry 3'
|
31
|
-
|
32
|
-
before_install:
|
33
|
-
- gem install bundler
|
34
|
-
|
35
|
-
script: bundle exec rake
|
36
|
-
|
37
|
-
matrix:
|
38
|
-
allow_failures:
|
39
|
-
- rvm: ruby-head
|
40
|
-
fast_finish: true
|
41
|
-
exclude:
|
42
|
-
- rvm: 2.3.7
|
43
|
-
gemfile: gemfiles/activerecord_6.0.gemfile
|
44
|
-
- rvm: 2.4.6
|
45
|
-
gemfile: gemfiles/activerecord_6.0.gemfile
|
46
|
-
- rvm: 2.3.7
|
47
|
-
gemfile: gemfiles/activerecord_6.1.gemfile
|
48
|
-
- rvm: 2.4.6
|
49
|
-
gemfile: gemfiles/activerecord_6.1.gemfile
|