Quick question: I want to delegate
a bunch of methods to an association in my model:
z13u_methods = [
:isbn_cleaned,
:oclc_cleaned,
:contents_cleaned,
:summary_cleaned,
:title_statement,
:is_serial?
]
delegate *z13u_methods, :to => :z13u, :prefix => true, :allow_nil => true
This works just fine when I'm running Rails 3.2.13 on Ruby 1.9.3. However, when I run Rails 3.2.13 (the same version) on Ruby 1.8.7, I encounter the following error:
syntax error, unexpected tSYMBEG, expecting tAMPER
delegate *z13u_methods, :to => :z13u, :prefix => true, ...
where the :to
is highlighted.
I guess in Ruby 1.8 the splatted array has to be the final parameters (except for a block name). Is there some other way to to splat an array for this situation?