这些方法是什么以及覆盖它们有多糟糕?
irb(main):001:0> Object::respond_to?('private', true)
=> true
irb(main):002:0> Object::respond_to?('public', true)
=> true
Run Code Online (Sandbox Code Playgroud)
在尝试为模型定义名为private或public的作用域时,Rails会出现此问题.由于修复了错误https://rails.lighthouseapp.com/projects/8994/tickets/4167-activerecord-named_scope-using-columns-as-the-name-is-buggered,现在有很多警告,例如:
Creating scope :public. Overwriting existing method MyModel.public.
Run Code Online (Sandbox Code Playgroud)