make_taggable 0.6.3 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/mysql_tests.yml +56 -0
  3. data/.github/workflows/pg_tests.yml +56 -0
  4. data/.github/workflows/{ci.yml → sqlite_tests.yml} +10 -10
  5. data/.github/workflows/standardrb-check.yml +37 -0
  6. data/.gitignore +3 -0
  7. data/Appraisals +4 -0
  8. data/README.md +77 -33
  9. data/Rakefile +4 -0
  10. data/UPGRADING.md +5 -0
  11. data/db/migrate/3_change_tag_name_collation_mysql.rb +7 -0
  12. data/db/migrate/{3_add_index_to_tags.rb → 4_add_index_to_tags.rb} +0 -0
  13. data/db/migrate/{4_add_index_to_taggings.rb → 5_add_index_to_taggings.rb} +0 -0
  14. data/lib/make_taggable.rb +3 -3
  15. data/lib/make_taggable/taggable/tagged_with_query/query_base.rb +4 -4
  16. data/lib/make_taggable/tagger.rb +1 -1
  17. data/lib/make_taggable/tagging.rb +1 -1
  18. data/lib/make_taggable/version.rb +1 -2
  19. data/lib/tasks/setup_test_db.rake +6 -0
  20. data/make_taggable.gemspec +22 -8
  21. data/spec/dummy/README.md +0 -24
  22. data/spec/dummy/app/models/cached_model_with_array.rb +0 -6
  23. data/spec/dummy/app/models/taggable_model_with_json.rb +6 -0
  24. data/spec/dummy/config/application.rb +2 -8
  25. data/spec/dummy/config/database.yml +1 -19
  26. data/spec/dummy/config/mysql_database.yml.ci +8 -0
  27. data/spec/dummy/config/pg_database.yml.ci +8 -0
  28. data/spec/dummy/db/migrate/{20201119220853_create_taggable_models.rb → 020201119220853_create_taggable_models.rb} +0 -0
  29. data/spec/dummy/db/migrate/{20201119221037_create_columns_override_models.rb → 020201119221037_create_columns_override_models.rb} +0 -0
  30. data/spec/dummy/db/migrate/{20201119221121_create_non_standard_id_taggable_models.rb → 020201119221121_create_non_standard_id_taggable_models.rb} +0 -0
  31. data/spec/dummy/db/migrate/{20201119221228_create_untaggable_models.rb → 020201119221228_create_untaggable_models.rb} +0 -0
  32. data/spec/dummy/db/migrate/{20201119221247_create_cached_models.rb → 020201119221247_create_cached_models.rb} +0 -0
  33. data/spec/dummy/db/migrate/{20201119221314_create_other_cached_models.rb → 020201119221314_create_other_cached_models.rb} +0 -0
  34. data/spec/dummy/db/migrate/{20201119221343_create_companies.rb → 020201119221343_create_companies.rb} +0 -0
  35. data/spec/dummy/db/migrate/{20201119221416_create_users.rb → 020201119221416_create_users.rb} +0 -0
  36. data/spec/dummy/db/migrate/{20201119221434_create_other_taggable_models.rb → 020201119221434_create_other_taggable_models.rb} +0 -0
  37. data/spec/dummy/db/migrate/{20201119221507_create_ordered_taggable_models.rb → 020201119221507_create_ordered_taggable_models.rb} +0 -0
  38. data/spec/dummy/db/migrate/{20201119221530_create_cache_methods_injected_models.rb → 020201119221530_create_cache_methods_injected_models.rb} +0 -0
  39. data/spec/dummy/db/migrate/{20201119221629_create_other_cached_with_array_models.rb → 020201119221629_create_other_cached_with_array_models.rb} +0 -0
  40. data/spec/dummy/db/migrate/{20201119221746_create_taggable_model_with_jsons.rb → 020201119221746_create_taggable_model_with_jsons.rb} +0 -0
  41. data/spec/make_taggable/tag_spec.rb +88 -250
  42. data/spec/make_taggable/taggable_spec.rb +1 -1
  43. data/spec/spec_helper.rb +0 -2
  44. metadata +116 -80
  45. data/.travis.yml +0 -36
  46. data/gemfiles/rails_5.gemfile +0 -9
  47. data/gemfiles/rails_6.gemfile +0 -9
  48. data/gemfiles/rails_master.gemfile +0 -9
  49. data/spec/dummy/db/migrate/20201119222429_create_make_taggable_tags.make_taggable_engine.rb +0 -11
  50. data/spec/dummy/db/migrate/20201119222430_create_make_taggable_taggings.make_taggable_engine.rb +0 -13
  51. data/spec/dummy/db/migrate/20201119222431_add_index_to_tags.make_taggable_engine.rb +0 -6
  52. data/spec/dummy/db/migrate/20201119222432_add_index_to_taggings.make_taggable_engine.rb +0 -13
  53. data/spec/dummy/db/schema.rb +0 -117
  54. data/spec/dummy/db/seeds.rb +0 -7
