-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is add_to_list_bottom
private?
#187
Comments
add_to_list_bottom
add_to_list_bottom
private?
I'm not sure to be fair. Given it's all mixed into your class, you could still use it within your model without problems right? An item will automatically be added to the list (based on your configured scope) automatically. Wether it's bottom or top is configurable. I find with acts_as_list, your best bet is to peruse the actual source code. It's just one file and is a bit more enlightening than the README in some instances: https://github.com/swanandp/acts_as_list/blob/master/lib/acts_as_list/active_record/acts/list.rb |
@brendon the only way to invoke it from outside of the object is by using |
Hi @kyledecot, aal's default behaviour it to add an item to the bottom of the list when it is persisted to the database. There is the I wouldn't be confident accepting a pull request for making those methods public without others chiming in on this. I'm sure there was a good reason for it in the past. |
|
@kyledecot, I meant a public method :) I've had a look back. The methods have always been private (since 2007 when the code was committed). They're used internally when saving a new instance in order to add that instance to the list. Can you give a use-case for using the method externally? I understand your frustration, bear with me while I do due diligence on this. |
Just curious as to why
add_to_list_bottom
is a private method? What's the proper way to add an item to a list?The text was updated successfully, but these errors were encountered: