Extract phases edition to a component
This commit is contained in:
13
app/components/admin/budget_phases/phases_component.rb
Normal file
13
app/components/admin/budget_phases/phases_component.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class Admin::BudgetPhases::PhasesComponent < ApplicationComponent
|
||||
attr_reader :budget
|
||||
|
||||
def initialize(budget)
|
||||
@budget = budget
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def phases
|
||||
budget.phases.order(:id)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user