Skip to content
Browse files

rename AR::Model::Tag to AR::Tag - fixes #7714

  • Loading branch information...
1 parent 3034489 commit a30b8d38b41ba9c141e867836a3a9c5b21221bea Francesco Rodriguez committed Sep 20, 2012
View
5 activerecord/CHANGELOG.md
@@ -1,5 +1,10 @@
## Rails 4.0.0 (unreleased) ##
+* Rename `ActiveRecord::Model::Tag` to `ActiveRecord::Tag`.
@frodsan
frodsan added a note Sep 20, 2012

@rafaelfranca I think this entry is bad. AR::Model::Tag doesn't exist in 3-2-stable, so i think i'm not fixing anything. Can you confirm? Thanks :)

@rafaelfranca
Ruby on Rails member
rafaelfranca added a note Sep 20, 2012

Yes. Also ActiveRecord::Tag is not public API. Just remove this entry.

@frodsan
frodsan added a note Sep 20, 2012

Ok, no problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ Fix #7714.
+
+ *Francesco Rodriguez*
+
* `ActiveModel::ForbiddenAttributesProtection` is included by default
in Active Record models. Check the docs of `ActiveModel::ForbiddenAttributesProtection`
for more details.
View
6 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -6,7 +6,7 @@
module ActiveRecord
# Raised when a connection could not be obtained within the connection
# acquisition timeout period: because max connections in pool
- # are in use.
+ # are in use.
class ConnectionTimeoutError < ConnectionNotEstablished
end
@@ -417,7 +417,7 @@ def reap
# queue for a connection to become available.
#
# Raises:
- # - ConnectionTimeoutError if a connection could not be acquired
+ # - ConnectionTimeoutError if a connection could not be acquired
def acquire_connection
if conn = @available.poll
conn
@@ -567,7 +567,7 @@ def retrieve_connection_pool(klass)
class_to_pool[klass] ||= begin
until pool = pool_for(klass)
klass = klass.superclass
- break unless klass < Model::Tag
+ break unless klass < ActiveRecord::Tag
end
class_to_pool[klass] = pool || pool_for(ActiveRecord::Model)
View
4 activerecord/lib/active_record/inheritance.rb
@@ -50,7 +50,7 @@ def symbolized_sti_name
# If B < A and C < B and if A is an abstract_class then both B.base_class
# and C.base_class would return B as the answer since A is an abstract_class.
def base_class
- unless self < Model::Tag
+ unless self < ActiveRecord::Tag
raise ActiveRecordError, "#{name} doesn't belong in a hierarchy descending from ActiveRecord"
end
@@ -73,7 +73,7 @@ def base_class
# class Child < SuperClass
# self.table_name = 'the_table_i_really_want'
# end
- #
+ #
#
# <tt>self.abstract_class = true</tt> is required to make <tt>Child<.find,.create, or any Arel method></tt> use <tt>the_table_i_really_want</tt> instead of a table called <tt>super_classes</tt>
#
View
12 activerecord/lib/active_record/model.rb
@@ -26,21 +26,21 @@ def #{name}; ActiveRecord::Model.#{name}; end
end
end
- # <tt>ActiveRecord::Model</tt> can be included into a class to add Active Record persistence.
- # This is an alternative to inheriting from <tt>ActiveRecord::Base</tt>. Example:
+ # This allows us to detect an ActiveRecord::Model while it's in the process of
+ # being included.
+ module Tag; end
+
+ # <tt>ActiveRecord::Model</tt> can be included into a class to add Active Record
+ # persistence. This is an alternative to inheriting from <tt>ActiveRecord::Base</tt>.
#
# class Post
# include ActiveRecord::Model
# end
- #
module Model
extend ActiveSupport::Concern
extend ConnectionHandling
extend ActiveModel::Observing::ClassMethods
- # This allows us to detect an ActiveRecord::Model while it's in the process of being included.
- module Tag; end
-
def self.append_features(base)
base.class_eval do
include Tag
View
2 activerecord/lib/active_record/relation/predicate_builder.rb
@@ -40,7 +40,7 @@ def self.expand(klass, table, column, value)
#
# For polymorphic relationships, find the foreign key and type:
# PriceEstimate.where(:estimate_of => treasure)
- if klass && value.class < Model::Tag && reflection = klass.reflect_on_association(column.to_sym)
+ if klass && value.class < ActiveRecord::Tag && reflection = klass.reflect_on_association(column.to_sym)
if reflection.polymorphic?
queries << build(table[reflection.foreign_type], value.class.base_class)
end
View
4 activerecord/test/cases/connection_adapters/connection_handler_test.rb
@@ -4,8 +4,8 @@ module ActiveRecord
module ConnectionAdapters
class ConnectionHandlerTest < ActiveRecord::TestCase
def setup
- @klass = Class.new { include Model::Tag }
- @subklass = Class.new(@klass) { include Model::Tag }
+ @klass = Class.new { include ActiveRecord::Tag }
+ @subklass = Class.new(@klass) { include ActiveRecord::Tag }
@handler = ConnectionHandler.new
@handler.establish_connection @klass, Base.connection_pool.spec

0 comments on commit a30b8d3

Please sign in to comment.
Something went wrong with that request. Please try again.