-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix #1036 scope taggable#tenant method name to #taggable_tenant #1037
Conversation
@@ -7,5 +7,6 @@ group :local_development do | |||
gem 'guard-rspec' | |||
gem 'appraisal' | |||
gem 'rake' | |||
gem 'sqlite3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
tested on a real project with already existing tenants and it works (I pass from a broken app to a working app) |
@@ -214,7 +214,7 @@ 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lunaru small question: why did we specificly use #read_attribute
?
If I have a taggable resource that is:
class MyTaggableModel
has_one :tenant, through: :something
acts_as_taggable_on :tags
acts_as_taggable_tenant :tenant_id
def tenant_id
something.tenant_id
end
end
It just doesn't works, and that's kinda unfortunate.
Can you bump version 8.1 and update the Changelog ? |
@seuros can we also address the #read_attribute issue before please ? really need that on my hand If we have no specific reason for it's usage I can just use #public_send instead |
Sure thing |
c043ab3
to
5dc7994
Compare
@seuros we should be good, minor version bump and changelog updated included |
Awesome work |
@seuros when do you think will you release it (no pressure just wondering in terms of planning) |
Tomorrow max |
If your taggable model already have a #tenant attribute/method/relationship, it would broke your code.
A small modification is required to scope this (non-documented and normally non directly used) method to the taggable lexical scope to fix the issue