Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1036 scope taggable#tenant method name to #taggable_tenant #1037

Merged
merged 1 commit into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added that because it's a requirement when working on the gem

without it:

>$ bundle
...
>$ bundle exec rake rspec

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange , i never needed to add it. You can use appraisal to run a specific version.

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