backlog 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,20 @@
1
- == 0.11.0 2007-10-26
1
+ == 0.12.0 2007-11-06
2
+
3
+ ===Features
4
+
5
+ * Changed to use AJAX for small updates of tasks in the sprint view.
6
+ This to speed up the user experience.
7
+ Known bug: The position numbers are not updated yet.
8
+ * Added Transactional Migrations plugin to avoid partial migrations.
9
+
10
+ === Fixes
11
+
12
+ * Changed to return from detour to work account edit view
13
+ * Moved editing of "Track Times" option from Backlog to Work Account
14
+ * Added link from backlog to corresponding work account.
15
+ * Made Edit Work Account view fit with layout.
16
+
17
+ == 0.11.0 2007-11-03
2
18
 
3
19
  ===Features
4
20
 
@@ -2,27 +2,54 @@ class EstimatesController < ApplicationController
2
2
  verify :method => :post, :redirect_to => ''
3
3
 
4
4
  def create
5
+ @success, @message = do_create
6
+
7
+ unless @success
8
+ @task.errors.add :estimate, @message
9
+ render :file => "public/500.html", :layout => true, :status => 500
10
+ return
11
+ end
12
+
13
+ flash[:notice] = @message
14
+ redirect_to :controller => 'periods', :action => :show, :id => @task.root_task.period, :task_id => @task.id
15
+ end
16
+
17
+ def create_ajax
18
+ if @task = Task.find_by_id(params[:id])
19
+ @last_active = @task.lower_item.nil?
20
+ @last_active_in_backlog = @last_active || @task.lower_item.backlog != @task.backlog
21
+ finished_count = Task.count(:conditions => ['period_id = ? AND finished_at IS NOT NULL', @task.period_id])
22
+ @first_finished = finished_count == 0
23
+ end
24
+ @success, @message = do_create
25
+ # Only necessary since we have an unecessary complex update of estimates
26
+ @task.reload
27
+ if @task.finished?
28
+ render :template => '/tasks/finish_ajax', :layout => false
29
+ end
30
+ end
31
+
32
+ private
33
+
34
+ def do_create
5
35
  if params[:id]
6
36
  @task = Task.find(params[:id])
7
37
  if params[:estimate] && params[:estimate][:todo]
8
38
  begin
9
39
  Float(params[:estimate][:todo])
10
40
  @task.estimate(params[:estimate][:todo])
11
- flash[:notice] = 'Estimate updated'
41
+ @period = @task.period
42
+ return true, 'Estimate updated'
12
43
  rescue ArgumentError => e
13
- @task.errors.add :estimate, "was not numeric"
14
- render :file => "public/500.html", :layout => true, :status => 500
15
- return
44
+ return false, "Estimate was not numeric"
16
45
  end
17
- redirect_to :controller => 'periods', :action => :show, :id => @task.root_task.period, :task_id => @task.id
18
46
  else
19
- @task.errors.add :task, 'Estimate is missing.'
20
- render :file => "public/500.html", :layout => true, :status => 500
47
+ return false, "Estimate is missing."
21
48
  end
22
49
  else
23
50
  @estimate = Estimate.new
24
- @estimate.errors.add :task, 'Id is missing.'
25
- render :file => "public/500.html", :layout => true, :status => 500
51
+ return false, 'Task id is missing.'
26
52
  end
27
53
  end
54
+
28
55
  end
@@ -224,6 +224,16 @@ class TasksController < ApplicationController
224
224
  back_or_redirect_to :controller => 'periods', :action => :show, :id => @task.period, :task_id => @task.id
225
225
  end
226
226
 
227
+ def finish_ajax
228
+ @task = Task.find(params[:id])
229
+ lower_item = @task.lower_item
230
+ @last_active = @task.lower_item.nil?
231
+ @last_active_in_backlog = @last_active || @task.lower_item.backlog != @task.backlog
232
+ finished_count = Task.count(:conditions => ['period_id = ? AND finished_at IS NOT NULL', @task.period_id])
233
+ @first_finished = finished_count == 0
234
+ @task.finish(Task::COMPLETED, true)
235
+ end
236
+
227
237
  def abort
