Commit 5172042eb26b1169cb779b48d149c7a9a648272d

Authored by Leandro Santos
Committed by Rodrigo Souto
1 parent b0d5f0ec

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 1 module API
2 2 module V1
3 3 class Articles < Grape::API
4   -
5 4 before { detect_stuff_by_domain }
6 5 before { authenticate! }
7 6  
8 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 9 # Collect comments from articles
18 10 #
19 11 # Parameters:
... ... @@ -28,7 +20,7 @@ module API
28 20 until_date = DateTime.parse(params[:until]) if params[:until]
29 21  
30 22 if from_date.nil?
31   - begin_period = default_from_date
  23 + begin_period = Time.at(0).to_datetime
32 24 end_period = until_date.nil? ? DateTime.now : until_date
33 25 else
34 26 begin_period = from_date
... ...