acts-as-taggable-on 3.4.3 → 3.4.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b39b0f1b57946931d609aa449f30102beb5a137a
4
- data.tar.gz: 75404df8d0fc7bd5cda6f58cb72cebbda4d18b9c
3
+ metadata.gz: b3150df9e4bb27c039d1bf451b14848f05867cd1
4
+ data.tar.gz: 9451664d7c39a2bae61c254f8852b7c65101658c
5
5
  SHA512:
6
- metadata.gz: 2379d076af6a782a0a6add5be79b8341991e607bcfbd96c45f5fe12bfc2fbf6cca5104d82494636b01ebb8776f3932a8231c199a7b1fc830b8e48bd7321af8aa
7
- data.tar.gz: 82c387ff3f37edd3567e7c40f612251939c18702eabd606a711c3aad439d80e2ac4e42464317f5bd24e6bc05f53f3f414c9920064f3eb7982bece02cde56804d
6
+ metadata.gz: 33408ad30bec8845467d740606689fff474a35ff5440ed15a5320ff2b3a56f2076d557f111409c788c2431f6dfb732a2713b0847880895ed6d5abf7aa86d4bc9
7
+ data.tar.gz: 402c76125e5b27adbf531c9aeccf971af256b2b4545d92daa31b98a25beb3381820055075b6ae73e03efb7dd1c22495ae737655623b536c4703e7929002b624b
@@ -4,7 +4,7 @@ Each change should fall into categories that would affect whether the release is
4
4
 
5
5
  As such, a _Feature_ would map to either major or minor. A _bug fix_ to a patch. And _misc_ is either minor or patch, the difference being kind of fuzzy for the purposes of history. Adding tests would be patch level.
6
6
 
7
- ### Master [changes](https://github.com/mbleigh/acts-as-taggable-on/compare/v3.4.3...master)
7
+ ### Master [changes](https://github.com/mbleigh/acts-as-taggable-on/compare/v3.4.4...master)
8
8
 
9
9
  * Breaking Changes
10
10
  * Features
@@ -12,6 +12,11 @@ As such, a _Feature_ would map to either major or minor. A _bug fix_ to a patch.
12
12
  * Performance
13
13
  * Misc
14
14
 
15
+ ### [3.4.4 / 2015-02-11](https://github.com/mbleigh/acts-as-taggable-on/compare/v3.4.3...v3.4.4)
16
+
17
+ * Fixes
18
+ * [@d4rky-pl Add context constraint to find_related_* methods](https://github.com/mbleigh/acts-as-taggable-on/pull/629)
19
+
15
20
 
16
21
  ### [3.4.3 / 2014-09-26](https://github.com/mbleigh/acts-as-taggable-on/compare/v3.4.2...v3.4.3)
17
22
 
data/README.md CHANGED
@@ -73,7 +73,7 @@ end
73
73
 
74
74
  class UsersController < ApplicationController
75
75
  def user_params
76
- params.require(:user).permit(:name, :tag_list) ## Rails 4 strong params usage
76
+ params.require(:user).permit(:name, :tag_list => []) ## Rails 4 strong params usage
77
77
  end
78
78
  end
79
79
 
@@ -262,7 +262,7 @@ If you want to change how tags are parsed, you can define a your own implementat
262
262
  ```ruby
263
263
  class MyParser < ActsAsTaggableOn::GenericParser
264
264
  def parse
265
- TagList.new.tap do |tag_list|
265
+ ActsAsTaggableOn::TagList.new.tap do |tag_list|
266
266
  tag_list.add @tag_list.split('|')
267
267
  end
268
268
  end
@@ -43,7 +43,7 @@ module ActsAsTaggableOn::Taggable
43
43
  def related_tags_for(context, klass, options = {})
44
44
  tags_to_ignore = Array.wrap(options[:ignore]).map(&:to_s) || []
45
45
  tags_to_find = tags_on(context).map { |t| t.name }.reject { |t| tags_to_ignore.include? t }
46
- related_where(klass, ["#{exclude_self(klass, id)} #{klass.table_name}.#{klass.primary_key} = #{ActsAsTaggableOn::Tagging.table_name}.taggable_id AND #{ActsAsTaggableOn::Tagging.table_name}.taggable_type = '#{klass.base_class}' AND #{ActsAsTaggableOn::Tagging.table_name}.tag_id = #{ActsAsTaggableOn::Tag.table_name}.#{ActsAsTaggableOn::Tag.primary_key} AND #{ActsAsTaggableOn::Tag.table_name}.name IN (?)", tags_to_find])
46
+ related_where(klass, ["#{exclude_self(klass, id)} #{klass.table_name}.#{klass.primary_key} = #{ActsAsTaggableOn::Tagging.table_name}.taggable_id AND #{ActsAsTaggableOn::Tagging.table_name}.taggable_type = '#{klass.base_class}' AND #{ActsAsTaggableOn::Tagging.table_name}.tag_id = #{ActsAsTaggableOn::Tag.table_name}.#{ActsAsTaggableOn::Tag.primary_key} AND #{ActsAsTaggableOn::Tag.table_name}.name IN (?) AND #{ActsAsTaggableOn::Tagging.table_name}.context = ?", tags_to_find, context])
47
47
  end
48
48
 
49
49
  private
@@ -1,4 +1,4 @@
1
1
  module ActsAsTaggableOn
2
- VERSION = '3.4.3'
2
+ VERSION = '3.4.4'
3
3
  end
4
4
 
@@ -42,6 +42,15 @@ describe 'Acts As Taggable On' do
42
42
  expect(taggable1.find_related_tags_for(OtherTaggableModel)).to_not include(taggable2)
43
43
  end
44
44
 
45
+ it 'should find other related objects based on tags only from particular context' do
46
+ taggable1 = TaggableModel.create!(name: 'Taggable 1',tag_list: 'one, two')
47
+ taggable2 = TaggableModel.create!(name: 'Taggable 2',tag_list: 'three, four', skill_list: 'one, two')
48
+ taggable3 = TaggableModel.create!(name: 'Taggable 3',tag_list: 'one, four')
49
+
50
+ expect(taggable1.find_related_tags).to include(taggable3)
51
+ expect(taggable1.find_related_tags).to_not include(taggable2)
52
+ end
53
+
45
54
 
46
55
  shared_examples "a collection" do
47
56
  it do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts-as-taggable-on
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.3
4
+ version: 3.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-06 00:00:00.000000000 Z
12
+ date: 2015-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  version: '0'
260
260
  requirements: []
261
261
  rubyforge_project:
262
- rubygems_version: 2.2.2
262
+ rubygems_version: 2.4.5
263
263
  signing_key:
264
264
  specification_version: 4
265
265
  summary: Advanced tagging for Rails.