lib/pupa/models/concerns/nameable.rb in pupa-0.0.9 vs lib/pupa/models/concerns/nameable.rb in pupa-0.0.10
- old
+ new
@@ -7,10 +7,15 @@
included do
attr_accessor :other_names
dump :other_names
end
+ def initialize(*args)
+ @other_names = []
+ super
+ end
+
# Adds an alternate or former name.
#
# @param [String] name an alternate or former name
# @param [Date,Time] start_date the date on which the name was adopted
# @param [Date,Time] end_date the date on which the name was abandoned
@@ -25,10 +30,10 @@
end
if note
data[:note] = note
end
if name
- (@other_names ||= []) << data
+ @other_names << data
end
end
end
end
end