From 23c6ee6e929ad6358f53a7aee7eeb725105d4d2e Mon Sep 17 00:00:00 2001
From: Eric Davis
<%= f.text_field :due_date, :size => 10 %><%= calendar_for('deliverable_due_date') %>
+<%= f.text_field :due, :size => 10 %><%= calendar_for('deliverable_due') %>
<%= f.check_box(:project_manager_signoff) %>
<%= f.check_box(:client_signoff) %>
diff --git a/app/views/deliverables/_list.html.erb b/app/views/deliverables/_list.html.erb index 5cb5f61..3dc2ccd 100644 --- a/app/views/deliverables/_list.html.erb +++ b/app/views/deliverables/_list.html.erb @@ -5,7 +5,7 @@ <%= sort_header_tag("#{Deliverable.table_name}.subject", :caption => 'Subject') %> <%= sort_header_tag("#{Deliverable.table_name}.budget", :caption => 'Budget') %> <%= sort_header_tag("spent", :caption => 'Spent') %> - <%= sort_header_tag("#{Deliverable.table_name}.due_date", :caption => 'Due') %> + <%= sort_header_tag("#{Deliverable.table_name}.due", :caption => 'Due') %> <%= sort_header_tag("progress", :caption => 'Progress') %> <%= content_tag('th', "Actions") %> diff --git a/db/migrate/008_rename_due_date_to_due.rb b/db/migrate/008_rename_due_date_to_due.rb new file mode 100644 index 0000000..debf009 --- /dev/null +++ b/db/migrate/008_rename_due_date_to_due.rb @@ -0,0 +1,25 @@ +class RenameDueDateToDue < ActiveRecord::Migration + def self.up + add_column :deliverables, :due, :date + + Deliverable.reset_column_information + + Deliverable.find(:all).each do |deliverable| + deliverable.update_attribute(:due, deliverable.due_date) + end + + remove_column :deliverables, :due_date + end + + def self.down + add_column :deliverables, :due_date, :date + + Deliverable.reset_column_information + + Deliverable.find(:all).each do |deliverable| + deliverable.update_attribute(:due_date, deliverable.due) + end + + remove_column :deliverables, :due + end +end diff --git a/lang/en.yml b/lang/en.yml index e7fb58c..42da559 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -9,5 +9,6 @@ field_project_manager_signoff: Project Manager Signoff field_client_signoff: Client Signoff field_deliverable: Deliverable field_deliverable_subject: Deliverable +field_due: Due Date label_member_rate: Rate ($) message_updated_issues: Updated %d issues diff --git a/spec/models/budget_spec.rb b/spec/models/budget_spec.rb index 948b372..e584eae 100644 --- a/spec/models/budget_spec.rb +++ b/spec/models/budget_spec.rb @@ -52,8 +52,8 @@ describe Budget, '.next_due_date' do @tomorrow = Date.today + 1.days @next_week = Date.today + 7.days - @deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week) - @deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => @tomorrow) + @deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week) + @deliverable2 = mock_model(Deliverable, :project_id => @project, :due => @tomorrow) @project = mock_model(Project) Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2]) @@ -77,8 +77,8 @@ describe Budget, '.next_due_date' do @tomorrow = Date.today + 1.days @next_week = Date.today + 7.days - @deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week) - @deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => nil) + @deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week) + @deliverable2 = mock_model(Deliverable, :project_id => @project, :due => nil) @project = mock_model(Project) Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2]) @@ -93,8 +93,8 @@ describe Budget, '.next_due_date' do @tomorrow = Date.today + 1.days @next_week = Date.today + 7.days - @deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week) - @deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => '') + @deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week) + @deliverable2 = mock_model(Deliverable, :project_id => @project, :due => '') @project = mock_model(Project) Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2]) @@ -111,8 +111,8 @@ describe Budget, '.final_due_date' do @tomorrow = Date.today + 1.days @next_week = Date.today + 7.days - @deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week) - @deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => @tomorrow) + @deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week) + @deliverable2 = mock_model(Deliverable, :project_id => @project, :due => @tomorrow) @project = mock_model(Project) Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2]) @@ -136,8 +136,8 @@ describe Budget, '.final_due_date' do @tomorrow = Date.today + 1.days @next_week = Date.today + 7.days - @deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week) - @deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => nil) + @deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week) + @deliverable2 = mock_model(Deliverable, :project_id => @project, :due => nil) @project = mock_model(Project) Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2]) @@ -152,8 +152,8 @@ describe Budget, '.final_due_date' do @tomorrow = Date.today + 1.days @next_week = Date.today + 7.days - @deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week) - @deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => '') + @deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week) + @deliverable2 = mock_model(Deliverable, :project_id => @project, :due => '') @project = mock_model(Project) Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2]) diff --git a/spec/rcov.opts b/spec/rcov.opts new file mode 100644 index 0000000..e69de29