1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

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