aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-20 12:43:12 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-20 12:43:12 -0500
commita30b8d38b41ba9c141e867836a3a9c5b21221bea (patch)
tree02dbda3de620bebf0b11f58615b3c7706bd5a677 /activerecord/lib
parent303448950013444b9f7d71defb4bb503a29eccf2 (diff)
downloadrails-a30b8d38b41ba9c141e867836a3a9c5b21221bea.tar.gz
rails-a30b8d38b41ba9c141e867836a3a9c5b21221bea.tar.bz2
rails-a30b8d38b41ba9c141e867836a3a9c5b21221bea.zip
rename AR::Model::Tag to AR::Tag - fixes #7714
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb6
-rw-r--r--activerecord/lib/active_record/inheritance.rb4
-rw-r--r--activerecord/lib/active_record/model.rb12
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb2
4 files changed, 12 insertions, 12 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
index f42a5df75f..42bd16db80 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -6,7 +6,7 @@ require 'active_support/core_ext/module/deprecation'
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 @@ module ActiveRecord
# 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 @@ module ActiveRecord
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)
diff --git a/activerecord/lib/active_record/inheritance.rb b/activerecord/lib/active_record/inheritance.rb
index 04fff99a6e..35273b0d81 100644
--- a/activerecord/lib/active_record/inheritance.rb
+++ b/activerecord/lib/active_record/inheritance.rb
@@ -50,7 +50,7 @@ module ActiveRecord
# 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 @@ module ActiveRecord
# 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>
#
diff --git a/activerecord/lib/active_record/model.rb b/activerecord/lib/active_record/model.rb
index 44cde49bd5..16d9d404e3 100644
--- a/activerecord/lib/active_record/model.rb
+++ b/activerecord/lib/active_record/model.rb
@@ -26,21 +26,21 @@ module ActiveRecord
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
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb
index 263fdce250..71030cb5d7 100644
--- a/activerecord/lib/active_record/relation/predicate_builder.rb
+++ b/activerecord/lib/active_record/relation/predicate_builder.rb
@@ -40,7 +40,7 @@ module ActiveRecord
#
# 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