@@ -1,6 +0,0 @@
1
- # This migration comes from make_taggable_engine (originally 3)
2
- class AddIndexToTags < ActiveRecord::Migration[5.2]
3
- def change
4
- add_index MakeTaggable.tags_table, :name, unique: true
5
- end
6
- end
@@ -1,13 +0,0 @@
1
- # This migration comes from make_taggable_engine (originally 4)
2
- class AddIndexToTaggings < ActiveRecord::Migration[5.2]
3
- def change
4
- add_index MakeTaggable.taggings_table, :taggable_id
5
- add_index MakeTaggable.taggings_table, :tagger_id
6
- add_index MakeTaggable.taggings_table, :taggable_type
7
- add_index MakeTaggable.taggings_table, :context
8
- add_index MakeTaggable.taggings_table, [:tagger_id, :tagger_type]
9
- add_index MakeTaggable.taggings_table, [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], unique: true, name: "taggings_idx"
10
- add_index MakeTaggable.taggings_table, [:taggable_id, :taggable_type, :context], name: "taggings_taggable_context_idx"
11
- add_index MakeTaggable.taggings_table, [:taggable_id, :taggable_type, :tagger_id, :context], name: "taggings_idy"
12
- end
13
- end
@@ -1,117 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `rails
6
- # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 2020_11_19_222432) do
14
-
15
- create_table "cache_methods_injected_models", force: :cascade do |t|
16
- t.string "cached_tag_list"
17
- end
18
-
19
- create_table "cached_models", force: :cascade do |t|
20
- t.string "name"
21
- t.string "type"
22
- t.string "cached_tag_list"
23
- end
24
-
25
- create_table "columns_override_models", force: :cascade do |t|
26
- t.string "name"
27
- t.string "type"
28
- t.string "ignored_column"
29
- end
30
-
31
- create_table "companies", force: :cascade do |t|
32
- t.string "name"
33
- end
34
-
35
- create_table "non_standard_id_taggable_models", primary_key: "an_id", force: :cascade do |t|
36
- t.string "name"
37
- t.string "type"
38
- end
39
-
40
- create_table "ordered_taggable_models", force: :cascade do |t|
41
- t.string "name"
42
- t.string "type"
43
- end
44
-
45
- create_table "other_cached_models", force: :cascade do |t|
46
- t.string "name"
47
- t.string "type"
48
- t.string "cached_language_list"
49
- t.string "cached_status_list"
50
- t.string "cached_glass_list"
51
- end
52
-
53
- create_table "other_cached_with_array_models", force: :cascade do |t|
54
- t.string "name"
55
- t.string "type"
56
- t.string "cached_language_list"
57
- t.string "cached_status_list"
58
- t.string "cached_glass_list"
59
- end
60
-
61
- create_table "other_taggable_models", force: :cascade do |t|
62
- t.string "name"
63
- t.string "type"
64
- end
65
-
66
- create_table "taggable_model_with_jsons", force: :cascade do |t|
67
- t.string "name"
68
- t.string "type"
69
- t.json "opts"
70
- end
71
-
72
- create_table "taggable_models", force: :cascade do |t|
73
- t.string "name"
74
- t.string "type"
75
- end
76
-
77
- create_table "taggings", force: :cascade do |t|
78
- t.integer "tag_id"
79
- t.string "taggable_type"
80
- t.integer "taggable_id"
81
- t.string "tagger_type"
82
- t.integer "tagger_id"
83
- t.string "context", limit: 128
84
- t.datetime "created_at", null: false
85
- t.datetime "updated_at", null: false
86
- t.index ["context"], name: "index_taggings_on_context"
87
- t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
88
- t.index ["tag_id"], name: "index_taggings_on_tag_id"
89
- t.index ["taggable_id", "taggable_type", "context"], name: "taggings_taggable_context_idx"
90
- t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy"
91
- t.index ["taggable_id"], name: "index_taggings_on_taggable_id"
92
- t.index ["taggable_type", "taggable_id"], name: "index_taggings_on_taggable_type_and_taggable_id"
93
- t.index ["taggable_type"], name: "index_taggings_on_taggable_type"
94
- t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type"
95
- t.index ["tagger_id"], name: "index_taggings_on_tagger_id"
96
- t.index ["tagger_type", "tagger_id"], name: "index_taggings_on_tagger_type_and_tagger_id"
97
- end
98
-
99
- create_table "tags", force: :cascade do |t|
100
- t.string "name"
101
- t.integer "taggings_count", default: 0
102
- t.datetime "created_at", null: false
103
- t.datetime "updated_at", null: false
104
- t.index ["name"], name: "index_tags_on_name", unique: true
105
- end
106
-
107
- create_table "untaggable_models", force: :cascade do |t|
108
- t.integer "taggable_model_id"
109
- t.string "name"
110
- end
111
-
112
- create_table "users", force: :cascade do |t|
113
- t.string "name"
114
- end
115
-
116
- add_foreign_key "taggings", "tags"
117
- end
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
- # Character.create(name: 'Luke', movie: movies.first)