Possible Duplicate:
naked asterisk as parameter in method definition: def f(*)
Accessing a value in a method using *
The save(*) method in Rails takes just a single asterisk as an argument.
I know that * can be used for variable length arguments as in *args, but what does the * mean in this context? How does one access the arguments here?
And more specifically, how would one pass all the arguments on to a super call?
In this specific case,
savedoesn’t take any arguments. That’s what happens with a naked splat. But, as you may be aware, callingsaveon an ActiveRecord model accepts options because this method gets overridden byActiveRecord::Validationshere:https://github.com/rails/rails/blob/v3.1.3/activerecord/lib/active_record/validations.rb#L47