Skip to content
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

Merged
merged 5 commits into from
Aug 1, 2018
Merged

Conversation

AnatolyShirykalov
Copy link
Contributor

No description provided.

@grzegorz-jakubiak
Copy link
Collaborator

#120

@@ -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)
Copy link
Collaborator

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?
Copy link
Collaborator

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] }.
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comments.

@grzegorz-jakubiak
Copy link
Collaborator

grzegorz-jakubiak commented Jul 20, 2018

@AnatolyShirykalov could you squash two of your last commits or at least change commit messages? After that I'm ready to approve.

boie0025
boie0025 previously approved these changes Jul 21, 2018
@boie0025 boie0025 dismissed their stale review July 21, 2018 22:08

Readme comment

@boie0025
Copy link
Member

@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!

@boie0025
Copy link
Member

boie0025 commented Aug 1, 2018

Thank you so much for this work @AnatolyShirykalov!

@boie0025 boie0025 merged commit 89bcd52 into activeadmin:master Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants