clear v0.7 Release Notes

Release Date: 2019-05-28 // about 3 years ago
  • v0.7

    ๐Ÿ”‹ Features

    • โž• Add Clear::Interval type

    This type is related to the type Clear::Interval of PostgreSQL. It stores month, days and microseconds and can be used
    with Time (Postgres' datetime) by adding or substracting it.


    Usage in Expression engine:

    interval = 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 object

    class MyModelinclude Clear::Model column i : Clear::Intervalendputs "Expected time: #{ + MyModel.first!.i}"
    • โž• Add Clear::TimeInDay columns type, which stands for the time object in PostgreSQL.


    Usage as stand alone:

    time = Clear::TimeInDay.parse("12:33")puts time.hour # 12puts time.minutes # # Today at\_s #\_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