-
Notifications
You must be signed in to change notification settings - Fork 210
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
activeadmin 1.3 support #125
Conversation
@@ -2,7 +2,12 @@ class ActiveAdmin::Filters::FormBuilder | |||
|
|||
def filter(method, options = {}) | |||
if method.present? && options[:as] ||= default_input_type(method) | |||
template.concat input(method, options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each branch of if performs the same operation. Could not that line be left as it was?
name = if searchable_has_many_through? | ||
"#{reflection.through_reflection.name}_#{reflection.foreign_key}" | ||
else | ||
reflection.key if reflection_searchable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it would be better if that if oneliner
was actually changed into elsif
as you did it here.
def foreign_methods | ||
@foreign_methods ||= resource_class.reflect_on_all_associations. | ||
select{ |r| r.macro == :belongs_to }. | ||
#reject{ |r| r.chain.length > 2 && !r.options[:polymorphic] }. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comments.
if resource_class.respond_to?(:reflect_on_all_associations) | ||
poly, not_poly = resource_class.reflect_on_all_associations.partition{ |r| r.macro == :belongs_to && r.options[:polymorphic] } | ||
|
||
# remove deeply nested associations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comments.
@AnatolyShirykalov could you squash two of your last commits or at least change commit messages? After that I'm ready to approve. |
0d0b3d7
to
b11db54
Compare
b11db54
to
02bda20
Compare
@AnatolyShirykalov - Please update the readme concerning the AA version number as well. I just realized that there's language in there specifying that the gem will NOT work with AA >1.1, so it'd be good to clear that up. Thanks for this work, it's much appreciated! |
Thank you so much for this work @AnatolyShirykalov! |
No description provided.