Permalink
Browse files

Merge pull request #15718 from chancancode/regression_from_15694

Fixed a regression introduced in 84cf156
  • Loading branch information...
chancancode committed Jul 16, 2014
2 parents d4df7ce + dd1ec62 commit a00f547d2b83f95d169050a2b25afa196d0a9205
Showing with 10 additions and 1 deletion.
  1. +5 −0 activerecord/lib/active_record/core.rb
  2. +5 −1 activerecord/test/cases/attribute_methods_test.rb
@@ -107,6 +107,11 @@ def self.connection_handler=(handler)
end
module ClassMethods
def allocate
define_attribute_methods
super
end
def initialize_find_by_cache
self.find_by_statement_cache = {}.extend(Mutex_m)
end
@@ -143,7 +143,11 @@ def test_id_before_type_cast_with_custom_primary_key
# Syck calls respond_to? before actually calling initialize
def test_respond_to_with_allocated_object
topic = Topic.allocate
klass = Class.new(ActiveRecord::Base) do
self.table_name = 'topics'
end
topic = klass.allocate
assert !topic.respond_to?("nothingness")
assert !topic.respond_to?(:nothingness)
assert_respond_to topic, "title"

0 comments on commit a00f547

Please sign in to comment.