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

Add currency to service template. #18754

Merged
merged 1 commit into from
May 20, 2019
Merged
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
1 change: 1 addition & 0 deletions app/models/service_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class ServiceTemplate < ApplicationRecord

belongs_to :service_template_catalog
belongs_to :zone
belongs_to :currency, :class_name => "ChargebackRateDetailCurrency", :inverse_of => false
Copy link
Member

Choose a reason for hiding this comment

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

What does the :inverse_of => false do here?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, @jrafanie found https://github.com/rails/rails/blob/5-0-stable/activerecord/lib/active_record/associations.rb#L704-L718 for me so it sounds like this is just telling AR that we're never going to ask for a currency's service templates which makes sense.


has_many :dialogs, -> { distinct }, :through => :resource_actions
has_many :miq_schedules, :as => :resource, :dependent => :destroy
Expand Down