Skip to content

Commit

Permalink
fix #1036 taggable#tenant nameing conflict and minor version bump (#1037
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ngouy authored Jun 17, 2021
1 parent 4a7948e commit e2d211b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Each change should fall into categories that would affect whether the release is

As such, _Breaking Changes_ are major. _Features_ would map to either major or minor. _Fixes_, _Performance_, and _Misc_ are either minor or patch, the difference being kind of fuzzy for the purposes of history. Adding _Documentation_ (including tests) would be patch level.

### [v8.1.0) / 2021-06-17](https://github.com/mbleigh/acts-as-taggable-on/compare/v8.0.0...v8.1.0)
* Fixes
* [@ngouy Fix rollbackable tenant migrations](https://github.com/mbleigh/acts-as-taggable-on/pull/1038)
* [@ngouy Fix gem conflict with already existing tenant model](https://github.com/mbleigh/acts-as-taggable-on/pull/1037)

### [v8.0.0) / 2021-06-07](https://github.com/mbleigh/acts-as-taggable-on/compare/v7.0.0...v8.0.0)
* Features
* [@lunaru Support tenants for taggings](https://github.com/mbleigh/acts-as-taggable-on/pull/1000)
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ group :local_development do
gem 'guard-rspec'
gem 'appraisal'
gem 'rake'
gem 'sqlite3'
gem 'byebug', platforms: [:mri]
end
8 changes: 4 additions & 4 deletions lib/acts_as_taggable_on/taggable/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ def tagging_contexts
self.class.tag_types.map(&:to_s) + custom_contexts
end

def tenant
def taggable_tenant
if self.class.tenant_column
read_attribute(self.class.tenant_column)
public_send(self.class.tenant_column)
end
end

Expand Down Expand Up @@ -278,8 +278,8 @@ def save_tags

# Create new taggings:
new_tags.each do |tag|
if tenant
taggings.create!(tag_id: tag.id, context: context.to_s, taggable: self, tenant: tenant)
if taggable_tenant
taggings.create!(tag_id: tag.id, context: context.to_s, taggable: self, tenant: taggable_tenant)
else
taggings.create!(tag_id: tag.id, context: context.to_s, taggable: self)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_taggable_on/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ActsAsTaggableOn
VERSION = '8.0.0'
VERSION = '8.1.0'
end

0 comments on commit e2d211b

Please sign in to comment.