Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

flatten not needed here

Signed-off-by: wycats <wycats@gmail.com>
  • Loading branch information...
commit 0f18904e2b9b9f43ff439feedd1d74512be89861 1 parent cf7ed7c
@spastorino spastorino authored wycats committed
View
4 activesupport/lib/active_support/core_ext/class/attribute_accessors.rb
@@ -8,7 +8,7 @@
# Person.hair_colors = [:brown, :black, :blonde, :red]
class Class
def cattr_reader(*syms)
- syms.flatten.each do |sym|
+ syms.each do |sym|
next if sym.is_a?(Hash)
class_eval(<<-EOS, __FILE__, __LINE__)
unless defined? @@#{sym} # unless defined? @@hair_colors
@@ -28,7 +28,7 @@ def #{sym} # def hair_colors
def cattr_writer(*syms)
options = syms.extract_options!
- syms.flatten.each do |sym|
+ syms.each do |sym|
class_eval(<<-EOS, __FILE__, __LINE__)
unless defined? @@#{sym} # unless defined? @@hair_colors
@@#{sym} = nil # @@hair_colors = nil
Please sign in to comment.
Something went wrong with that request. Please try again.