This is a judgment call, as I can see the argument for having new nodes be considered as a root if they haven't explicitly set the parent_id column. However, I think this is a better default. For one, it better handles default values, either set by the database or in a before save hook.
The conditions option has to be handled differently than normal associations. It must be respected in the recursive CTE otherwise we may select orphaned records. In order for a condition to work, it must reference qualified columns because the recursive select statement effectively selects from the source table twice. And in order for qualified conditions to work, I had to change the last select statement of the generated sql to alias 't' to the natural table name.
…s the raise_on_save_failure setting This is useful in library contexts where it is necessary to enforce or prohibit raising without perturbing the existing raise_on_save_failure setting (for example, to implement an ActiveRecord-like save! method). Before, this would have required a begin/set/ensure/reset dance. While here, update and clarify the documentation for save, and rename save_failure and update its usage to reflect its new behavior.
… names in the single table inheritance plugin Sequel usually calls methods to get column values instead of just checking the values hash, as it is more flexible. However, in some cases it can be problematic. This is one of those cases.
Also, mark a spec as pending when using the do adapter (except on SQLite).
There is a bug which causes times to be read from the database incorrectly if they should have a different UTC offset than the current local time. (i.e. if current local time is adjusted for Daylight Savings and the time in the database is not, or vice versa).
Thanks hassox for testing this.
…igration current or target version doesn't exist Thanks manveru for pointing this out.
Ran into problems when the same table name appeared in multiple schemas. This fixed it.
Database#each_server takes the options from the given server and passes them to Database.connect. However, if a connection string was used instead of an options hash, the :adapter option may not have been filled in, which made Database.connect raise an exception. Fix this by explicitly populating the :adapter option when using a connection string.
…ons setting, instead of always using a transaction