This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ActiveRecord::Validations::ClassMethods | |
| def validates_uniqueness_of(*attr_names) | |
| configuration = { :case_sensitive => true } | |
| configuration.update(attr_names.extract_options!) | |
| validates_each(attr_names,configuration) do |record, attr_name, value| | |
| # The check for an existing value should be run from a class that | |
| # isn't abstract. This means working down from the current class | |
| # (self), to the first non-abstract class. Since classes don't know | |
| # their subclasses, we have to build the hierarchy between self and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ActiveRecord::Batches | |
| def find_in_batches(options = {}) | |
| relation = self | |
| unless arel.orders.blank? && arel.taken.blank? | |
| ActiveRecord::Base.logger.warn("Scoped order and limit are ignored, it's forced to be batch order and batch size") | |
| end | |
| if (finder_options = options.except(:start, :batch_size)).present? | |
| raise "You can't specify an order, it's forced to be #{batch_order}" if options[:order].present? |
NewerOlder