module Sequel::Plugins::MssqlOptimisticLocking::InstanceMethods
Private Instance Methods
Source
# File lib/sequel/plugins/mssql_optimistic_locking.rb 48 def _save_update_all_columns_hash 49 v = super 50 v.delete(model.lock_column) 51 v 52 end
Remove the lock column from the columns to update. SQL
Server automatically updates the lock column value, and does not like it to be assigned.
Calls superclass method
Source
# File lib/sequel/plugins/mssql_optimistic_locking.rb 55 def _update_without_checking(columns) 56 ds = _update_dataset 57 lc = model.lock_column 58 rows = ds.clone(ds.send(:default_server_opts, :sql=>ds.output(nil, [Sequel[:inserted][lc]]).update_sql(columns))).all 59 values[lc] = rows.first[lc] unless rows.empty? 60 rows.length 61 end
Add an OUTPUT clause to fetch the updated timestamp when updating the row.
Source
# File lib/sequel/plugins/mssql_optimistic_locking.rb 41 def lock_column_instance_filter_value 42 Sequel.blob(super) 43 end
Make the instance filter value a blob.
Calls superclass method