Path: | doc/release_notes/4.38.0.txt |
Last Update: | Fri Oct 06 03:25:22 +0000 2017 |
Sequel.expr{a - 1}
This is because a in this case returns a Sequel::SQL::Indentifier, which defines #- to return a Sequel::SQL::NumericExpression. By supporting coerce, the following code now also works:
Sequel.expr{1 - a}
This is because Integer#- calls coerce on the argument if it is defined (ruby‘s coercion protocol). Previously, you had to handle this differently, using something like:
Sequel.expr(1) - a # or Sequel.-(1, a)
Note that Sequel 5 will move after_commit/rollback model hooks to a plugin, and the default and recommended approach will be to use the database after_commit/rollback hooks in the after_save or similar model hooks.