Class: Kuroko2::Tick

Inherits:
ApplicationRecord show all
Includes:
TableNameCustomizable
Defined in:
app/models/kuroko2/tick.rb

Class Method Summary collapse

Class Method Details

.fetch_then_update(now) ⇒ Object



4
5
6
7
8
9
10
# File 'app/models/kuroko2/tick.rb', line 4

def self.fetch_then_update(now)
  tick = self.first_or_create
  last = tick.at || now

  tick.update_column(:at, now)
  last
end