diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 24 | ||||
-rw-r--r-- | activerecord/lib/active_record/callbacks.rb | 17 | ||||
-rw-r--r-- | activerecord/lib/active_record/named_scope.rb | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/validations.rb | 13 |
4 files changed, 3 insertions, 56 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index c3a34ae104..47394de3c1 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -15,7 +15,6 @@ require 'active_support/core_ext/hash/slice' require 'active_support/core_ext/string/behavior' require 'active_support/core_ext/kernel/singleton_class' require 'active_support/core_ext/module/delegation' -require 'active_support/core_ext/module/deprecation' require 'active_support/core_ext/module/introspection' require 'active_support/core_ext/object/duplicable' require 'active_support/core_ext/object/blank' @@ -316,18 +315,6 @@ module ActiveRecord #:nodoc: # a class and instance level by calling +logger+. cattr_accessor :logger, :instance_writer => false - class << self - def reset_subclasses #:nodoc: - ActiveSupport::Deprecation.warn 'ActiveRecord::Base.reset_subclasses no longer does anything in Rails 3. It will be removed in the final release; please update your apps and plugins.', caller - end - - def subclasses - descendants - end - - deprecate :subclasses => :descendants - end - ## # :singleton-method: # Contains the database configuration - as is typically stored in config/database.yml - @@ -429,13 +416,6 @@ module ActiveRecord #:nodoc: self.default_scoping = [] class << self # Class methods - def colorize_logging(*args) - ActiveSupport::Deprecation.warn "ActiveRecord::Base.colorize_logging and " << - "config.active_record.colorize_logging are deprecated. Please use " << - "ActiveRecord::LogSubscriber.colorize_logging or config.colorize_logging instead", caller - end - alias :colorize_logging= :colorize_logging - delegate :find, :first, :last, :all, :destroy, :destroy_all, :exists?, :delete, :delete_all, :update, :update_all, :to => :scoped delegate :find_each, :find_in_batches, :to => :scoped delegate :select, :group, :order, :reorder, :limit, :joins, :where, :preload, :eager_load, :includes, :from, :lock, :readonly, :having, :create_with, :to => :scoped @@ -879,8 +859,8 @@ module ActiveRecord #:nodoc: # It is recommended to use block form of unscoped because chaining unscoped with <tt>named_scope</tt> # does not work. Assuming that <tt>published</tt> is a <tt>named_scope</tt> following two statements are same. # - # Post.unscoped.published - # Post.published + # Post.unscoped.published + # Post.published def unscoped #:nodoc: block_given? ? relation.scoping { yield } : relation end diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index fd71d7db4e..49671a1042 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -246,16 +246,6 @@ module ActiveRecord define_model_callbacks :save, :create, :update, :destroy end - module ClassMethods - def method_added(meth) - super - if CALLBACKS.include?(meth.to_sym) - ActiveSupport::Deprecation.warn("Base##{meth} has been deprecated, please use Base.#{meth} :method instead", caller[0,1]) - send(meth.to_sym, meth.to_sym) - end - end - end - def destroy #:nodoc: _run_destroy_callbacks { super } end @@ -264,13 +254,6 @@ module ActiveRecord _run_touch_callbacks { super } end - def deprecated_callback_method(symbol) #:nodoc: - if respond_to?(symbol, true) - ActiveSupport::Deprecation.warn("Overwriting #{symbol} in your models has been deprecated, please use Base##{symbol} :method_name instead") - send(symbol) - end - end - private def create_or_update #:nodoc: diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index 3de4c40977..6ab84df25b 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -120,11 +120,6 @@ module ActiveRecord singleton_class.send(:redefine_method, name, &scopes[name]) end - def named_scope(*args, &block) - ActiveSupport::Deprecation.warn("Base.named_scope has been deprecated, please use Base.scope instead", caller) - scope(*args, &block) - end - protected def valid_scope_name?(name) diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index b98fd353aa..e4c366ea63 100644 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -53,24 +53,13 @@ module ActiveRecord def valid?(context = nil) context ||= (new_record? ? :create : :update) output = super(context) - - deprecated_callback_method(:validate) - deprecated_callback_method(:"validate_on_#{context}") - errors.empty? && output end protected def perform_validations(options={}) - perform_validation = case options - when Hash - options[:validate] != false - else - ActiveSupport::Deprecation.warn "save(#{options}) is deprecated, please give save(:validate => #{options}) instead", caller - options - end - + perform_validation = options[:validate] != false if perform_validation valid?(options.is_a?(Hash) ? options[:context] : nil) else |