开发者

difference between self.up and up in rails migration

开发者 https://www.devze.com 2023-04-09 22:59 出处:网络
I have noticed that some tutorials use self.up and self.down for migration methods. I understand that the self keyword indicates the method belo开发者_StackOverflowngs to the instance only, but do the

I have noticed that some tutorials use self.up and self.down for migration methods. I understand that the self keyword indicates the method belo开发者_StackOverflowngs to the instance only, but do they actually make a difference?


This is a change in Rails 3.1 - it used to have to be self.up and self.down, but now there has been a restructuring to allow them to just be up or down, and the associated method "change".

0

精彩评论

暂无评论...
验证码 换一张
取 消