-
Notifications
You must be signed in to change notification settings - Fork 983
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
Fixes #16389 - enable taxable object creation in specific context #3801
Conversation
org = FactoryGirl.create :organization | ||
FactoryGirl.create(:domain, :organizations => [ org ]) | ||
original_org, Organization.current = Organization.current, org | ||
$debug = true |
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.
Do not introduce global variables.
[test] |
APJ, if there was emoji for :respect: I would use one :) |
tax_ids = taxable_ids | ||
# we need to generate part of SQL query as a string, otherwise the default scope would set id on each | ||
# new instance and the same taxable_id on taxable_taxonomy objects | ||
scope = scope.where("#{self.table_name}.id IN (#{tax_ids.join(',')})", ) if tax_ids |
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.
Space inside parentheses detected.
@iNecas one more change was needed, we have to be explicit about the table name and we can't escape the values inside |
No description provided.