Rename LaborExpenses to LaborBudget, better description of the class.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module ContractsHelper
|
||||
def setup_nested_deliverable_records(deliverable)
|
||||
returning(deliverable) do |d|
|
||||
d.labor_expenses.build if d.labor_expenses.empty?
|
||||
d.labor_budgets.build if d.labor_budgets.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,9 +4,9 @@ class Deliverable < ActiveRecord::Base
|
||||
# Associations
|
||||
belongs_to :contract
|
||||
belongs_to :manager, :class_name => 'User', :foreign_key => 'manager_id'
|
||||
has_many :labor_expenses
|
||||
has_many :labor_budgets
|
||||
|
||||
accepts_nested_attributes_for :labor_expenses
|
||||
accepts_nested_attributes_for :labor_budgets
|
||||
|
||||
# Validations
|
||||
validates_presence_of :title
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class LaborExpense < ActiveRecord::Base
|
||||
class LaborBudget < ActiveRecord::Base
|
||||
unloadable
|
||||
|
||||
# Associations
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
<%= form.input :total, :input_html => {:size => 10}, :wrapper_html => {:class => 'deliverable_total_input'} %>
|
||||
|
||||
<% form.inputs :name => l(:text_deliverable_finances), :id => 'deliverable-finances' do %>
|
||||
<% form.semantic_fields_for :labor_expenses do |labor_expense| %>
|
||||
<% labor_expense.inputs :name => l(:field_labor) do %>
|
||||
<%= labor_expense.input :hours, :label => l(:text_short_hours), :input_html => {:size => 10} %>
|
||||
<%= labor_expense.input :budget, :label => l(:text_dollar_sign), :input_html => {:size => 10} %>
|
||||
<% form.semantic_fields_for :labor_budgets do |labor_budget| %>
|
||||
<% labor_budget.inputs :name => l(:field_labor) do %>
|
||||
<%= labor_budget.input :hours, :label => l(:text_short_hours), :input_html => {:size => 10} %>
|
||||
<%= labor_budget.input :budget, :label => l(:text_dollar_sign), :input_html => {:size => 10} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user