diff options
| author | Rémy Coutable <remy@rymai.me> | 2017-02-20 14:41:27 +0000 | 
|---|---|---|
| committer | Rémy Coutable <remy@rymai.me> | 2017-02-20 14:41:27 +0000 | 
| commit | 173dbeb972d0da365ac77129d0e12727ae571e91 (patch) | |
| tree | 87f2f6d62f9786f1465779ccbf58ae55cc948786 /lib/api/commits.rb | |
| parent | bc0b438d13f6bffd8e837f551a5415173f43f9f3 (diff) | |
| parent | 612e61f4c4c374f4a47ea6d8a3b71fd40c41ac19 (diff) | |
| download | gitlab-ce-173dbeb972d0da365ac77129d0e12727ae571e91.tar.gz | |
Merge branch 'api-grape-datetime' into 'master'
Use grape validation for dates
See merge request !9375
Diffstat (limited to 'lib/api/commits.rb')
| -rw-r--r-- | lib/api/commits.rb | 7 | 
1 files changed, 2 insertions, 5 deletions
| diff --git a/lib/api/commits.rb b/lib/api/commits.rb index 173083d0ade..f0ed5f34419 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -16,16 +16,13 @@ module API        end        params do          optional :ref_name, type: String, desc: 'The name of a repository branch or tag, if not given the default branch is used' -        optional :since,    type: String, desc: 'Only commits after or in this date will be returned' -        optional :until,    type: String, desc: 'Only commits before or in this date will be returned' +        optional :since,    type: DateTime, desc: 'Only commits after or in this date will be returned' +        optional :until,    type: DateTime, desc: 'Only commits before or in this date will be returned'          optional :page,     type: Integer, default: 0, desc: 'The page for pagination'          optional :per_page, type: Integer, default: 20, desc: 'The number of results per page'          optional :path,     type: String, desc: 'The file path'        end        get ":id/repository/commits" do -        # TODO remove the next line for 9.0, use DateTime type in the params block -        datetime_attributes! :since, :until -          ref = params[:ref_name] || user_project.try(:default_branch) || 'master'          offset = params[:page] * params[:per_page] | 