228
238
  task = Task.find params[:id]
229
239
  task.abort
@@ -231,15 +241,18 @@ class TasksController < ApplicationController
231
241
  end
232
242
 
233
243
  def reopen
234
- task = Task.find(params[:id])
235
- task.reopen
236
- back_or_redirect_to :controller => 'periods', :action => :show, :id => task.period, :task => task.id
244
+ @task = Task.find(params[:id])
245
+ @task.reopen
246
+ @task.reload
247
+ finished_count = Task.count(:conditions => ['period_id = ? AND finished_at IS NOT NULL', @task.period_id])
248
+ @last_finished = finished_count == 0
249
+ # back_or_redirect_to :controller => 'periods', :action => :show, :id => @task.period, :task => @task.id
237
250
  end
238
251
 
239
252
  def start_work
240
- task = Task.find(params[:id])
241
- task.start_work
242
- back_or_redirect_to :controller => 'periods', :action => :show, :id => task.period, :task => task.id
253
+ @task = Task.find(params[:id])
254
+ @task.start_work
255
+ # back_or_redirect_to :controller => 'periods', :action => :show, :id => task.period, :task => task.id
243
256
  end
244
257
 
245
258
  def end_work
@@ -38,7 +38,7 @@ class WorkAccountsController < ApplicationController
38
38
  @work_account = WorkAccount.find(params[:id])
39
39
  if @work_account.update_attributes(params[:work_account])
40
40
  flash[:notice] = 'WorkAccount was successfully updated.'
41
- redirect_to :action => 'show', :id => @work_account
41
+ back_or_redirect_to :action => 'show', :id => @work_account
42
42
  else
43
43
  render :action => 'edit'
44
44
  end
@@ -39,6 +39,12 @@ module ApplicationHelper
39
39
  link_to image_tag(image_source, image_options), url_options, post ? {:method => :post} : nil
40
40
  end
41
41
 
42
+ def image_link_to_remote(image_source, title, url_options, image_options = nil, post = false)
43
+ image_options ||= {:class => 'image-submit'}
44
+ image_options.update :alt => title, :title => title
45
+ link_to_remote image_tag(image_source, image_options), {:url => url_options}, post ? {:method => :post} : nil
46
+ end
47
+
42
48
  def detour?
43
49
  not session[:detours].nil?
44
50
  end
data/app/models/task.rb CHANGED
@@ -209,6 +209,10 @@ class Task < ActiveRecord::Base
209
209
  def active_children?
210
210
  children.detect {|child| child.active?}
211
211
  end
212
+
213
+ def finished?
214
+ completed?
215
+ end
212
216
 
213
217
  def completed?
214
218
  finished_at || completed_children?
@@ -345,6 +349,7 @@ class Task < ActiveRecord::Base
345
349
  new_work.user = current_user
346
350
  new_work.work_account_id = work_account.id
347
351
  new_work.save!
352
+ works << new_work
348
353
  end
349
354
 
350
355
  def works_with_children
@@ -15,11 +15,6 @@
15
15
  <label for="backlog_track_done"><%=l :track_done%></label>
16
16
  </p>
17
17
 
18
- <p>
19
- <%#= check_box 'backlog', 'track_times' %>
20
- <label for="backlog_track_times"><%=l :track_times%></label>
21
- </p>
22
-
23
18
  <p>
24
19
  <%= check_box 'backlog', 'enable_subtasks' %>
25
20
  <label for="backlog_enable_subtasks"><%=l :enable_subtasks%></label>
@@ -37,7 +32,11 @@
37
32
 
38
33
  <p>
39
34
  <label for="backlog_work_account"><%=l :work_account%></label><br/>
