Module: CreatedId

Extended by:
ActiveSupport::Concern
Defined in:
lib/created_id.rb,
lib/created_id/engine.rb,
lib/created_id/version.rb,
lib/created_id/id_range.rb

Defined Under Namespace

Classes: CreatedAtChangedError, Engine, IdRange

Constant Summary collapse

VERSION =
File.read(File.expand_path("../../VERSION", __dir__)).chomp.freeze

Class Method Summary collapse

Class Method Details

.coerce_hour(time) ⇒ Object

Coerce a time to the beginning of the hour in UTC.



16
17
18
19
# File 'lib/created_id.rb', line 16

def coerce_hour(time)
  time = time.to_time.utc
  Time.utc(time.year, time.month, time.day, time.hour)
end