Renamed Deliverable.due_date to due so it doesn't conflict with issue.due_date
This commit is contained in:
1 parent
490bf73efe
commit
23c6ee6e92
8 files changed
+43
-17
No files matched your search
@@ -15,7 +15,7 @@ class Budget
|
|||||||
del = self.deliverables
|
del = self.deliverables
|
||||||
return nil unless del.size > 0
|
return nil unless del.size > 0
|
||||||
|
|
||||||
dates = del.collect(&:due_date).delete_if { |d| d.blank?}
|
dates = del.collect(&:due).delete_if { |d| d.blank?}
|
||||||
|
|
||||||
return dates.sort[0]
|
return dates.sort[0]
|
||||||
end
|
end
|
||||||
@@ -24,7 +24,7 @@ class Budget
|
|||||||
del = self.deliverables
|
del = self.deliverables
|
||||||
return nil unless del.size > 0
|
return nil unless del.size > 0
|
||||||
|
|
||||||
dates = del.collect(&:due_date).delete_if { |d| d.blank?}
|
dates = del.collect(&:due).delete_if { |d| d.blank?}
|
||||||
|
|
||||||
return dates.sort[-1]
|
return dates.sort[-1]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<%= content_tag(:td, h(deliverable.subject), :class => 'subject') %>
|
<%= content_tag(:td, h(deliverable.subject), :class => 'subject') %>
|
||||||
<%= content_tag(:td, number_to_currency(deliverable.budget, :precision => 0), :class => 'budget') %>
|
<%= content_tag(:td, number_to_currency(deliverable.budget, :precision => 0), :class => 'budget') %>
|
||||||
<%= content_tag(:td, number_to_currency(deliverable.spent, :precision => 0), :class => 'spent') %>
|
<%= content_tag(:td, number_to_currency(deliverable.spent, :precision => 0), :class => 'spent') %>
|
||||||
<%= content_tag(:td, format_date(deliverable.due_date), :class => 'due_date') %>
|
<%= content_tag(:td, format_date(deliverable.due), :class => 'due_date') %>
|
||||||
<%= content_tag(:td, progress_bar(deliverable.progress, :width => '100%', :class => 'dont_ratio')) %>
|
<%= content_tag(:td, progress_bar(deliverable.progress, :width => '100%', :class => 'dont_ratio')) %>
|
||||||
<%= content_tag(:td, link_to_function("Details", "$('deliverable-details-#{deliverable.id}').toggle();"), :class => 'actions') %>
|
<%= content_tag(:td, link_to_function("Details", "$('deliverable-details-#{deliverable.id}').toggle();"), :class => 'actions') %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
:rows => (@deliverable.description.blank? ? 10 : [[10, @deliverable.description.length / 50].max, 100].min),
|
:rows => (@deliverable.description.blank? ? 10 : [[10, @deliverable.description.length / 50].max, 100].min),
|
||||||
:accesskey => accesskey(:edit),
|
:accesskey => accesskey(:edit),
|
||||||
:class => 'wiki-edit' %></p>
|
:class => 'wiki-edit' %></p>
|
||||||
<p><%= f.text_field :due_date, :size => 10 %><%= calendar_for('deliverable_due_date') %></p>
|
<p><%= f.text_field :due, :size => 10 %><%= calendar_for('deliverable_due') %></p>
|
||||||
|
|
||||||
<p><%= f.check_box(:project_manager_signoff) %></p>
|
<p><%= f.check_box(:project_manager_signoff) %></p>
|
||||||
<p><%= f.check_box(:client_signoff) %></p>
|
<p><%= f.check_box(:client_signoff) %></p>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<%= sort_header_tag("#{Deliverable.table_name}.subject", :caption => 'Subject') %>
|
<%= sort_header_tag("#{Deliverable.table_name}.subject", :caption => 'Subject') %>
|
||||||
<%= sort_header_tag("#{Deliverable.table_name}.budget", :caption => 'Budget') %>
|
<%= sort_header_tag("#{Deliverable.table_name}.budget", :caption => 'Budget') %>
|
||||||
<%= sort_header_tag("spent", :caption => 'Spent') %>
|
<%= 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') %>
|
<%= sort_header_tag("progress", :caption => 'Progress') %>
|
||||||
<%= content_tag('th', "Actions") %>
|
<%= content_tag('th', "Actions") %>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -9,5 +9,6 @@ field_project_manager_signoff: Project Manager Signoff
|
|||||||
field_client_signoff: Client Signoff
|
field_client_signoff: Client Signoff
|
||||||
field_deliverable: Deliverable
|
field_deliverable: Deliverable
|
||||||
field_deliverable_subject: Deliverable
|
field_deliverable_subject: Deliverable
|
||||||
|
field_due: Due Date
|
||||||
label_member_rate: Rate ($)
|
label_member_rate: Rate ($)
|
||||||
message_updated_issues: Updated %d issues
|
message_updated_issues: Updated %d issues
|
||||||
+12
-12
@@ -52,8 +52,8 @@ describe Budget, '.next_due_date' do
|
|||||||
@tomorrow = Date.today + 1.days
|
@tomorrow = Date.today + 1.days
|
||||||
@next_week = Date.today + 7.days
|
@next_week = Date.today + 7.days
|
||||||
|
|
||||||
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week)
|
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week)
|
||||||
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => @tomorrow)
|
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due => @tomorrow)
|
||||||
|
|
||||||
@project = mock_model(Project)
|
@project = mock_model(Project)
|
||||||
Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2])
|
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
|
@tomorrow = Date.today + 1.days
|
||||||
@next_week = Date.today + 7.days
|
@next_week = Date.today + 7.days
|
||||||
|
|
||||||
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week)
|
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week)
|
||||||
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => nil)
|
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due => nil)
|
||||||
|
|
||||||
@project = mock_model(Project)
|
@project = mock_model(Project)
|
||||||
Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2])
|
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
|
@tomorrow = Date.today + 1.days
|
||||||
@next_week = Date.today + 7.days
|
@next_week = Date.today + 7.days
|
||||||
|
|
||||||
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week)
|
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week)
|
||||||
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => '')
|
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due => '')
|
||||||
|
|
||||||
@project = mock_model(Project)
|
@project = mock_model(Project)
|
||||||
Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2])
|
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
|
@tomorrow = Date.today + 1.days
|
||||||
@next_week = Date.today + 7.days
|
@next_week = Date.today + 7.days
|
||||||
|
|
||||||
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week)
|
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week)
|
||||||
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => @tomorrow)
|
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due => @tomorrow)
|
||||||
|
|
||||||
@project = mock_model(Project)
|
@project = mock_model(Project)
|
||||||
Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2])
|
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
|
@tomorrow = Date.today + 1.days
|
||||||
@next_week = Date.today + 7.days
|
@next_week = Date.today + 7.days
|
||||||
|
|
||||||
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week)
|
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week)
|
||||||
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => nil)
|
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due => nil)
|
||||||
|
|
||||||
@project = mock_model(Project)
|
@project = mock_model(Project)
|
||||||
Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2])
|
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
|
@tomorrow = Date.today + 1.days
|
||||||
@next_week = Date.today + 7.days
|
@next_week = Date.today + 7.days
|
||||||
|
|
||||||
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due_date => @next_week)
|
@deliverable1 = mock_model(Deliverable, :project_id => @project, :due => @next_week)
|
||||||
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due_date => '')
|
@deliverable2 = mock_model(Deliverable, :project_id => @project, :due => '')
|
||||||
|
|
||||||
@project = mock_model(Project)
|
@project = mock_model(Project)
|
||||||
Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2])
|
Deliverable.stub!(:find_all_by_project_id).and_return([@deliverable1, @deliverable2])
|
||||||
|
|||||||
Whitespace-only changes.
Reference in new issue
Block a user