40
- <%=select 'backlog', 'work_account', @work_accounts.map {|wa| [wa.name, wa.id]}.sort %>
35
+ <%=select 'backlog', 'work_account_id', @work_accounts.map {|wa| [wa.name, wa.id]}.sort %>
36
+ <% if @backlog.work_account %>
37
+ <%=image_detour_to('work_account.png', "#{l(:work_account)} #{@backlog.work_account.name}", {:controller => 'work_accounts', :action => :edit, :id => @backlog.work_account}, {:class => 'image-submit', :style => 'vertical-align: bottom'}) %>
38
+ <% end %>
39
+ <%=detour_to l(:new_work_account), :controller => 'work_accounts', :action => :new %>
41
40
  </p>
42
41
 
43
42
  <!--[eoform:task]-->
@@ -14,7 +14,7 @@
14
14
  <%= render :partial => '/tasks/fields_header', :locals => {:backlog => @backlog, :active => true, :track_times => tasks.find {|t|t.period && t.period.active?}} %>
15
15
  <% current_period = @task.period %>
16
16
  <% end %>
17
- <%= render :partial => '/tasks/task/', :locals => {:task => @task, :i => i += 1, :active => true, :highlight_task => false, :update => :maincontent} %>
17
+ <%= render :partial => '/tasks/task/', :locals => {:task => @task, :i => i += 1, :active => true, :highlight_task => false, :update => :maincontent, :hidden => false} %>
18
18
  <% end %>
19
19
  </table>
20
20
  <%=back_or_link_to(l(:back)) %>
@@ -7,8 +7,8 @@
7
7
  </div>
8
8
 
9
9
  <% form_tag :action => 'update', :id => @backlog do %>
10
- <%= render :partial => 'form' %>
11
- <%= submit_tag l(:save) %>
12
- <%= back_or_link_to l(:back), :action => 'show', :id => @backlog %>
10
+ <%=render :partial => 'form' %>
11
+ <%=submit_tag l(:save) %>
12
+ <%=back_or_link_to l(:back), :action => 'show', :id => @backlog %>
13
13
  <% end %>
14
14
  </div>
@@ -0,0 +1,11 @@
1
+ page.replace_html :notice, @message
2
+ page.visual_effect(:appear, :notice)
3
+ if @success
4
+ if @task.completed?
5
+ page.visual_effect :fade, "task_#{@task.id}"
6
+ page.remove "task_#{@task.id}"
7
+ page.insert_html :bottom, :completed_tasks, :partial => '/tasks/task'
8
+ page.visual_effect :appear, "task_#{@task.id}"
9
+ end
10
+ page['burn_down_chart'].src = url_for(:controller => 'periods', :action => :burn_down_chart_thumbnail, :id => @task.period_id, :rnd => rand)
11
+ end
@@ -3,7 +3,7 @@
3
3
  <h4><%=l :burn_down_chart %></h4>
4
4
  </div>
5
5
 
6
- <%= link_to %Q{<img src="#{url_for(:controller => 'periods', :action => :burn_down_chart_thumbnail, :id => @period, :format => :png)}" alt="Burn down chart" />}, :action => :burn_down_chart, :id => @period, :format => :png %>
6
+ <%= link_to %Q{<img id="burn_down_chart" src="#{url_for(:controller => 'periods', :action => :burn_down_chart_thumbnail, :id => @period, :format => :png)}" alt="Burn down chart" />}, :controller => 'periods', :action => :burn_down_chart, :id => @period, :format => :png %>
7
7
 
8
8
 
9
9
  </div>
@@ -9,7 +9,7 @@
9
9
  //<!--
