Module: Sequel::Plugins::PreparedStatementsSafe::InstanceMethods

Defined in:
lib/sequel/plugins/prepared_statements_safe.rb

Instance Method Summary collapse

Instance Method Details

#before_createObject

Merge the current values into the default values to reduce the number of free columns.



68
69
70
71
72
73
# File 'lib/sequel/plugins/prepared_statements_safe.rb', line 68

def before_create
  if v = model.prepared_statements_column_defaults
    @values = Hash[v].merge!(values)
  end
  super
end

#save_changes(opts = OPTS) ⇒ Object

Always do a full save of all columns to reduce the number of prepared statements that can be used.



77
78
79
# File 'lib/sequel/plugins/prepared_statements_safe.rb', line 77

def save_changes(opts=OPTS)
  save(opts) || false if modified?
end