make_taggable 0.6.6 → 0.7.4
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 +115 -22
- data/.github/workflows/standard-ci.yml +27 -0
- data/.gitignore +4 -0
- data/Appraisals +4 -0
- data/CONTRIBUTING.md +5 -31
- data/README.md +59 -28
- data/Rakefile +3 -0
- data/gemfiles/rails_6_1.gemfile +9 -0
- data/lib/make_taggable.rb +4 -4
- data/lib/make_taggable/tag.rb +1 -1
- data/lib/make_taggable/version.rb +1 -2
- data/lib/tasks/setup_test_db.rake +8 -0
- data/make_taggable.gemspec +29 -15
- metadata +109 -252
- data/.standard.yml +0 -18
- data/.standard_todo.yml +0 -5
- data/.travis.yml +0 -36
- data/LICENSE.txt +0 -21
- data/spec/dummy/README.md +0 -24
- 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 -11
- 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/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 -19
- 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 -25
- 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/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/20201119220853_create_taggable_models.rb +0 -8
- data/spec/dummy/db/migrate/20201119221037_create_columns_override_models.rb +0 -9
- data/spec/dummy/db/migrate/20201119221121_create_non_standard_id_taggable_models.rb +0 -8
- data/spec/dummy/db/migrate/20201119221228_create_untaggable_models.rb +0 -8
- data/spec/dummy/db/migrate/20201119221247_create_cached_models.rb +0 -9
- data/spec/dummy/db/migrate/20201119221314_create_other_cached_models.rb +0 -11
- data/spec/dummy/db/migrate/20201119221343_create_companies.rb +0 -7
- data/spec/dummy/db/migrate/20201119221416_create_users.rb +0 -7
- data/spec/dummy/db/migrate/20201119221434_create_other_taggable_models.rb +0 -8
- data/spec/dummy/db/migrate/20201119221507_create_ordered_taggable_models.rb +0 -8
- data/spec/dummy/db/migrate/20201119221530_create_cache_methods_injected_models.rb +0 -7
- data/spec/dummy/db/migrate/20201119221629_create_other_cached_with_array_models.rb +0 -11
- data/spec/dummy/db/migrate/20201119221746_create_taggable_model_with_jsons.rb +0 -9
- data/spec/dummy/db/migrate/20201121222007_create_make_taggable_tags.make_taggable_engine.rb +0 -11
- data/spec/dummy/db/migrate/20201121222008_create_make_taggable_taggings.make_taggable_engine.rb +0 -13
- data/spec/dummy/db/migrate/20201121222009_change_tag_name_collation_mysql.make_taggable_engine.rb +0 -8
- data/spec/dummy/db/migrate/20201121222010_add_index_to_tags.make_taggable_engine.rb +0 -6
- data/spec/dummy/db/migrate/20201121222011_add_index_to_taggings.make_taggable_engine.rb +0 -13
- data/spec/dummy/db/schema.rb +0 -117
- data/spec/dummy/db/seeds.rb +0 -7
- 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 -297
- 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 -18
- data/spec/support/array.rb +0 -9
- data/spec/support/helpers.rb +0 -31
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/.travis.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
---
|
2
|
-
os: linux
|
3
|
-
dist: bionic
|
4
|
-
language: ruby
|
5
|
-
cache: bundler
|
6
|
-
|
7
|
-
services:
|
8
|
-
- mysql
|
9
|
-
- postgresql
|
10
|
-
|
11
|
-
rvm:
|
12
|
-
- 2.7
|
13
|
-
- 2.6
|
14
|
-
- 2.5
|
15
|
-
|
16
|
-
env:
|
17
|
-
- DB=sqlite3
|
18
|
-
- DB=mysql
|
19
|
-
- DB=postgresql
|
20
|
-
|
21
|
-
gemfile:
|
22
|
-
- gemfiles/rails_5.gemfile
|
23
|
-
- gemfiles/rails_6.gemfile
|
24
|
-
- gemfiles/rails_master.gemfile
|
25
|
-
|
26
|
-
bundler_args: '--without local_development --jobs 3 --retry 3'
|
27
|
-
|
28
|
-
before_install:
|
29
|
-
- gem update bundler
|
30
|
-
|
31
|
-
script: bundle exec rake
|
32
|
-
|
33
|
-
jobs:
|
34
|
-
allow_failures:
|
35
|
-
- rvm: ruby-head
|
36
|
-
fast_finish: true
|
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
@@ -1,24 +0,0 @@
|
|
1
|
-
# README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
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
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= yield %>
|
data/spec/dummy/bin/rails
DELETED
data/spec/dummy/bin/rake
DELETED
data/spec/dummy/bin/setup
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'fileutils'
|
3
|
-
|
4
|
-
# path to your application root.
|
5
|
-
APP_ROOT = File.expand_path('..', __dir__)
|
6
|
-
|
7
|
-
def system!(*args)
|
8
|
-
system(*args) || abort("\n== Command #{args} failed ==")
|
9
|
-
end
|
10
|
-
|
11
|
-
FileUtils.chdir APP_ROOT do
|
12
|
-
# This script is a way to setup or update your development environment automatically.
|
13
|
-
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
14
|
-
# Add necessary setup steps to this file.
|
15
|
-
|
16
|
-
puts '== Installing dependencies =='
|
17
|
-
system! 'gem install bundler --conservative'
|
18
|
-
system('bundle check') || system!('bundle install')
|
19
|
-
|
20
|
-
# puts "\n== Copying sample files =="
|
21
|
-
# unless File.exist?('config/database.yml')
|
22
|
-
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
23
|
-
# end
|
24
|
-
|
25
|
-
puts "\n== Preparing database =="
|
26
|
-
system! 'bin/rails db:prepare'
|
27
|
-
|
28
|
-
puts "\n== Removing old logs and tempfiles =="
|
29
|
-
system! 'bin/rails log:clear tmp:clear'
|
30
|
-
|
31
|
-
puts "\n== Restarting application server =="
|
32
|
-
system! 'bin/rails restart'
|
33
|
-
end
|
data/spec/dummy/config.ru
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require_relative "boot"
|
2
|
-
|
3
|
-
require "rails/all"
|
4
|
-
|
5
|
-
Bundler.require(*Rails.groups)
|
6
|
-
require "make_taggable"
|
7
|
-
|
8
|
-
module Dummy
|
9
|
-
class Application < Rails::Application
|
10
|
-
# Settings in config/environments/* take precedence over those specified here.
|
11
|
-
# Application configuration can go into files in config/initializers
|
12
|
-
# -- all .rb files in that directory are automatically loaded after loading
|
13
|
-
# the framework and any gems in your application.
|
14
|
-
|
15
|
-
if Rails.gem_version < Gem::Version.new("6.0") && config.active_record.sqlite3
|
16
|
-
config.active_record.sqlite3.represent_boolean_as_integer = true
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/spec/dummy/config/boot.rb
DELETED
data/spec/dummy/config/cable.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
EHJSLmmVyXr73mlc7dlqtmgrhwwgGPdKsBLeZS1hAfyxh8t0oAHTAfp4NlS/lZuPdKudjOXNPPqR7xquBX9hhChgaKlyU7BeQW2E6ei7yRjCt8W99IPnY6CwIEfUlSp32WHCDzWW+UQlcH7F5U5OZxVesEd45z7uwNIv/+EUxbikiEbnCU2rzezJLd1fvIQAkd6JAQClyAf8jSr8s2lTJb3zjdnGlK/+gREuXKpDEtd91xGPQBXBxnsCsQvqFOqDfFkszZoE4mT/rNH4aTMEi9z51kSXzjGL2H3c5sIHc4/O7MtVXszlcLZSK++0+r+DBp/RPh7a1HHgYZrlgeKNWoo9oGafxpPFXLcN4jFWn/1AkkWGfuFruE30g+UHI9a1hK3COYLtjdMya7OfwEfu+s20ch9jmAgBRLEu--HQe07W56wFrAG77r--zTtGPckDLMNiua7vypaPyg==
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# SQLite. Versions 3.8.0 and up are supported.
|
2
|
-
# gem install sqlite3
|
3
|
-
#
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
-
# gem 'sqlite3'
|
6
|
-
#
|
7
|
-
default: &default
|
8
|
-
adapter: sqlite3
|
9
|
-
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
10
|
-
timeout: 5000
|
11
|
-
|
12
|
-
development:
|
13
|
-
<<: *default
|
14
|
-
database: db/development.sqlite3
|
15
|
-
|
16
|
-
# Warning: The database defined as "test" will be erased and
|
17
|
-
# re-generated from your development database when you run "rake".
|
18
|
-
# Do not set this db to the same as development or production.
|
19
|
-
test:
|
20
|
-
<<: *default
|
21
|
-
database: db/test.sqlite3
|
22
|
-
|
23
|
-
production:
|
24
|
-
<<: *default
|
25
|
-
database: db/production.sqlite3
|
@@ -1,52 +0,0 @@
|
|
1
|
-
Rails.application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
-
|
4
|
-
# In the development environment your application's code is reloaded on
|
5
|
-
# every request. This slows down response time but is perfect for development
|
6
|
-
# since you don't have to restart the web server when you make code changes.
|
7
|
-
config.cache_classes = false
|
8
|
-
|
9
|
-
# Do not eager load code on boot.
|
10
|
-
config.eager_load = false
|
11
|
-
|
12
|
-
# Show full error reports.
|
13
|
-
config.consider_all_requests_local = true
|
14
|
-
|
15
|
-
# Enable/disable caching. By default caching is disabled.
|
16
|
-
# Run rails dev:cache to toggle caching.
|
17
|
-
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
18
|
-
config.cache_store = :memory_store
|
19
|
-
config.public_file_server.headers = {
|
20
|
-
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
21
|
-
}
|
22
|
-
else
|
23
|
-
config.action_controller.perform_caching = false
|
24
|
-
|
25
|
-
config.cache_store = :null_store
|
26
|
-
end
|
27
|
-
|
28
|
-
# Store uploaded files on the local file system (see config/storage.yml for options).
|
29
|
-
config.active_storage.service = :local
|
30
|
-
|
31
|
-
# Don't care if the mailer can't send.
|
32
|
-
config.action_mailer.raise_delivery_errors = false
|
33
|
-
|
34
|
-
config.action_mailer.perform_caching = false
|
35
|
-
|
36
|
-
# Print deprecation notices to the Rails logger.
|
37
|
-
config.active_support.deprecation = :log
|
38
|
-
|
39
|
-
# Raise an error on page load if there are pending migrations.
|
40
|
-
config.active_record.migration_error = :page_load
|
41
|
-
|
42
|
-
# Highlight code that triggered database queries in logs.
|
43
|
-
config.active_record.verbose_query_logs = true
|
44
|
-
|
45
|
-
|
46
|
-
# Raises error for missing translations.
|
47
|
-
# config.action_view.raise_on_missing_translations = true
|
48
|
-
|
49
|
-
# Use an evented file watcher to asynchronously detect changes in source code,
|
50
|
-
# routes, locales, etc. This feature depends on the listen gem.
|
51
|
-
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
52
|
-
end
|