10
10
  function handleEvent(field, event, id) {
11
11
  if (event.keyCode == 13) {
12
- field.form.submit();
12
+ // field.form.submit();
13
13
  } else if (event.altKey && event.keyCode == 38) {
14
14
  window.location = '<%=url_for(:controller => 'tasks', :action => :move_up)%>' + '/' + id;
15
15
  } else if (event.altKey && event.keyCode == 40) {
@@ -31,23 +31,23 @@ function handleEvent(field, event, id) {
31
31
  //-->
32
32
  </script>
33
33
 
34
- <% if @tasks and not @tasks.empty?%>
35
- <table class="input">
34
+
35
+ <table id="active_tasks" class="input"<%=' style="display: none;"' unless @tasks and not @tasks.empty?%>>
36
36
  <% current_backlog = nil %>
37
37
  <% for task in @tasks %>
38
38
  <% if task.backlog != current_backlog %>
39
39
  <%= '<tr><td>&nbsp;</td></tr>' if current_backlog %>
40
40
  <%=render :partial => '/tasks/backlog_header', :locals => { :backlog => task.backlog, :track_times => @tasks.find {|t|t.period && t.period.active?} } %>
41
- <%= render :partial => '/tasks/fields_header', :locals => { :backlog => task.backlog, :active => true, :track_times => @tasks.find {|t|t.period && t.period.active?} } %>
41
+ <%=render :partial => '/tasks/fields_header', :locals => { :backlog => task.backlog, :active => true, :track_times => @tasks.find {|t|t.period && t.period.active?} } %>
42
42
  <% current_backlog = task.backlog %>
43
43
  <% end %>
44
- <%=render :partial => '/tasks/task', :locals => { :task => task, :i => i, :active => true, :highlight_task => task == @selected_task, :update => :spotlight } %>
44
+ <%=render :partial => '/tasks/task', :locals => { :task => task, :i => i, :active => true, :highlight_task => task == @selected_task, :update => :spotlight, :hidden => false } %>
45
45
  <% i += 1 %>
46
46
  <% end %>
47
47
  </table>
48
- <% else %>
49
- <p><%=l :no_pending_tasks%></p>
50
- <% end %>
48
+
49
+ <p id="no_tasks_message"<%=' style="display: none;"' if @tasks and not @tasks.empty?%>><%=l :no_pending_tasks%></p>
50
+
51
51
 
52
52
 
53
53
 
@@ -1,13 +1,13 @@
1
1
  <% current_period = nil %>
2
2
 
3
- <table class="input">
3
+ <table id="completed_tasks" class="input">
4
4
  <% for task in @completed_tasks %>
5
5
  <% if task.period != current_period %>
6
6
  <%= render :partial => '/tasks/period_header', :locals => {:period => task.period} unless @completed_tasks.map(&:period).uniq.size == 1 %>
7
7
  <%= render :partial => '/tasks/fields_header', :locals => {:backlog => task.backlog, :active => false, :track_times => false} %>
8
8
  <% current_period = task.period %>
9
9
  <% end %>
10
- <%=render :partial => '/tasks/task', :locals => { :task => task, :i => i, :active => false, :highlight_task => task == @selected_task } %>
10
+ <%=render :partial => '/tasks/task', :locals => { :task => task, :i => i, :active => false, :highlight_task => task == @selected_task, :hidden => false } %>
11
11
  <% i += 1 %>
12
12
  <% end %>
13
13
  </table>
@@ -1,5 +1,5 @@
1
1
  <% @task = task %>
2
- <tr valign="top" <%='class="highlight"' if highlight_task %>>
2
+ <tr id="task_<%=@task.id%>" valign="top"<%=' class="highlight"' if highlight_task %><%=' style="display: none"' if hidden %>>
3
3
  <td width="1">
4
4
  <% if @task.enable_subtasks? && active && (@task.period.nil? || @task.period.active_or_future?) %>
5
5
  <% form_tag({:controller => 'tasks', :action => :specify, :id => @task}) do %>
@@ -14,7 +14,7 @@
14
14
  <%= "-" if @task.children.size > 0 %>
15
15
  </td>
16
16
  <td>
17
- <div id="task_<%=@task.id%>"<%=' class="tasks" onmouseover="this.style.border=\'1px solid black\'" onmouseout="this.style.border=\'1px solid transparent\'"' if active && (@task.period.nil? || @task.period.active_or_future?) && (not @task.work_started?) %>>
17
+ <div<%=' class="tasks" onmouseover="this.style.border=\'1px solid black\'" onmouseout="this.style.border=\'1px solid transparent\'"' if active && (@task.period.nil? || @task.period.active_or_future?) && (not @task.work_started?) %>>
18
18
  <% if @task.active? -%>
19
19
  <%= in_place_editor_field(:task, :description, {:id => "#{@task.id}_description", :tabindex => i}, :url => url_for(:controller => 'tasks', :action => "set_task_description", :id => @task)) %>
20
20
  <% else -%>
@@ -30,7 +30,7 @@
30
30
  <%= text_field 'work', 'started_at_time', :tabindex => i+1, :value => @task.started_work.started_at.strftime('%H:%M'),
31
31
  :class => :task_time, :maxlength => 5, :onkeypress => "handleEvent(this, event, #{@task.id})" %>
32
32
  <% elsif @task.track_times? && @task.period && @task.period.active? %>
33
- <%= image_detour_to 'hammer.png', l(:start_work), {:controller => 'tasks', :action => :start_work, :id => @task.id}, nil, true %>
33
+ <%= image_link_to_remote 'hammer.png', l(:start_work), {:controller => 'tasks', :action => :start_work, :id => @task.id}, nil, true %>
34
34
  <% end -%>
35
35
  <% end %>
36
36
  <% end -%>
@@ -49,7 +49,7 @@
49
49
  <%= hidden_field('work', 'task_id', :value => @task.id)%>
50
50
  <%= submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
51
51
  <% unless @task.track_times? || @task.work_started? || @task.finished_at -%>
52
- <%= text_field 'work', 'hours', :tabindex => i+1, :id => "#{@task.id}_done",
52
+ <%=text_field 'work', 'hours', :tabindex => i+1, :id => "#{@task.id}_done",
53
53
  :class => :task_hours, :maxlength => 4, :onkeypress => "handleEvent(this, event, #{@task.id})",
54
54
  :ondblclick => "form.elements[1].style.display = 'inline';this.style.display = 'none'" -%>
55
55
  <% end -%>
@@ -60,17 +60,16 @@
60
60
  </td>
61
61
  <td nowrap="true" width="1">
62
62
  <% if active && @task.loggable? -%>
63
- <% form_tag({:controller => 'estimates', :action => 'create', :id => @task}) do %>
64
- <%= submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
65
- <% if @task.track_todo? %>
66
- <% if @task.period.nil? || @task.period.active_or_future? %>
67
- <%= text_field 'estimate', 'todo', :tabindex => i+2, :id => "#{@task.id}_todo", :value => @task.todo, :class => :task_hours, :maxlength => 4, :onkeypress => "handleEvent(this, event, #{@task.id})" %>
68
- <% else %>
69
- <%= @task.todo %>
70
- <% end %>
63
+ <% remote_form_for(:estimate, :url => {:controller => 'estimates', :action => :create_ajax, :id => @task}) do |f| -%>
64
+ <% if @task.track_todo? -%>
65
+ <% if @task.period.nil? || @task.period.active_or_future? -%>
66
+ <%=f.text_field :todo, :tabindex => i+2, :id => "#{@task.id}_todo", :value => @task.todo, :class => :task_hours, :maxlength => 4, :onkeypress => "handleEvent(this, event, #{@task.id})" %>
67
+ <% else -%>
68
+ <%=@task.todo %>
69
+ <% end -%>
71
70
  <% end -%>
72
71
  <% if (not @task.track_times?) && !@task.work_started? && (@task.period.nil? || @task.period.active?) %>
73
- <%= image_detour_to('checkmark.png', l(:complete), {:controller => 'tasks', :action => :finish, :id => @task}, nil, true)%>
72
+ <%= image_link_to_remote('checkmark.png', l(:complete), {:controller => 'tasks', :action => :finish_ajax, :id => @task}, nil, true)%>
74
73
  <% end -%>
75
74
  <% end -%>
76
75
  <% end -%>
@@ -85,7 +84,7 @@
85
84
  <% end %>
86
85
  <% end %>
87
86
  <% elsif (@task.period.nil? || (not @task.period.passed?)) && @task.leaf? %>
88
- <%=image_detour_to('/images/eraser.png', l(:reopen), {:controller => 'tasks', :action => :reopen, :id => @task}, nil, true) %>
87
+ <%=image_link_to_remote('eraser.png', l(:reopen), {:controller => 'tasks', :action => :reopen, :id => @task}, nil, true) %>
89
88
  <% end -%>
90
89
  <% end -%>
91
90
  </td>
@@ -0,0 +1,25 @@
1
+ page.replace_html :notice, @message
2
+ page.visual_effect(:appear, :notice)
3
+
4
+ page.visual_effect :fade, "task_#{@task.id}"
5
+ page.remove "task_#{@task.id}"
6
+
7
+ if @last_active_in_backlog
8
+ page.select('#active_tasks tr').first.remove
9
+ page.select('#active_tasks tr').first.remove
10
+ end
11
+
12
+ if @last_active
13
+ page.visual_effect :appear, "no_tasks_message"
14
+ end
15
+
16
+ unless @first_finished
17
+ page.select('#completed_tasks tr').first.remove
18
+ end
19
+
20
+ page.insert_html :top, :completed_tasks, :partial => '/tasks/task', :locals => {:active => false, :hidden => true, :highlight_task => false}
21
+ page.visual_effect :appear, "task_#{@task.id}"
22
+
23
+ page.insert_html :top, :completed_tasks, :partial => '/tasks/fields_header', :locals => {:backlog => @task.backlog, :active => false}
24
+
25
+ page['burn_down_chart'].src = url_for(:controller => 'periods', :action => :burn_down_chart_thumbnail, :id => @task.period_id, :rnd => rand)
@@ -0,0 +1,26 @@
1
+ page.replace :notice, :partial => '/layouts/notice'
2
+ page.visual_effect(:appear, :notice)
3
+
4
+ if @task.lower_item && @task.lower_item.backlog == @task.backlog
5
+ page.select('#active_tasks tr').first.remove
6
+ page.select('#active_tasks tr').first.remove
7
+ end
8
+
9
+ page.visual_effect :fade, "task_#{@task.id}"
10
+
11
+ page.remove "task_#{@task.id}"
12
+
13
+ if @last_finished
14
+ page.select('#completed_tasks tr').first.remove
15
+ end
16
+
17
+ page.insert_html :top, :active_tasks, :partial => '/tasks/task', :locals => { :task => @task, :i => 1, :active => true, :highlight_task => false, :update => :spotlight, :hidden => true }
18
+ page[:no_tasks_message].hide
19
+
20
+ page.insert_html :top, :active_tasks, :partial => '/tasks/fields_header', :locals => {:backlog => @task.backlog}
21
+ page.insert_html :top, :active_tasks, :partial => '/tasks/backlog_header', :locals => {:backlog => @task.backlog}
22
+ page.visual_effect :blind_down, "active_tasks"
23
+ page.visual_effect :appear, "task_#{@task.id}"
24
+
25
+ page.visual_effect :appear, "task_#{@task.id}"
26
+ page['burn_down_chart'].src = url_for(:controller => 'periods', :action => :burn_down_chart_thumbnail, :id => @task.period_id, :rnd => rand)
@@ -0,0 +1,2 @@
1
+ page.replace "task_#{@task.id}", :partial => '/tasks/task', :locals => { :task => @task, :i => 1, :active => true, :highlight_task => false, :update => :spotlight, :hidden => false }
2
+ page.visual_effect :shake, "task_#{@task.id}"
@@ -4,6 +4,11 @@
4
4
  <p><label for="work_account_name">Name</label><br/>
5
5
  <%= text_field 'work_account', 'name' %></p>
6
6
 
7
+ <p>
8
+ <%=check_box :work_account, 'track_times' %>
9
+ <label for="work_account_track_times"><%=l :track_times%></label>
10
+ </p>
11
+
7
12
  <p><label for="work_account_invoice_code">Invoice code</label><br/>
8
13
  <%= text_field 'work_account', 'invoice_code' %></p>
9
14
  <!--[eoform:work_account]-->
@@ -1,9 +1,14 @@
1
- <h1>Editing work_account</h1>
1
+ <% @page_title = "#{l(:editing)} #{l(:work_account)}" %>
2
+
3
+ <div id="spotlight">
4
+ <div class="btitle">
5
+ <h4><%=@work_account.name%></h4>
6
+ </div>
2
7
 
3
8
  <% form_tag :action => 'update', :id => @work_account do %>
4
- <%= render :partial => 'form' %>
5
- <%= submit_tag 'Edit' %>
9
+ <%=render :partial => 'form' %>
10
+ <%=submit_tag l(:save) %>
11
+ <%=back_or_link_to l(:back), :action => 'show', :id => @backlog %>
6
12
  <% end %>
7
13
 
8
- <%= link_to 'Show', :action => 'show', :id => @work_account %> |
9
- <%= link_to 'Back', :action => 'list' %>
14
+ </div>
Binary file
@@ -5,7 +5,7 @@ require 'backlogs_controller'
5
5
  class BacklogsController; def rescue_action(e) raise e end; end
6
6
 
7
7
  class BacklogsControllerTest < Test::Unit::TestCase
8
- fixtures :parties, :users, :groups, :groups_users, :work_accounts, :backlogs, :periods, :tasks, :task_files, :works, :estimates
8
+ fixtures(*ALL)
9
9
 
10
10
  def setup
11
11
  @user_controller = UserController.new
@@ -5,7 +5,7 @@ require 'work_accounts_controller'
5
5
  class WorkAccountsController; def rescue_action(e) raise e end; end
6
6
 
7
7
  class WorkAccountsControllerTest < Test::Unit::TestCase
8
- fixtures :work_accounts, :backlogs, :tasks, :estimates, :works, :task_files
8
+ fixtures(*ALL)
9
9
 
10
10
  def setup
11
11
  @controller = WorkAccountsController.new
data/test/test_helper.rb CHANGED
@@ -4,6 +4,8 @@ require 'test_help'
4
4
  require 'user_notify'
5
5
 
6
6
  class Test::Unit::TestCase
7
+ ALL = [:parties, :users, :groups, :groups_users, :work_accounts, :backlogs, :periods, :tasks, :task_files, :works, :estimates]
8
+
7
9
  # Transactional fixtures accelerate your tests by wrapping each test method
8
10
  # in a transaction that's rolled back on completion. This ensures that the
9
11
  # test database remains unchanged so your fixtures don't have to be reloaded
@@ -0,0 +1,9 @@
1
+ [REVISION 20061202]
2
+
3
+ [CHANGED] Use Rails 1.2 alias_method_chain.
4
+
5
+ [CHANGED] Separate modules into individual files.
6
+
7
+ [REVISION 200608014]
8
+
9
+ [NEW] Initial version.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2006 RedHill Consulting, Pty. Ltd.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,15 @@
1
+ = Transactional Migrations
2
+
3
+ Transactional Migrations is a plugin that ensures your migration scripts--both
4
+ up and down--run within a transaction. When used in conjunction with a
5
+ database that supports transactional Data Definition Language (DDL)--such as
6
+ PostgreSQL--this ensures that if any statement within your migration script
7
+ fails, the entire script is rolled-back.
8
+
9
+ Over and above installing the plugin, no further action is required for the
10
+ transactions to take effect.
11
+
12
+ === License
13
+
14
+ This plugin is copyright 2006 by RedHill Consulting, Pty. Ltd. and is released
15
+ under the MIT license.
@@ -0,0 +1,5 @@
1
+ author: simon@redhillconsulting.com.au
2
+ summary: Ensures your migration scripts--both up and down--run within a transaction.
3
+ homepage: http://www.redhillonrails.org
4
+ license: MIT
5
+ rails_version: EDGE
@@ -0,0 +1 @@
1
+ ActiveRecord::Migration.send(:include, RedHillConsulting::TransactionalMigrations::ActiveRecord::Migration)
@@ -0,0 +1,19 @@
1
+ module RedHillConsulting::TransactionalMigrations::ActiveRecord
2
+ module Migration
3
+ def self.included(base)
4
+ base.extend(ClassMethods)
5
+ end
6
+
7
+ module ClassMethods
8
+ def self.extended(base)
9
+ class << base
10
+ alias_method_chain :migrate, :transactional_migrations
11
+ end
12
+ end
13
+
14
+ def migrate_with_transactional_migrations(direction)
15
+ ActiveRecord::Base.transaction { migrate_without_transactional_migrations(direction) }
16
+ end
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: backlog
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.11.0
7
- date: 2007-11-03 00:00:00 +01:00
6
+ version: 0.12.0
7
+ date: 2007-11-06 00:00:00 +01:00
8
8
  summary: Application to aid collecting, processing, organizing, reviewing and doing tasks.
9
9
  require_paths:
10
10
  - lib
@@ -50,6 +50,7 @@ files:
50
50
  - public/images/arrow_right.png
51
51
  - public/images/construction_hammer_jon__01.svg
52
52
  - public/images/arrow_down.svg
53
+ - public/images/work_account.png
53
54
  - public/images/checkmark_org.png
54
55
  - public/images/rmagick_270.gif
55
56
  - public/images/pagebak.jpg
@@ -271,6 +272,17 @@ files:
271
272
  - cruise_config.rb
272
273
  - vendor
273
274
  - vendor/plugins
275
+ - vendor/plugins/transactional_migrations
276
+ - vendor/plugins/transactional_migrations/lib
277
+ - vendor/plugins/transactional_migrations/lib/red_hill_consulting
278
+ - vendor/plugins/transactional_migrations/lib/red_hill_consulting/transactional_migrations
279
+ - vendor/plugins/transactional_migrations/lib/red_hill_consulting/transactional_migrations/active_record
280
+ - vendor/plugins/transactional_migrations/lib/red_hill_consulting/transactional_migrations/active_record/migration.rb
281
+ - vendor/plugins/transactional_migrations/about.yml
282
+ - vendor/plugins/transactional_migrations/init.rb
283
+ - vendor/plugins/transactional_migrations/CHANGELOG
284
+ - vendor/plugins/transactional_migrations/MIT-LICENSE
285
+ - vendor/plugins/transactional_migrations/README
274
286
  - vendor/plugins/goldspike
275
287
  - vendor/plugins/goldspike/test
276
288
  - vendor/plugins/goldspike/test/test_create_war.rb
@@ -423,6 +435,7 @@ files:
423
435
  - app/views/backlogs/edit.rhtml
424
436
  - app/views/backlogs/_tasks.rhtml
425
437
  - app/views/estimates
438
+ - app/views/estimates/create_ajax.rjs
426
439
  - app/views/groups
427
440
  - app/views/groups/list.rhtml
428
441
  - app/views/groups/_form.rhtml
@@ -441,13 +454,16 @@ files:
441
454
  - app/views/tasks
442
455
  - app/views/tasks/_backlog_header.rhtml
443
456
  - app/views/tasks/list.rhtml
457
+ - app/views/tasks/finish_ajax.rjs
444
458
  - app/views/tasks/_form.rhtml
445
459
  - app/views/tasks/_period_header.rhtml
446
460
  - app/views/tasks/new.rhtml
461
+ - app/views/tasks/start_work.rjs
447
462
  - app/views/tasks/_fields_header.rhtml
448
463
  - app/views/tasks/_completed.rhtml
449
464
  - app/views/tasks/edit.rhtml
450
465
  - app/views/tasks/list_started.rhtml
466
+ - app/views/tasks/reopen.rjs
451
467
  - app/views/tasks/_task.rhtml
452
468
  - app/views/works
453
469
  - app/views/works/list.rhtml