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

Add support for attribute alias #592

Closed
wants to merge 1 commit into from
Closed

Add support for attribute alias #592

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 23, 2015

See #589

ransackable_attributes += attribute_aliases.keys
end

ransackable_attributes
end
Copy link
Contributor

Choose a reason for hiding this comment

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

We could probably just inline the values here without memoizing to a local var:

def ransackable_attributes(auth_object = nil)
  if Ransack::SUPPORTS_ATTRIBUTE_ALIAS
    column_names + _ransackers.keys + attribute_aliases.keys
  else
    column_names + _ransackers.keys
  end
end

@jonatack
Copy link
Contributor

Thanks! This looks pretty good. Can you let me know for the question above?

@ghost
Copy link
Author

ghost commented Sep 24, 2015

Inlined the things in the ransackable_attributes method.

@jonatack
Copy link
Contributor

Thanks! 🍏 Merged here.

@jonatack jonatack closed this Sep 25, 2015
@jonatack
Copy link
Contributor

Would you like to make a PR to update the change log?

@ghost
Copy link
Author

ghost commented Sep 25, 2015

@jonatack: see #594

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.

2 participants