diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-13 14:59:09 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:07:42 -0300 |
commit | f0eaf11c0e29e6f30a82b52f7e63d24b9675281f (patch) | |
tree | e687310d616cb3b2017ab9041dfd1089297d1b84 /activerecord/lib/active_record | |
parent | fa11c60b4450394b2f4c048c5379bc9487f477c2 (diff) | |
download | rails-f0eaf11c0e29e6f30a82b52f7e63d24b9675281f.tar.gz rails-f0eaf11c0e29e6f30a82b52f7e63d24b9675281f.tar.bz2 rails-f0eaf11c0e29e6f30a82b52f7e63d24b9675281f.zip |
Use yield instead block argument.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/identity_map.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/identity_map.rb b/activerecord/lib/active_record/identity_map.rb index 79eb4dd83a..c0fab27188 100644 --- a/activerecord/lib/active_record/identity_map.rb +++ b/activerecord/lib/active_record/identity_map.rb @@ -11,19 +11,19 @@ module ActiveRecord repositories[current_repository_name] ||= Weakling::WeakHash.new end - def with_repository(name = :default, &block) + def with_repository(name = :default) old_repository = self.current_repository_name self.current_repository_name = name - block.call(current) + yield if block_given? ensure self.current_repository_name = old_repository end - def without(&block) + def without old, self.enabled = self.enabled, false - block.call + yield if block_given? ensure self.enabled = old end |