Skip to content

Commit

Permalink
changed the old to_a to Array() due to deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
bastien committed Jul 30, 2009
1 parent 07c1fb9 commit a7a6356
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/to_csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ def to_csv(options = {})
attributes = self.first.attributes.keys.collect { |c| c.to_sym }

if options[:only]
columns = options[:only].to_a & attributes
columns = Array(options[:only]) & attributes
else
columns = attributes - options[:except].to_a
columns = attributes - Array(options[:except])
end

columns += options[:methods].to_a
columns += Array(options[:methods])

return '' if columns.empty?

Expand Down

0 comments on commit a7a6356

Please sign in to comment.