Skip to content

Commit 47545f4

Browse files
authored
Merge pull request #512 from amatsuda/death_to_DateTime
DateTime => Time
2 parents 786ec83 + 04b0a58 commit 47545f4

16 files changed

+30
-30
lines changed

app/controllers/proposals_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def edit
116116

117117
def update
118118
if params[:confirm]
119-
@proposal.update(confirmed_at: DateTime.current)
119+
@proposal.update(confirmed_at: Time.current)
120120
redirect_to event_event_proposals_url(slug: @event.slug, uuid: @proposal), flash: { success: "Thank you for confirming your participation" }
121121
elsif @proposal.speaker_update_and_notify(proposal_params)
122122
redirect_to event_proposal_url(event_slug: @event.slug, uuid: @proposal)

app/controllers/staff/program_sessions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ def program_session_params
9898
end
9999

100100
def json_filename
101-
"#{current_event.slug}-program-#{DateTime.current.to_fs(:db_just_date)}.json"
101+
"#{current_event.slug}-program-#{Time.current.to_fs(:db_just_date)}.json"
102102
end
103103
end

app/controllers/staff/time_slots_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,6 @@ def time_slot_decorated
9999
end
100100

101101
def json_filename
102-
"#{current_event.slug}-schedule-#{DateTime.current.to_fs(:db_just_date)}.json"
102+
"#{current_event.slug}-schedule-#{Time.current.to_fs(:db_just_date)}.json"
103103
end
104104
end

app/decorators/event_decorator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def event_path_for
3232
end
3333

3434
def cfp_days_remaining
35-
((object.closes_at - DateTime.current).to_i / 1.day) if object.closes_at && (object.closes_at - DateTime.now).to_i / 1.day > 1
35+
((object.closes_at - Time.current).to_i / 1.day) if object.closes_at && (object.closes_at - Time.now).to_i / 1.day > 1
3636
end
3737

3838
def closes_at(format = nil)
@@ -123,7 +123,7 @@ def day
123123
private
124124

125125
def proposal_date_range
126-
now = DateTime.now
126+
now = Time.now
127127
if object.proposals.present? && object.closes_at
128128
event_first_proposal_created_at =
129129
object.proposals.order(created_at: :asc).pluck(:created_at).first

app/models/event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def mention_names
231231

232232
def update_closes_at_if_manually_closed
233233
if changes.key?(:state) && changes[:state] == [STATUSES[:open], STATUSES[:closed]]
234-
self.closes_at = DateTime.now
234+
self.closes_at = Time.now
235235
end
236236
end
237237
end

app/models/notification.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def self.create_for(user, args = {})
1818
end
1919

2020
def self.mark_as_read_for_proposal(proposal_url)
21-
all.unread.where(target_path: proposal_url).update_all(read_at: DateTime.current)
21+
all.unread.where(target_path: proposal_url).update_all(read_at: Time.current)
2222
end
2323

2424
def self.more_unread?
@@ -30,7 +30,7 @@ def self.more_unread_count
3030
end
3131

3232
def mark_as_read
33-
update(read_at: DateTime.current)
33+
update(read_at: Time.current)
3434
end
3535

3636
def read?

app/models/proposal.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def withdraw
141141
end
142142

143143
def confirm
144-
update(confirmed_at: DateTime.current)
144+
update(confirmed_at: Time.current)
145145
program_session.confirm if program_session.present?
146146
end
147147

@@ -150,7 +150,7 @@ def promote
150150
end
151151

152152
def decline
153-
update(state: WITHDRAWN, confirmed_at: DateTime.current)
153+
update(state: WITHDRAWN, confirmed_at: Time.current)
154154
program_session.update(state: ProgramSession::DECLINED)
155155
end
156156

spec/factories/events.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
url { "http://fineevent.com/" }
55
guidelines { "We want all the good talks!" }
66
contact_email { "[email protected]" }
7-
start_date { DateTime.now + 25.days }
8-
end_date { DateTime.now + 30.days }
7+
start_date { Time.now + 25.days }
8+
end_date { Time.now + 30.days }
99
closes_at { 3.weeks.from_now.to_datetime }
1010
end
1111
end

spec/factories/notifications.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
factory :notification do
55
user { nil }
66
message { "MyString" }
7-
read_at { DateTime.now }
7+
read_at { Time.now }
88
target_path { '/events' }
99

1010
trait :unread do

spec/factories/pages.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
sequence(:slug) { |i| "home#{i if i > 1}" }
66
unpublished_body { "<p>#{Faker::Lorem.paragraph}</p>" }
77
published_body { "<p>#{Faker::Lorem.paragraph}</p>" }
8-
body_published_at { DateTime.now - 1.day }
8+
body_published_at { Time.now - 1.day }
99
end
1010
end

0 commit comments

Comments
 (0)