Permalink
Browse files

Fixed deprecation warning in Rails3 about using returning vs tap (req…

…uires ruby 1.8.7)

Fixed deprecation warnings in Rails3 about using RAILS_ROOT
  • Loading branch information...
1 parent 83c4474 commit 717e0d8075cd6455da82e55295d9e2d413bda978 @wolfmanjm wolfmanjm committed Dec 6, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/fixture_replacement/attribute_builder.rb
  2. +1 −1 lib/fixture_replacement/class_methods.rb
@@ -47,7 +47,7 @@ def active_record_class
end
def instantiate(hash_to_merge = {}, instance = active_record_class.new)
- returning instance do
+ instance.tap do
instantiate_parent_fixture(instance)
call_attribute_body(instance, hash_to_merge)
add_given_keys(instance, hash_to_merge)
@@ -17,7 +17,7 @@ def random_string(length=10)
end
def load_example_data
- load "#{rails_root}/db/example_data.rb"
+ load "#{::Rails.root.to_s}/db/example_data.rb"
rescue LoadError
# no-op. If the file is not found, don't panic
end

0 comments on commit 717e0d8

Please sign in to comment.