-
Notifications
You must be signed in to change notification settings - Fork 125
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
Create report types #304
Create report types #304
Conversation
Checked commit lpichler@debbcd3 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 db/migrate/20181107164348_create_report_type.rb
|
@@ -0,0 +1,11 @@ | |||
class CreateReportType < ActiveRecord::Migration[5.0] | |||
def change | |||
create_table :report_types do |t| |
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.
I'm not sure report_types
is the best name here. Maybe reportable_fields
?
This table will store one row per entry in https://github.com/lpichler/manageiq/blob/ce3bb5dc39eb168a70a9f6be73ed496cb5dc6c22/app/models/chargeback_vm.rb#L2 right?
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.
first usage, is for ChargeableField. One row of ChargeableField
could have 2 chargeback report types. For example, v_derived_cpu_total_cores_used
belongs to ChargebackContainerImage, ChargebackContainerProject
chargeback report types.
So firstly I was modeling:
ChargeableField
has_many ChargebackReportType
and then
I realized that probably it could be useful to don't limit ourselves and go with general way:
ChargeableField
has_many ReportType
due this facts, I think that name reportable_fields
doesn't explain the idea of intended report types. But as my native language is not english - I could be wrong :)
what do you think now?
thanks!
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.
I'm still not sure what the resource is pointing to in that case? If its something inheriting from Chargeback
then there won't be a database row, but if it's ChargeableField
then why make it polymorphic?
Also, I'm curious about why something like Is that something we considered over editing the schema? |
closing for, we have other solution |
alternative of #209:
Taken from @hstastna's description:
What:
We need to store the type of the Rate which is related to type of Report: Chargeback for VMs/Images/Projects.
Why:
We need it for adding new drop down to editing screen for Rate to be able to choose the type of the rate and then to display only appropriate columns of the rate, based on the chosen type of the rate (VMs, Images, Projects).
I added selected option 2 #209 (comment) option after our discussion.
The only difference is that I created more general table
ReportType
- even If I don't have other use case at this moment.ReportType is new one.
cc @gtanzillo @carbonin @hstastna
Links
https://bugzilla.redhat.com/show_bug.cgi?id=1581817