lib/pupa/models/concerns/identifiable.rb in pupa-0.0.9 vs lib/pupa/models/concerns/identifiable.rb in pupa-0.0.10
- old
+ new
@@ -7,10 +7,15 @@
included do
attr_reader :identifiers
dump :identifiers
end
+ def initialize(*args)
+ @identifiers = IdentifierList.new
+ super
+ end
+
# Sets the identifiers.
#
# @param [Array] identifiers a list of identifiers
def identifiers=(identifiers)
@identifiers = IdentifierList.new(identifiers)
@@ -24,10 +29,10 @@
data = {identifier: identifier}
if scheme
data[:scheme] = scheme
end
if identifier
- (@identifiers ||= []) << data
+ @identifiers << data
end
end
end
end
end