Skip to content

Commit

Permalink
Merge pull request #906 from gssbzn/use-none
Browse files Browse the repository at this point in the history
Use none instead of false query
  • Loading branch information
seuros authored Jul 29, 2018
2 parents f6c4646 + 10c2003 commit 0082724
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Each change should fall into categories that would affect whether the release is

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.

### [Master / Unreleased](https://github.com/mbleigh/acts-as-taggable-on/compare/v6.0.1...master)
* Misc
* [@gssbzn Remove legacy code for an empty query and replace it with ` ActiveRecord::none`](https://github.com/mbleigh/acts-as-taggable-on/pull/906)

### [6.0.1 / 2018-06-27](https://github.com/mbleigh/acts-as-taggable-on/compare/v6.0.0...v6.0.1)
* Fixes
* [@hengwoon tags_count only need to join on the taggable's table if using STI ](https://github.com/mbleigh/acts-as-taggable-on/pull/904)
Expand Down
3 changes: 1 addition & 2 deletions lib/acts_as_taggable_on/taggable/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ def grouped_column_names_for(object)
def tagged_with(tags, options = {})
tag_list = ActsAsTaggableOn.default_parser.new(tags).parse
options = options.dup
empty_result = where('1 = 0')

return empty_result if tag_list.empty?
return none if tag_list.empty?

::ActsAsTaggableOn::Taggable::TaggedWithQuery.build(self, ActsAsTaggableOn::Tag, ActsAsTaggableOn::Tagging, tag_list, options)
end
Expand Down

0 comments on commit 0082724

Please sign in to comment.