make_taggable 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dummyrc +17 -0
- data/.github/workflows/ci.yml +158 -0
- data/.gitignore +2 -1
- data/CONTRIBUTING.md +5 -31
- data/README.md +3 -8
- data/Rakefile +2 -0
- data/gemfiles/rails_5.gemfile +9 -0
- data/gemfiles/rails_6.gemfile +9 -0
- data/gemfiles/rails_6_1.gemfile +9 -0
- data/gemfiles/rails_master.gemfile +9 -0
- data/lib/make_taggable.rb +1 -1
- data/lib/make_taggable/tag.rb +1 -1
- data/lib/make_taggable/version.rb +1 -1
- data/lib/tasks/setup_test_db.rake +5 -3
- data/make_taggable.gemspec +13 -10
- metadata +27 -218
- data/.github/workflows/mysql_tests.yml +0 -56
- data/.github/workflows/pg_tests.yml +0 -56
- data/.github/workflows/sqlite_tests.yml +0 -47
- data/.github/workflows/standardrb-check.yml +0 -37
- data/.standard.yml +0 -18
- data/.standard_todo.yml +0 -5
- data/LICENSE.txt +0 -21
- data/spec/dummy/README.md +0 -0
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/config/manifest.js +0 -2
- data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
- data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
- data/spec/dummy/app/controllers/application_controller.rb +0 -2
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/jobs/application_job.rb +0 -7
- data/spec/dummy/app/mailers/application_mailer.rb +0 -4
- data/spec/dummy/app/models/altered_inheriting_taggable_model.rb +0 -5
- data/spec/dummy/app/models/application_record.rb +0 -3
- data/spec/dummy/app/models/cached_model.rb +0 -3
- data/spec/dummy/app/models/cached_model_with_array.rb +0 -5
- data/spec/dummy/app/models/columns_override_model.rb +0 -5
- data/spec/dummy/app/models/company.rb +0 -15
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/models/inheriting_taggable_model.rb +0 -4
- data/spec/dummy/app/models/market.rb +0 -2
- data/spec/dummy/app/models/non_standard_id_taggable_model.rb +0 -8
- data/spec/dummy/app/models/ordered_taggable_model.rb +0 -4
- data/spec/dummy/app/models/other_cached_model.rb +0 -3
- data/spec/dummy/app/models/other_taggable_model.rb +0 -4
- data/spec/dummy/app/models/student.rb +0 -4
- data/spec/dummy/app/models/taggable_model.rb +0 -14
- data/spec/dummy/app/models/taggable_model_with_json.rb +0 -6
- data/spec/dummy/app/models/untaggable_model.rb +0 -3
- data/spec/dummy/app/models/user.rb +0 -3
- data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/bin/setup +0 -33
- data/spec/dummy/config.ru +0 -5
- data/spec/dummy/config/application.rb +0 -13
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/cable.yml +0 -10
- data/spec/dummy/config/credentials.yml.enc +0 -1
- data/spec/dummy/config/database.yml +0 -7
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -52
- data/spec/dummy/config/environments/production.rb +0 -105
- data/spec/dummy/config/environments/test.rb +0 -49
- data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/cors.rb +0 -16
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -33
- data/spec/dummy/config/master.key +0 -1
- data/spec/dummy/config/mysql_database.yml.ci +0 -8
- data/spec/dummy/config/pg_database.yml.ci +0 -8
- data/spec/dummy/config/puma.rb +0 -38
- data/spec/dummy/config/routes.rb +0 -3
- data/spec/dummy/config/spring.rb +0 -6
- data/spec/dummy/config/storage.yml +0 -34
- data/spec/dummy/db/migrate/020201119220853_create_taggable_models.rb +0 -8
- data/spec/dummy/db/migrate/020201119221037_create_columns_override_models.rb +0 -9
- data/spec/dummy/db/migrate/020201119221121_create_non_standard_id_taggable_models.rb +0 -8
- data/spec/dummy/db/migrate/020201119221228_create_untaggable_models.rb +0 -8
- data/spec/dummy/db/migrate/020201119221247_create_cached_models.rb +0 -9
- data/spec/dummy/db/migrate/020201119221314_create_other_cached_models.rb +0 -11
- data/spec/dummy/db/migrate/020201119221343_create_companies.rb +0 -7
- data/spec/dummy/db/migrate/020201119221416_create_users.rb +0 -7
- data/spec/dummy/db/migrate/020201119221434_create_other_taggable_models.rb +0 -8
- data/spec/dummy/db/migrate/020201119221507_create_ordered_taggable_models.rb +0 -8
- data/spec/dummy/db/migrate/020201119221530_create_cache_methods_injected_models.rb +0 -7
- data/spec/dummy/db/migrate/020201119221629_create_other_cached_with_array_models.rb +0 -11
- data/spec/dummy/db/migrate/020201119221746_create_taggable_model_with_jsons.rb +0 -9
- data/spec/dummy/lib/tasks/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/robots.txt +0 -1
- data/spec/dummy/storage/.keep +0 -0
- data/spec/dummy/test/channels/application_cable/connection_test.rb +0 -11
- data/spec/dummy/test/controllers/.keep +0 -0
- data/spec/dummy/test/fixtures/.keep +0 -0
- data/spec/dummy/test/fixtures/files/.keep +0 -0
- data/spec/dummy/test/integration/.keep +0 -0
- data/spec/dummy/test/mailers/.keep +0 -0
- data/spec/dummy/test/models/.keep +0 -0
- data/spec/dummy/test/test_helper.rb +0 -13
- data/spec/dummy/vendor/.keep +0 -0
- data/spec/make_taggable/acts_as_tagger_spec.rb +0 -112
- data/spec/make_taggable/caching_spec.rb +0 -123
- data/spec/make_taggable/default_parser_spec.rb +0 -45
- data/spec/make_taggable/dirty_spec.rb +0 -140
- data/spec/make_taggable/generic_parser_spec.rb +0 -13
- data/spec/make_taggable/make_taggable_spec.rb +0 -260
- data/spec/make_taggable/related_spec.rb +0 -93
- data/spec/make_taggable/single_table_inheritance_spec.rb +0 -220
- data/spec/make_taggable/tag_list_spec.rb +0 -169
- data/spec/make_taggable/tag_spec.rb +0 -135
- data/spec/make_taggable/taggable_spec.rb +0 -804
- data/spec/make_taggable/tagger_spec.rb +0 -149
- data/spec/make_taggable/tagging_spec.rb +0 -115
- data/spec/make_taggable/tags_helper_spec.rb +0 -43
- data/spec/make_taggable/utils_spec.rb +0 -22
- data/spec/make_taggable_spec.rb +0 -5
- data/spec/spec_helper.rb +0 -16
- data/spec/support/array.rb +0 -9
- data/spec/support/helpers.rb +0 -31
@@ -1,56 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: MySQL Tests
|
3
|
-
|
4
|
-
on:
|
5
|
-
pull_request:
|
6
|
-
branches:
|
7
|
-
- '*'
|
8
|
-
push:
|
9
|
-
branches:
|
10
|
-
- master
|
11
|
-
jobs:
|
12
|
-
mysql:
|
13
|
-
runs-on: ubuntu-latest
|
14
|
-
strategy:
|
15
|
-
matrix:
|
16
|
-
ruby: ['2.5', '2.6', '2.7']
|
17
|
-
|
18
|
-
services:
|
19
|
-
mysql:
|
20
|
-
image: mysql:8
|
21
|
-
env:
|
22
|
-
MYSQL_ROOT_PASSWORD: password
|
23
|
-
MSQL_DATABASE: my_sql_test_db
|
24
|
-
ports: ['3306:3306']
|
25
|
-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
26
|
-
|
27
|
-
steps:
|
28
|
-
- uses: actions/checkout@master
|
29
|
-
|
30
|
-
- name: Set up Ruby ${{ matrix.ruby }}
|
31
|
-
uses: ruby/setup-ruby@v1
|
32
|
-
with:
|
33
|
-
ruby-version: ${{ matrix.ruby }}
|
34
|
-
|
35
|
-
- name: Cache gems
|
36
|
-
uses: actions/cache@v2
|
37
|
-
with:
|
38
|
-
path: vendor/bundle
|
39
|
-
key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
40
|
-
restore-keys: |
|
41
|
-
${{ runner.os }}-${{ matrix.ruby }}-gem-
|
42
|
-
|
43
|
-
- name: Install dependencies
|
44
|
-
run: |
|
45
|
-
gem install bundler
|
46
|
-
bundle install --jobs 4 --retry 3
|
47
|
-
bundle exec appraisal install
|
48
|
-
|
49
|
-
- name: Run tests
|
50
|
-
env:
|
51
|
-
DATABASE_URL: mysql2://root:password@127.0.0.1:3306/my_sql_test_db
|
52
|
-
RAILS_ENV: test
|
53
|
-
run: |
|
54
|
-
cp spec/dummy/config/mysql_database.yml.ci spec/dummy/config/database.yml
|
55
|
-
bundle exec rake test_app
|
56
|
-
bundle exec appraisal rake
|
@@ -1,56 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Postgres Tests
|
3
|
-
|
4
|
-
on:
|
5
|
-
pull_request:
|
6
|
-
branches:
|
7
|
-
- '*'
|
8
|
-
push:
|
9
|
-
branches:
|
10
|
-
- master
|
11
|
-
jobs:
|
12
|
-
postgres:
|
13
|
-
runs-on: ubuntu-latest
|
14
|
-
strategy:
|
15
|
-
matrix:
|
16
|
-
ruby: ['2.5', '2.6', '2.7']
|
17
|
-
|
18
|
-
services:
|
19
|
-
postgres:
|
20
|
-
image: postgres:12
|
21
|
-
env:
|
22
|
-
POSTGRES_USER: postgres
|
23
|
-
POSTGRES_PASSWORD: password
|
24
|
-
POSTGRES_DB: pg_test
|
25
|
-
ports: ['5432:5432']
|
26
|
-
|
27
|
-
steps:
|
28
|
-
- uses: actions/checkout@master
|
29
|
-
|
30
|
-
- name: Set up Ruby ${{ matrix.ruby }}
|
31
|
-
uses: ruby/setup-ruby@v1
|
32
|
-
with:
|
33
|
-
ruby-version: ${{ matrix.ruby }}
|
34
|
-
|
35
|
-
- name: Cache gems
|
36
|
-
uses: actions/cache@v2
|
37
|
-
with:
|
38
|
-
path: vendor/bundle
|
39
|
-
key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
40
|
-
restore-keys: |
|
41
|
-
${{ runner.os }}-${{ matrix.ruby }}-gem-
|
42
|
-
|
43
|
-
- name: Install dependencies
|
44
|
-
run: |
|
45
|
-
gem install bundler
|
46
|
-
bundle install --jobs 4 --retry 3
|
47
|
-
bundle exec appraisal install
|
48
|
-
|
49
|
-
- name: Run tests
|
50
|
-
env:
|
51
|
-
DATABASE_URL: postgres://postgres:password@localhost:5432/pg_test
|
52
|
-
RAILS_ENV: test
|
53
|
-
run: |
|
54
|
-
cp spec/dummy/config/pg_database.yml.ci spec/dummy/config/database.yml
|
55
|
-
bundle exec rake test_app
|
56
|
-
bundle exec appraisal rake
|
@@ -1,47 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: SQLite Tests
|
3
|
-
|
4
|
-
on:
|
5
|
-
pull_request:
|
6
|
-
branches:
|
7
|
-
- '*'
|
8
|
-
push:
|
9
|
-
branches:
|
10
|
-
- master
|
11
|
-
jobs:
|
12
|
-
sqlite:
|
13
|
-
runs-on: ubuntu-latest
|
14
|
-
strategy:
|
15
|
-
matrix:
|
16
|
-
ruby: ['2.5', '2.6', '2.7']
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@master
|
19
|
-
|
20
|
-
- name: Set up Ruby ${{ matrix.ruby }}
|
21
|
-
uses: ruby/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
ruby-version: ${{ matrix.ruby }}
|
24
|
-
|
25
|
-
- name: Cache gems
|
26
|
-
uses: actions/cache@v2
|
27
|
-
with:
|
28
|
-
path: vendor/bundle
|
29
|
-
key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
30
|
-
restore-keys: |
|
31
|
-
${{ runner.os }}-${{ matrix.ruby }}-gem-
|
32
|
-
|
33
|
-
- name: Install dependencies
|
34
|
-
run: |
|
35
|
-
sudo apt-get update
|
36
|
-
sudo apt-get install libsqlite3-dev
|
37
|
-
gem update --system
|
38
|
-
gem install bundler
|
39
|
-
bundle install --jobs 4 --retry 3
|
40
|
-
bundle exec appraisal install
|
41
|
-
|
42
|
-
- name: Run tests
|
43
|
-
env:
|
44
|
-
RAILS_ENV: test
|
45
|
-
run: |
|
46
|
-
bundle exec rake test_app
|
47
|
-
bundle exec appraisal rake
|
@@ -1,37 +0,0 @@
|
|
1
|
-
name: Standard Rb
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
branches:
|
6
|
-
- '*'
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
|
11
|
-
jobs:
|
12
|
-
standard:
|
13
|
-
name: StandardRB Check Action
|
14
|
-
runs-on: ubuntu-latest
|
15
|
-
steps:
|
16
|
-
- uses: actions/checkout@master
|
17
|
-
|
18
|
-
- name: Set up Ruby 2.7
|
19
|
-
uses: actions/setup-ruby@v1
|
20
|
-
with:
|
21
|
-
ruby-version: 2.7.x
|
22
|
-
|
23
|
-
- uses: actions/cache@v1
|
24
|
-
with:
|
25
|
-
path: vendor/bundle
|
26
|
-
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
27
|
-
restore-keys: |
|
28
|
-
${{ runner.os }}-gems-
|
29
|
-
|
30
|
-
- name: Bundle install
|
31
|
-
run: |
|
32
|
-
gem install bundler
|
33
|
-
bundle config path vendor/bundle
|
34
|
-
bundle install --jobs 4 --retry 3
|
35
|
-
|
36
|
-
- name: Run StandardRB
|
37
|
-
run: bundle exec standardrb --format progress
|
data/.standard.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# Auto generated files with errors to ignore.
|
2
|
-
# Remove from this list as you refactor files.
|
3
|
-
---
|
4
|
-
ignore:
|
5
|
-
- spec/dummy/Rakefile
|
6
|
-
- spec/dummy/app/mailers/application_mailer.rb
|
7
|
-
- spec/dummy/bin/rails
|
8
|
-
- spec/dummy/bin/rake
|
9
|
-
- spec/dummy/bin/setup
|
10
|
-
- spec/dummy/config.ru
|
11
|
-
- spec/dummy/config/application.rb
|
12
|
-
- spec/dummy/config/environment.rb
|
13
|
-
- spec/dummy/config/environments/development.rb
|
14
|
-
- spec/dummy/config/environments/production.rb
|
15
|
-
- spec/dummy/config/environments/test.rb
|
16
|
-
- spec/dummy/config/puma.rb
|
17
|
-
- spec/dummy/db/schema.rb
|
18
|
-
- spec/dummy/test/test_helper.rb
|
data/.standard_todo.yml
DELETED
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2020 Matthew Kennedy
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/spec/dummy/README.md
DELETED
File without changes
|
data/spec/dummy/Rakefile
DELETED
File without changes
|
@@ -1,7 +0,0 @@
|
|
1
|
-
class ApplicationJob < ActiveJob::Base
|
2
|
-
# Automatically retry jobs that encountered a deadlock
|
3
|
-
# retry_on ActiveRecord::Deadlocked
|
4
|
-
|
5
|
-
# Most jobs are safe to ignore if the underlying records are no longer available
|
6
|
-
# discard_on ActiveJob::DeserializationError
|
7
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class Company < ActiveRecord::Base
|
2
|
-
make_taggable :locations, :markets
|
3
|
-
|
4
|
-
has_many :markets, through: :market_taggings, source: :tag
|
5
|
-
|
6
|
-
private
|
7
|
-
|
8
|
-
def find_or_create_tags_from_list_with_context(tag_list, context)
|
9
|
-
if context.to_sym == :markets
|
10
|
-
Market.find_or_create_all_with_like_by_name(tag_list)
|
11
|
-
else
|
12
|
-
super
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
File without changes
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class TaggableModel < ActiveRecord::Base
|
2
|
-
acts_as_taggable
|
3
|
-
make_taggable :languages
|
4
|
-
make_taggable :skills
|
5
|
-
make_taggable :needs, :offerings
|
6
|
-
has_many :untaggable_models
|
7
|
-
|
8
|
-
attr_reader :tag_list_submethod_called
|
9
|
-
|
10
|
-
def tag_list=(v)
|
11
|
-
@tag_list_submethod_called = true
|
12
|
-
super
|
13
|
-
end
|
14
|
-
end
|