3

When working with ruby on rails code, what is the conventional way (or most elegant way) to let rails do nothing? For example when debugging and commenting out a line where there has to be a statement:

begin
  #some_commented_out_function
rescue => e
[...]
end

Is there a dummy function I quickly can put in instead of the commented out line? What is the convention for this?

John Alba
  • 265
  • 2
  • 4
  • 14

1 Answers1

1

Ruby doesn't have a pass or no-op statement. In your example, that code would work as written, with or without a comment.

If you'd like to make it explicit, a line with just nil or a comment explaining the method would probably be considered conventional.

Milo P
  • 1,377
  • 2
  • 31
  • 40