-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add concern to build instance variables * Lint
- Loading branch information
Showing
4 changed files
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module DashboardConcern | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
end | ||
|
||
def build_instance_variables | ||
@incomes = Income.order_by_type | ||
@fixed_expenses = FixedExpense.get_ordered | ||
@totals = FixedExpense.total_costs | ||
@federal_tax_brackets = FederalTaxBracket.order_by_range | ||
@salary_taxed = Income.tax_on_income(income_type: "Salary") | ||
@hourly_taxed = Income.tax_on_income(income_type: "Hourly") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
class DashboardController < ApplicationController | ||
include DashboardConcern | ||
def index | ||
@incomes = Income.order_by_type | ||
@fixed_expenses = FixedExpense.get_ordered | ||
@totals = FixedExpense.total_costs | ||
@federal_tax_brackets = FederalTaxBracket.order_by_range | ||
@salary_taxed = Income.tax_on_income(income_type: "Salary") | ||
@hourly_taxed = Income.tax_on_income(income_type: "Hourly") | ||
build_instance_variables | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters