Skip to content
This repository was archived by the owner on Jan 30, 2018. It is now read-only.

Commit e4e33c6

Browse files
committed
Show hours in comments when querying with the API
1 parent 04826a4 commit e4e33c6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/models/comment/conversions.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def to_api_hash(options = {})
3939
:user_id => user_id,
4040
:project_id => project_id,
4141
:target_id => target_id,
42-
:target_type => target_type
42+
:target_type => target_type,
43+
:hours => hours
4344
}
4445

4546
base[:type] = self.class.to_s if options[:emit_type]

app/views/apidocs/model/_comment.haml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
- doc_for :show, :example => @comment.to_api_hash(:include => [:user]) do
88
%p= "Returns the data for an comment."
99

10-
- doc_for :create, :parameters => {:body => 'Comment', :hours => 1, :project_id => 123 },
10+
- doc_for :create, :parameters => {:body => 'Comment', :hours => 1, :project_id => 123},
1111
:example => @comment.to_api_hash,
1212
:status => :created,
1313
:role => :commenter do
1414
%p= "Creates a new comment. You can specify the target of the comment using one of the appropriate routes."
15+
%p= "For time tracking, simply pass in time taken using the <tt>hours</tt> parameter. Acceptable values are the same as on the web frontend - e.g. 12h, 1.4, 13m, 2:15."
1516

1617
- doc_for :update, :parameters => {:body => @comment.body, :name => @comment.hours },
1718
:status => :updated,

0 commit comments

Comments
 (0)