diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-17 22:52:55 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-17 22:52:55 +0000 |
commit | 23e58a0552b4febd9372ee4642b0da886d92fd7a (patch) | |
tree | c543dd999b439f814daac060098e5d98758102ee /activerecord/lib | |
parent | 5457770a36deef3047e37b5e5737b3fbc4705b00 (diff) | |
download | rails-23e58a0552b4febd9372ee4642b0da886d92fd7a.tar.gz rails-23e58a0552b4febd9372ee4642b0da886d92fd7a.tar.bz2 rails-23e58a0552b4febd9372ee4642b0da886d92fd7a.zip |
Fix observed_class. References #11099.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/observer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/observer.rb b/activerecord/lib/active_record/observer.rb index 4e801a5843..2b0728fc25 100644 --- a/activerecord/lib/active_record/observer.rb +++ b/activerecord/lib/active_record/observer.rb @@ -153,7 +153,7 @@ module ActiveRecord # The class observed by default is inferred from the observer's class name: # assert_equal Person, PersonObserver.observed_class def observed_class - if observed_class_name = /(.*)Observer/.match(name)[1] + if observed_class_name = name[/(.*)Observer/, 1] observed_class_name.constantize else nil |