Commit e11ffe36f264635597571148f754cedb06fc7c85
Committed by
Rodrigo Souto
1 parent
3e77e763
Exists in
master
and in
29 other branches
remove unecessary helper for begin date definition
Showing
1 changed file
with
1 additions
and
9 deletions
Show diff stats
lib/api/v1/articles.rb
1 | module API | 1 | module API |
2 | module V1 | 2 | module V1 |
3 | class Articles < Grape::API | 3 | class Articles < Grape::API |
4 | - | ||
5 | before { detect_stuff_by_domain } | 4 | before { detect_stuff_by_domain } |
6 | before { authenticate! } | 5 | before { authenticate! } |
7 | 6 | ||
8 | resource :articles do | 7 | resource :articles do |
9 | 8 | ||
10 | - helpers do | ||
11 | - def default_from_date | ||
12 | - @article_created_at ||= Article.first.created_at | ||
13 | - @article_created_at | ||
14 | - end | ||
15 | - end | ||
16 | - | ||
17 | # Collect comments from articles | 9 | # Collect comments from articles |
18 | # | 10 | # |
19 | # Parameters: | 11 | # Parameters: |
@@ -28,7 +20,7 @@ module API | @@ -28,7 +20,7 @@ module API | ||
28 | until_date = DateTime.parse(params[:until]) if params[:until] | 20 | until_date = DateTime.parse(params[:until]) if params[:until] |
29 | 21 | ||
30 | if from_date.nil? | 22 | if from_date.nil? |
31 | - begin_period = default_from_date | 23 | + begin_period = Time.at(0).to_datetime |
32 | end_period = until_date.nil? ? DateTime.now : until_date | 24 | end_period = until_date.nil? ? DateTime.now : until_date |
33 | else | 25 | else |
34 | begin_period = from_date | 26 | begin_period = from_date |