make_taggable 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.dummyrc +17 -0
  3. data/.github/workflows/ci.yml +158 -0
  4. data/.gitignore +2 -1
  5. data/CONTRIBUTING.md +5 -31
  6. data/README.md +3 -8
  7. data/Rakefile +2 -0
  8. data/gemfiles/rails_5.gemfile +9 -0
  9. data/gemfiles/rails_6.gemfile +9 -0
  10. data/gemfiles/rails_6_1.gemfile +9 -0
  11. data/gemfiles/rails_master.gemfile +9 -0
  12. data/lib/make_taggable.rb +1 -1
  13. data/lib/make_taggable/tag.rb +1 -1
  14. data/lib/make_taggable/version.rb +1 -1
  15. data/lib/tasks/setup_test_db.rake +5 -3
  16. data/make_taggable.gemspec +13 -10
  17. metadata +27 -218
  18. data/.github/workflows/mysql_tests.yml +0 -56
  19. data/.github/workflows/pg_tests.yml +0 -56
  20. data/.github/workflows/sqlite_tests.yml +0 -47
  21. data/.github/workflows/standardrb-check.yml +0 -37
  22. data/.standard.yml +0 -18
  23. data/.standard_todo.yml +0 -5
  24. data/LICENSE.txt +0 -21
  25. data/spec/dummy/README.md +0 -0
  26. data/spec/dummy/Rakefile +0 -6
  27. data/spec/dummy/app/assets/config/manifest.js +0 -2
  28. data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
  29. data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
  30. data/spec/dummy/app/controllers/application_controller.rb +0 -2
  31. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  32. data/spec/dummy/app/jobs/application_job.rb +0 -7
  33. data/spec/dummy/app/mailers/application_mailer.rb +0 -4
  34. data/spec/dummy/app/models/altered_inheriting_taggable_model.rb +0 -5
  35. data/spec/dummy/app/models/application_record.rb +0 -3
  36. data/spec/dummy/app/models/cached_model.rb +0 -3
  37. data/spec/dummy/app/models/cached_model_with_array.rb +0 -5
  38. data/spec/dummy/app/models/columns_override_model.rb +0 -5
  39. data/spec/dummy/app/models/company.rb +0 -15
  40. data/spec/dummy/app/models/concerns/.keep +0 -0
  41. data/spec/dummy/app/models/inheriting_taggable_model.rb +0 -4
  42. data/spec/dummy/app/models/market.rb +0 -2
  43. data/spec/dummy/app/models/non_standard_id_taggable_model.rb +0 -8
  44. data/spec/dummy/app/models/ordered_taggable_model.rb +0 -4
  45. data/spec/dummy/app/models/other_cached_model.rb +0 -3
  46. data/spec/dummy/app/models/other_taggable_model.rb +0 -4
  47. data/spec/dummy/app/models/student.rb +0 -4
  48. data/spec/dummy/app/models/taggable_model.rb +0 -14
  49. data/spec/dummy/app/models/taggable_model_with_json.rb +0 -6
  50. data/spec/dummy/app/models/untaggable_model.rb +0 -3
  51. data/spec/dummy/app/models/user.rb +0 -3
  52. data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
  53. data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
  54. data/spec/dummy/bin/rails +0 -4
  55. data/spec/dummy/bin/rake +0 -4
  56. data/spec/dummy/bin/setup +0 -33
  57. data/spec/dummy/config.ru +0 -5
  58. data/spec/dummy/config/application.rb +0 -13
  59. data/spec/dummy/config/boot.rb +0 -5
  60. data/spec/dummy/config/cable.yml +0 -10
  61. data/spec/dummy/config/credentials.yml.enc +0 -1
  62. data/spec/dummy/config/database.yml +0 -7
  63. data/spec/dummy/config/environment.rb +0 -5
  64. data/spec/dummy/config/environments/development.rb +0 -52
  65. data/spec/dummy/config/environments/production.rb +0 -105
  66. data/spec/dummy/config/environments/test.rb +0 -49
  67. data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
  68. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  69. data/spec/dummy/config/initializers/cors.rb +0 -16
  70. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  71. data/spec/dummy/config/initializers/inflections.rb +0 -16
  72. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  73. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  74. data/spec/dummy/config/locales/en.yml +0 -33
  75. data/spec/dummy/config/master.key +0 -1
  76. data/spec/dummy/config/mysql_database.yml.ci +0 -8
  77. data/spec/dummy/config/pg_database.yml.ci +0 -8
  78. data/spec/dummy/config/puma.rb +0 -38
  79. data/spec/dummy/config/routes.rb +0 -3
  80. data/spec/dummy/config/spring.rb +0 -6
  81. data/spec/dummy/config/storage.yml +0 -34
  82. data/spec/dummy/db/migrate/020201119220853_create_taggable_models.rb +0 -8
  83. data/spec/dummy/db/migrate/020201119221037_create_columns_override_models.rb +0 -9
  84. data/spec/dummy/db/migrate/020201119221121_create_non_standard_id_taggable_models.rb +0 -8
  85. data/spec/dummy/db/migrate/020201119221228_create_untaggable_models.rb +0 -8
  86. data/spec/dummy/db/migrate/020201119221247_create_cached_models.rb +0 -9
  87. data/spec/dummy/db/migrate/020201119221314_create_other_cached_models.rb +0 -11
  88. data/spec/dummy/db/migrate/020201119221343_create_companies.rb +0 -7
  89. data/spec/dummy/db/migrate/020201119221416_create_users.rb +0 -7
  90. data/spec/dummy/db/migrate/020201119221434_create_other_taggable_models.rb +0 -8
  91. data/spec/dummy/db/migrate/020201119221507_create_ordered_taggable_models.rb +0 -8
  92. data/spec/dummy/db/migrate/020201119221530_create_cache_methods_injected_models.rb +0 -7
  93. data/spec/dummy/db/migrate/020201119221629_create_other_cached_with_array_models.rb +0 -11
  94. data/spec/dummy/db/migrate/020201119221746_create_taggable_model_with_jsons.rb +0 -9
  95. data/spec/dummy/lib/tasks/.keep +0 -0
  96. data/spec/dummy/log/.keep +0 -0
  97. data/spec/dummy/public/robots.txt +0 -1
  98. data/spec/dummy/storage/.keep +0 -0
  99. data/spec/dummy/test/channels/application_cable/connection_test.rb +0 -11
  100. data/spec/dummy/test/controllers/.keep +0 -0
  101. data/spec/dummy/test/fixtures/.keep +0 -0
  102. data/spec/dummy/test/fixtures/files/.keep +0 -0
  103. data/spec/dummy/test/integration/.keep +0 -0
  104. data/spec/dummy/test/mailers/.keep +0 -0
  105. data/spec/dummy/test/models/.keep +0 -0
  106. data/spec/dummy/test/test_helper.rb +0 -13
  107. data/spec/dummy/vendor/.keep +0 -0
  108. data/spec/make_taggable/acts_as_tagger_spec.rb +0 -112
  109. data/spec/make_taggable/caching_spec.rb +0 -123
  110. data/spec/make_taggable/default_parser_spec.rb +0 -45
  111. data/spec/make_taggable/dirty_spec.rb +0 -140
  112. data/spec/make_taggable/generic_parser_spec.rb +0 -13
  113. data/spec/make_taggable/make_taggable_spec.rb +0 -260
  114. data/spec/make_taggable/related_spec.rb +0 -93
  115. data/spec/make_taggable/single_table_inheritance_spec.rb +0 -220
  116. data/spec/make_taggable/tag_list_spec.rb +0 -169
  117. data/spec/make_taggable/tag_spec.rb +0 -135
  118. data/spec/make_taggable/taggable_spec.rb +0 -804
  119. data/spec/make_taggable/tagger_spec.rb +0 -149
  120. data/spec/make_taggable/tagging_spec.rb +0 -115
  121. data/spec/make_taggable/tags_helper_spec.rb +0 -43
  122. data/spec/make_taggable/utils_spec.rb +0 -22
  123. data/spec/make_taggable_spec.rb +0 -5
  124. data/spec/spec_helper.rb +0 -16
  125. data/spec/support/array.rb +0 -9
  126. 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
