clear v0.7 Release Notes
Release Date: 2019-05-28 // almost 5 years ago-
v0.7
๐ Features
- โ Add
Clear::Interval
type
This type is related to the type
Clear::Interval
of PostgreSQL. It storesmonth
,days
andmicroseconds
and can be used
withTime
(Postgres'datetime
) by adding or substracting it.Examples:
Usage in Expression engine:
interval = Clear::Interval.new(months: 1, days: 1)MyModel.query.where{ created\_at - interval \> updated\_at }.each do |model| # ...end
๐ It might be used as column definition, and added / removed to crystal
Time
objectclass MyModelinclude Clear::Model column i : Clear::Intervalendputs "Expected time: #{Time.now + MyModel.first!.i}"
- โ Add
Clear::TimeInDay
columns type, which stands for thetime
object in PostgreSQL.
Examples:
Usage as stand alone:
time = Clear::TimeInDay.parse("12:33")puts time.hour # 12puts time.minutes # 0Time.now.at(time) # Today at 12:33:00time.to\_s # 12:33:00time.to\_s(false) # don't show seconds =\> 12:33time = time + 2.minutes #12:35
As with Interval, you might wanna use it as a column (use underlying
time
type in PostgreSQL):class MyModelinclude Clear::Model column i : Clear::TimeInDayend
๐ Bug fixes
- ๐ Fix #115 (Thanks @pynixwang)
- ๐ Fix #118 (Thanks @russ)
- ๐ Fix #108
- โ Add