|
| 1 | += New Features |
| 2 | + |
| 3 | +* A pg_auto_validate_enums plugin has been added, for automatically |
| 4 | + validating enum values on PostgreSQL: |
| 5 | + |
| 6 | + class Person < Sequel::Model |
| 7 | + # assume state enum column with allowed values active and inactive |
| 8 | + plugin :pg_auto_validate_enums |
| 9 | + end |
| 10 | + p = Person.new(state: "active").valid? # => true |
| 11 | + p = Person.new(state: "inactive").valid? # => true |
| 12 | + p = Person.new(state: "other").valid? # => false |
| 13 | + |
| 14 | +* The pg_auto_parameterize_in_array extension now supports a |
| 15 | + :treat_string_list_as_untyped_array Database option. When using |
| 16 | + this option, the array is not casted to a specific type: |
| 17 | + |
| 18 | + DB[:table].where(enum_column: ["a", "b"]) |
| 19 | + SELECT * FROM table WHERE enum_column = ANY($1) |
| 20 | + |
| 21 | + The pg_auto_parameterize_in_array extension also now avoids |
| 22 | + Database#typecast_value calls at runtime, moving them to load time, |
| 23 | + which speeds up the extension. |
| 24 | + |
| 25 | +* The forbid_lazy_load plugin now supports an :allow_by_default plugin |
| 26 | + option, which does not automatically forbid lazy loading when |
| 27 | + retrieving multiple model instances. With this option, lazy |
| 28 | + loading can still be forbidding explicitly on a per-object basis. |
| 29 | + This can make it easier to gradually update code to support the |
| 30 | + plugin. |
| 31 | + |
| 32 | += Other Improvements |
| 33 | + |
| 34 | +* The pg_auto_constraint_validations plugin now sorts subhashes before |
| 35 | + saving the cache file, resulting in more deterministic behavior. |
| 36 | + |
| 37 | +* datetime(N) database types are once again recognized as :datetime. |
| 38 | + This was broken in 5.32.0, when support for timestamp(N) with time |
| 39 | + zone was added. |
| 40 | + |
| 41 | +* AssociationReflection#hash has been added, to avoid the default |
| 42 | + behavior that iterated over the entire AssociationReflection. This |
| 43 | + can prevent a potential concurrency issue at runtime, and it also |
| 44 | + makes the method faster. |
| 45 | + |
| 46 | +* It is now possible to override nested_attributes behavior for |
| 47 | + creating new objects by overriding Model#nested_attributes_new. You |
| 48 | + can use this to support nested attributes for models using the |
| 49 | + class_table_inheritance plugin. |
| 50 | + |
| 51 | += Backwards Compatibility |
| 52 | + |
| 53 | +* Database options to configure the pg_auto_parameterize_in_array |
| 54 | + extension must now be set before loading the extension. Setting |
| 55 | + the options after loading the extension no longer has an effect. |
0 commit comments