@@ -1,5 +0,0 @@
1
- # Auto generated files with errors to ignore.
2
- # Remove from this list as you refactor files.
3
- ---
4
- ignore:
5
- - spec/make_taggable/caching_spec.rb
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
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require_relative 'config/application'
5
-
6
- Rails.application.load_tasks
@@ -1,2 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../stylesheets .css
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Channel < ActionCable::Channel::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Connection < ActionCable::Connection::Base
3
- end
4
- end
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::API
2
- end
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,4 +0,0 @@
1
- class ApplicationMailer < ActionMailer::Base
2
- default from: 'from@example.com'
3
- layout 'mailer'
4
- end
@@ -1,5 +0,0 @@
1
- require_relative "taggable_model"
2
-
3
- class AlteredInheritingTaggableModel < TaggableModel
4
- make_taggable :parts
5
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
@@ -1,3 +0,0 @@
1
- class CachedModel < ActiveRecord::Base
2
- acts_as_taggable
3
- end
@@ -1,5 +0,0 @@
1
- if using_postgresql?
2
- class CachedModelWithArray < ActiveRecord::Base
3
- acts_as_taggable
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class ColumnsOverrideModel < ActiveRecord::Base
2
- def self.columns
3
- super.reject { |c| c.name == "ignored_column" }
4
- end
5
- 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,4 +0,0 @@
1
- require_relative "taggable_model"
2
-
3
- class InheritingTaggableModel < TaggableModel
4
- end
@@ -1,2 +0,0 @@
1
- class Market < MakeTaggable::Tag
2
- end
@@ -1,8 +0,0 @@
1
- class NonStandardIdTaggableModel < ActiveRecord::Base
2
- self.primary_key = :an_id
3
- acts_as_taggable
4
- make_taggable :languages
5
- make_taggable :skills
6
- make_taggable :needs, :offerings
7
- has_many :untaggable_models
8
- end
@@ -1,4 +0,0 @@
1
- class OrderedTaggableModel < ActiveRecord::Base
2
- acts_as_ordered_taggable
3
- acts_as_ordered_taggable_on :colours
4
- end
@@ -1,3 +0,0 @@
1
- class OtherCachedModel < ActiveRecord::Base
2
- make_taggable :languages, :statuses, :glasses
3
- end
@@ -1,4 +0,0 @@
1
- class OtherTaggableModel < ActiveRecord::Base
2
- make_taggable :tags, :languages
3
- make_taggable :needs, :offerings
4
- end
@@ -1,4 +0,0 @@
1
- require_relative "user"
2
-
3
- class Student < User
4
- end
@@ -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
@@ -1,6 +0,0 @@
1
- if using_postgresql? && postgresql_support_json?
2
- class TaggableModelWithJson < ActiveRecord::Base
3
- acts_as_taggable
4
- make_taggable :skills
5
- end
6
- end
@@ -1,3 +0,0 @@
1
- class UntaggableModel < ActiveRecord::Base
2
- belongs_to :taggable_model
3
- end
@@ -1,3 +0,0 @@
1
- class User < ActiveRecord::Base
2
- acts_as_tagger
3
- end
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <style>
6
- /* Email styles need to be inline */
7
- </style>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>