What is Object::private and Object::public in Ruby? -


what these methods , how bad override them?

irb(main):001:0> object::respond_to?('private', true) => true  irb(main):002:0> object::respond_to?('public', true) => true 

the problem comes in rails when trying define scope named private or public model. because of fix bug https://rails.lighthouseapp.com/projects/8994/tickets/4167-activerecord-named_scope-using-columns-as-the-name-is-buggered there's lot of warnings like:

creating scope :public. overwriting existing method mymodel.public. 

the public , private methods ruby's access modifiers.

basically, when this:

class example   public    def   end    private    def something_else   end end 

the public , private keywords not keywords @ all, they're method calls. i'm pretty sure it's not idea override them, i'd name scopes in other way.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -