Permalink
Browse files

Use Array.wrap to quiet 1.8.8 deprecation

  • Loading branch information...
1 parent 70625ba commit 2538ef0d09954340701354e8fcf57e76c4210416 @jeremy jeremy committed Apr 24, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 activerecord/lib/active_record/fixtures.rb
View
7 activerecord/lib/active_record/fixtures.rb
@@ -3,8 +3,9 @@
require 'csv'
require 'zlib'
require 'active_support/dependencies'
-require 'active_support/core_ext/logger'
+require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/object/blank'
+require 'active_support/core_ext/logger'
if RUBY_VERSION < '1.9'
module YAML #:nodoc:
@@ -868,8 +869,8 @@ def require_fixture_classes(table_names = nil)
end
def setup_fixture_accessors(table_names = nil)
- table_names = [table_names] if table_names && !table_names.respond_to?(:each)
- (table_names || fixture_table_names).each do |table_name|
+ table_names = Array.wrap(table_names || fixture_table_names)
+ table_names.each do |table_name|
table_name = table_name.to_s.tr('.', '_')
define_method(table_name) do |*fixtures|

3 comments on commit 2538ef0

@caseyhoward

This kind of b.s. pisses me off. Like any github user would click on one of those links.

@nmunson

Any way to report as spam on comments like these?

@caseyhoward

Not that I know of. I just posted this: http://support.github.com/discussions/site/2529-spam-account . I see other people reporting spam the same way.

Please sign in to comment.