prevent adding property to collection/model multiple times

This commit is contained in:
Wesley Beary 2009-11-11 23:18:17 -08:00
parent 3611de077d
commit 50a126335f
2 changed files with 4 additions and 2 deletions

View File

@ -5,7 +5,8 @@ module Fog
class_eval <<-EOS, __FILE__, __LINE__
attr_accessor :#{name}
EOS
attributes << name
@attributes ||= []
@attributes |= [name]
for other_name in [*other_names]
aliases[other_name] = name
end

View File

@ -5,7 +5,8 @@ module Fog
class_eval <<-EOS, __FILE__, __LINE__
attr_accessor :#{name}
EOS
attributes << name
@attributes ||= []
@attributes |= [name]
for other_name in [*other_names]
aliases[other_name] = name
end