Previously, the schema part would be ignored and it looked to the table in the current database.
…operators The modulus operator is just considered one of the bitwise operators, so it can only be used on fields that Sequel knows represent numbers. For example: :column % 2 would not work. You need to use: :column.sql_number % 2 # or without the core expressions: Sequel.expr(:column).sql_number % 2
…adapter transaction code
…Database transaction code Unlike most of the other changes, if there were actual thread safety issues, I assume one of the many JRuby Sequel users would have hit in this case, since using transactions is very common.
…in Database prepared_statements code
…prepared statements plugins
…associations using the same key This was already handled correctly, but there wasn't a spec for it.
…many_to_many plugin Similar to the other association fixes, but change the implementation so that cached values are always accessed via a method. This is backwards incompatible for external plugins that were accessing the cached information.
…sociation reflection caching code I don't believe these thread safety issues can happen on MRI due to the GVL, so while there are still changes on MRI, it doesn't attempt to use a mutex to synchronize access. Basically, in modern versions of JRuby, Hash#= is not safe to use by multiple threads simultaneously. This adds a cached_fetch private method that handles synchronized access to a subhash in the association reflection that handles mutable data. This way, you don't need to synchronize access to the entire association reflection (which is mostly immutable), just the parts that are mutable. Note that mutable here just refers to things that are cached on first call. I expect that it is extremely difficult to hit any of the issues that this commit fixes even in JRuby.
…nd work on multiple tables This makes Sequel support all of PostgreSQL's truncate options. This also moves the previous support from the native postgres adapter to the shared postgres adapter, so it's available on jdbc and other adapters that can connect to PostgreSQL.
Only WHERE was checked previously, but if we are going to check WHERE, we should check HAVING as well. Also, split the check for GROUP and JOIN to it's own method, so adapters can override it separately from the standard modification checks.
…son method to serialize existing array of model instances Before, if you wanted to serialize an existing array of model instances, you had to basically hack an existing dataset to do so. This is because the standard to_json method does not pass options given to Array#to_json to the members of the array. ActiveSupport works around this issue by overriding all of the to_json methods, but we can't make the same change here. To work around this issue, have the to_json method just recognize the :array option, and have it use that instead of calling #all to get the array of instances.
…e value is changed This implements similar functionality to ActiveModel::Dirty. It also makes changed_columns more accurate in that it can now detect when the value of a column is changed and then changed back.
…om the results of a query This makes it simple to do a CREATE TABLE AS or equivalent query, taking the results of a SELECT and creating a new table from it. This refactors create_table_sql to call create_table_prefix_sql, which adapters will now override in preference to create_table_sql.