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

Fix handling attribute-name with _and_ _or_ #562

Conversation

hoshitocat
Copy link
Contributor

This PR tries to resolve #299

I think Ransack must recognize attribute_name which includes _and_ _or_.

My approach is:
If the model includes attribute_name, Ransack should recognize it as one attribute_name.

Please feedback this PR !!

@@ -31,14 +31,18 @@ def extract(context, key, values)

private

def extract_attributes_and_predicate(key)
def extract_attributes_and_predicate(key, context=nil)

Choose a reason for hiding this comment

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

Surrounding space missing in default value assignment.

@jonatack
Copy link
Contributor

Thanks @hoshitocat! Looks good to me. Could you update the change log with this fix?

jonatack added a commit that referenced this pull request Jul 12, 2015
Fix handling attribute-name with `_and_` `_or_`
@jonatack jonatack merged commit 3a3f8a3 into activerecord-hackery:master Jul 12, 2015
@hoshitocat
Copy link
Contributor Author

Thank you @jonatack !!
I'm happy to merge PR :)
I will udate CHANGELOG.md soon.

hoshitocat added a commit to hoshitocat/ransack that referenced this pull request Jul 12, 2015
hoshitocat added a commit to hoshitocat/ransack that referenced this pull request Jul 12, 2015
jonatack added a commit that referenced this pull request Jul 13, 2015
jonatack added a commit that referenced this pull request Jul 18, 2015
Completes PRs #562, #498, #426, #560 and #537 among others.
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.

Ransack doesn't handle attribute names including "and" / "or"
3 participants