Revision 50460df2
Added by Marc Dequènes over 14 years ago
- ID 50460df261292cc4d1d4459e6ac6273c4813486c
lib/cyborghood/mail_order.rb | ||
---|---|---|
super(user, command_lines, shared_parameters) do |word, errors, used_refs|
|
||
if word =~ /^@([a-zA-Z0-9._-]+)$/
|
||
ref = $1
|
||
param = ParameterReference.new(ref)
|
||
d_ref, d_param = dereference_param(shared_parameters, param)
|
||
if d_ref.nil?
|
||
errors << _("Attachment '%{ref}' not found.", :ref => ref)
|
lib/cyborghood/order.rb | ||
---|---|---|
new(:user => user, :commands => commands, :shared_parameters => shared_parameters)
|
||
end
|
||
|
||
def dereference_param(shared_parameters, param)
|
||
def self.dereference_param(shared_parameters, param, ref = nil)
|
||
if param.is_a? SharedParameter
|
||
[ref, ParameterReference(ref)]
|
||
[ref, ParameterReference.new(ref)]
|
||
elsif param.is_a? ParameterReference
|
||
d_ref = param.reference
|
||
d_param = shared_parameters[d_ref]
|
||
return dereference_param(shared_parameters, d_param)
|
||
return dereference_param(shared_parameters, d_param, d_ref)
|
||
else
|
||
nil
|
||
end
|
Also available in: Unified diff
[fix] Order management was broken