El día 12 de mayo de 2010 19:32, Chad DePue <[email protected]> escribió: > he tenido problemas con named_scopes con lambdas porque el syntax es > diferente, y hasta ahora tengo que apoyar los dos: > if RUBY_VERSION.to_f >= 1.9 > # NOTE: must be eval because the following line fails to parse in 1.8.X > eval "named_scope :foo, ->(lim = DEFAULT_LIMIT){ { :limit => lim }}" > else > named_scope :foo, lambda{ |lim| { :limit => lim || DEFAULT_LIMIT }} > end
Que extraño, que ocurre con la 2da versión cuando usas 1.9? _______________________________________________ Ruby mailing list [email protected] http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
