module ActiveRecord::ActsAs::ScopeForCreate

Public Instance Methods

scope_for_create(attributes = nil) click to toggle source
Calls superclass method
# File lib/active_record/acts_as/querying.rb, line 30
def scope_for_create(attributes = nil)
  return super() unless acting_as?

  scope = respond_to?(:values_for_create) ? values_for_create(attributes) : where_values_hash
  scope.merge!(where_values_hash(acting_as_model.table_name))
  scope.merge!(attributes) if attributes
  scope.merge(create_with_value)
end