In this post, I don't understand why ActiveRecord::Migration[5.0]
class name doesn't throw a syntax error. Is that a legal ruby grammar? or what hack used with this?
Asked
Active
Viewed 89 times
2 Answers
3
It's perfectly legal - it calls the class method []
for the ActiveRecord::Migration
class. Have a look at the implementation.

eugen
- 8,916
- 11
- 57
- 65
2
[] is a class method of the Migration class
Edit @eugen was a bit quicker than me :-)

JanC
- 345
- 1
- 6
-
Chose @eugen's answer because he is little bit faster. But thank you. :) – Benjamin Mar 23 '16 at 13:29