gutentag 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ec8394c126e64edbe9df0aad9007053b1a38ebd72e179054e41ed264a87f3ab
4
- data.tar.gz: bafc3147166fd46d223aaefeb4b99a82e7566cc57c5283cbcde8b11995bd043e
3
+ metadata.gz: 2b31660115c80a0a86d70ab6b0e77896e33b8dd81b51b4d841461a692f69b808
4
+ data.tar.gz: 4b3bcc20917350af7a07ec5186df2c23c6b6adee1f02700a9fcfc9c46ef9978c
5
5
  SHA512:
6
- metadata.gz: 8c0145e229b2ecfa4cfff1e5dbf9d8524611c72be4f55a118682dfef6ab6eb56cfec33dfe7c1e9165337004fdcc5a8d6a2724784a65dc582bf76fb397b048481
7
- data.tar.gz: 3fbaa2a22bbeb0b0f2561c413ae402fd0ba3586a1b9f3d81ae1b31c58f466f15b6b944aa6b2678c4492b55563f07ef05826df6a47fc4bb997dd588501748c9c9
6
+ metadata.gz: 304828039b887d1f505e4ce68fbe6d0b8d3c5b70a5fa8f3cff4e26154c2a5fa278a3c3cd3a9cc3298f5609cb1b545da1ff001ddc8aa4f4af21566959562e1135
7
+ data.tar.gz: 68a753b3495279474106363deec171d8ba96d97621e1d131360cbb46f4d0e4d341b483b627d90f841c0b9bf44d66c84f75f5a42b7d5ea9d1e6d2a80dfa364c13
@@ -1,11 +1,11 @@
1
1
  language: ruby
2
2
  script: bundle exec appraisal rake
3
3
  rvm:
4
- - 2.2.9
5
- - 2.3.6
6
- - 2.4.3
7
- - 2.5.0
8
- - jruby-9.1.13.0
4
+ - 2.2.10
5
+ - 2.3.7
6
+ - 2.4.4
7
+ - 2.5.1
8
+ - jruby-9.1.16.0
9
9
  before_install:
10
10
  - gem install bundler
11
11
  before_script:
data/Appraisals CHANGED
@@ -31,7 +31,7 @@ appraise "rails_5_1" do
31
31
  end if RUBY_VERSION.to_f >= 2.2 && RUBY_PLATFORM != "java"
32
32
 
33
33
  appraise "rails_5_2" do
34
- gem "rails", "~> 5.2.0.rc2"
34
+ gem "rails", "~> 5.2.0"
35
35
  gem "pg", "~> 1.0", :platform => :ruby
36
- gem "mysql2", "~> 0.4.0", :platform => :ruby
36
+ gem "mysql2", "~> 0.5.0", :platform => :ruby
37
37
  end if RUBY_VERSION.to_f >= 2.2 && RUBY_PLATFORM != "java"
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project (at least, from v0.5.0 onwards) will be documented in this file.
4
4
 
5
+ ## 2.3.2 - 2018-04-27
6
+
7
+ ### Fixed
8
+
9
+ * The `tagged_with` method now finds tagged objects belonging to STI models (as discussed in [#53](https://github.com/pat/gutentag/issues/53)).
10
+
5
11
  ## 2.3.1 - 2018-04-05
6
12
 
7
13
  ### Fixed
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "gutentag"
6
- s.version = "2.3.1"
6
+ s.version = "2.3.2"
7
7
  s.authors = ["Pat Allan"]
8
8
  s.email = ["pat@freelancing-gods.com"]
9
9
  s.homepage = "https://github.com/pat/gutentag"
@@ -5,7 +5,7 @@ class Gutentag::TaggedWith::IDQuery < Gutentag::TaggedWith::Query
5
5
 
6
6
  def taggable_ids_query
7
7
  Gutentag::Tagging.select(:taggable_id).
8
- where(:taggable_type => model.name).
8
+ where(:taggable_type => model.base_class.name).
9
9
  where(:tag_id => values)
10
10
  end
11
11
  end
@@ -11,7 +11,7 @@ class Gutentag::TaggedWith::NameQuery < Gutentag::TaggedWith::Query
11
11
 
12
12
  def taggable_ids_query
13
13
  Gutentag::Tagging.joins(:tag).select(:taggable_id).
14
- where(:taggable_type => model.name).
14
+ where(:taggable_type => model.base_class.name).
15
15
  where(Gutentag::Tag.table_name => {:name => values})
16
16
  end
17
17
  end
@@ -159,5 +159,14 @@ describe Gutentag::ActiveRecord do
159
159
  it { is_expected.to include melbourne_article, melbourne_oregon_article }
160
160
  it { is_expected.not_to include oregon_article }
161
161
  end
162
+
163
+ it "should work on STI subclasses" do
164
+ thinkpiece = Thinkpiece.create! :tag_names => ["pancakes"]
165
+
166
+ expect(thinkpiece.tags.reload.collect(&:name)).to eq(["pancakes"])
167
+ expect(
168
+ Thinkpiece.tagged_with(:names => "pancakes", :match => :any).to_a
169
+ ).to eq([thinkpiece])
170
+ end
162
171
  end
163
172
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Thinkpiece < Article
4
+ #
5
+ end
@@ -3,6 +3,7 @@
3
3
  ActiveRecord::Schema.define do
4
4
  create_table :articles, :force => true do |t|
5
5
  t.string :title
6
+ t.string :type
6
7
  t.timestamps :null => false
7
8
  end
8
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gutentag
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-04 00:00:00.000000000 Z
11
+ date: 2018-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -168,6 +168,7 @@ files:
168
168
  - spec/gutentag/active_record_spec.rb
169
169
  - spec/gutentag_spec.rb
170
170
  - spec/internal/app/models/article.rb
171
+ - spec/internal/app/models/thinkpiece.rb
171
172
  - spec/internal/config/database.yml
172
173
  - spec/internal/db/schema.rb
173
174
  - spec/internal/log/.gitignore