7
這些方法是什麼,它們覆蓋它們有多糟?什麼是Ruby中的Object :: private和Object :: public?
irb(main):001:0> Object::respond_to?('private', true)
=> true
irb(main):002:0> Object::respond_to?('public', true)
=> true
當試圖爲模型定義名爲private或public的範圍時,Rails會出現問題。由於更正了BUG 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.