mirror of https://github.com/rails/rails
Remove deprecated methods in ActiveRecord::Base
This commit is contained in:
parent
7a08a86d21
commit
5515fa49a2
|
@ -1,3 +1,19 @@
|
|||
* Remove deprecated `ActiveRecord::Base.clear_active_connections!`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActiveRecord::Base.clear_reloadable_connections!`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActiveRecord::Base.clear_all_connections!`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActiveRecord::Base.flush_idle_connections!`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `name` argument from `ActiveRecord::Base.remove_connection`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
|
|
@ -320,35 +320,7 @@ module ActiveRecord
|
|||
connection_pool.schema_cache.clear!
|
||||
end
|
||||
|
||||
def clear_active_connections!(role = nil)
|
||||
deprecation_for_delegation(__method__)
|
||||
connection_handler.clear_active_connections!(role)
|
||||
end
|
||||
|
||||
def clear_reloadable_connections!(role = nil)
|
||||
deprecation_for_delegation(__method__)
|
||||
connection_handler.clear_reloadable_connections!(role)
|
||||
end
|
||||
|
||||
def clear_all_connections!(role = nil)
|
||||
deprecation_for_delegation(__method__)
|
||||
connection_handler.clear_all_connections!(role)
|
||||
end
|
||||
|
||||
def flush_idle_connections!(role = nil)
|
||||
deprecation_for_delegation(__method__)
|
||||
connection_handler.flush_idle_connections!(role)
|
||||
end
|
||||
|
||||
private
|
||||
def deprecation_for_delegation(method)
|
||||
ActiveRecord.deprecator.warn(<<-MSG.squish)
|
||||
Calling `ActiveRecord::Base.#{method} is deprecated. Please
|
||||
call the method directly on the connection handler; for
|
||||
example: `ActiveRecord::Base.connection_handler.#{method}`.
|
||||
MSG
|
||||
end
|
||||
|
||||
def resolve_config_for_connection(config_or_env)
|
||||
raise "Anonymous class is not allowed." unless name
|
||||
|
||||
|
|
|
@ -111,6 +111,15 @@ Please refer to the [Changelog][active-record] for detailed changes.
|
|||
|
||||
* Remove deprecated `name` argument from `ActiveRecord::Base.remove_connection`.
|
||||
|
||||
* Remove deprecated `ActiveRecord::Base.clear_active_connections!`.
|
||||
|
||||
* Remove deprecated `ActiveRecord::Base.clear_reloadable_connections!`.
|
||||
|
||||
* Remove deprecated `ActiveRecord::Base.clear_all_connections!`.
|
||||
|
||||
* Remove deprecated `ActiveRecord::Base.flush_idle_connections!`.
|
||||
|
||||
|
||||
### Deprecations
|
||||
|
||||
### Notable changes
|
||||
|
|
Loading…
Reference in New Issue