-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature/creating calculators constructor #534
base: develop
Are you sure you want to change the base?
Feature/creating calculators constructor #534
Conversation
Your Render PR Server URL is https://zero-waste-staging-pr-534.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cj3ut3dgkuvmu7li1crg. |
@@ -1,15 +1,20 @@ | |||
# frozen_string_literal: true | |||
|
|||
class Account::CalculatorsController < Account::BaseController | |||
before_action :calculator, only: [:edit, :update, :destroy] | |||
before_action :calculator, only: [:show, :edit, :update, :destroy] |
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.
що це і звідки?
end | ||
end | ||
|
||
def products_collection | ||
Product.all |
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.
а де сортування?
end | ||
|
||
def product_resource | ||
Product.find(@calculator.product_id) |
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.
чому не з колекшина?
@@ -0,0 +1,5 @@ | |||
class AddProductIdToCalculators < ActiveRecord::Migration[6.1] | |||
def change | |||
add_column :calculators, :product_id, :integer |
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.
reference
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #534 +/- ##
===========================================
- Coverage 91.16% 90.90% -0.27%
===========================================
Files 70 73 +3
Lines 973 1011 +38
===========================================
+ Hits 887 919 +32
- Misses 86 92 +6 ☔ View full report in Codecov by Sentry. |
9fa42f9
to
3bff2f0
Compare
<%= form.input_field :period, | ||
collection: use_period, | ||
prompt: '__', | ||
class: 'form_fild price_select rounded w-100', | ||
data: { calculate_target: 'period' } %> | ||
|
||
<%= t("calculators.form.price") %> | ||
<%= form.input_field :product_category, | ||
collection: product_prices(@calculator), | ||
prompt: '__', | ||
label: t('.form_price'), | ||
class: 'form_fild price_select rounded w-100', | ||
data: { calculate_target: 'priceCategory' } %> |
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.
а чому не просто form.input?
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.
Done
03a3caf
to
7d2dc81
Compare
Code reviewers
Summary of issue
Create calculator's constructor
Summary of change
_.ZeroWaste.webm
CHECK LIST