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 searching on multiple languages. #227

Merged
merged 1 commit into from
Sep 9, 2014

Conversation

monfresh
Copy link
Member

@monfresh monfresh commented Sep 9, 2014

Example:
https://ohana-api-demo.herokuapp.com/api/search?language%5B%5D=Filipino%20(Tagalog)&language%5B%5D=Hindi

This will return locations whose languages field contains either
“Filipino (Tagalog)” OR “Hindi”.

If you've already installed this app and populated your DB with languages, run bin/rake db:migrate to update the DB. This PR converts the
languages field from text to the Postgres Array type.

If for some reason you want to rollback this DB change, you’ll first
need to add the following line in app/models/location.rb:

serialize :languages, Array

Then you can rollback:

bin/rake db:rollback

You’ll then need to update the language search method to its previous
query, and update spec/api/search/language_spec.rb.

Example:
http://ohana-api-demo.herokuapp.com/api/search?language[]=Filipino%20(Ta
galog)&language[]=Hindi

This will return locations whose languages field contain either
“Filipino (Tagalog)” OR “Hindi”.

Run `bin/rake db:migrate` to update the DB. This PR converts the
`languages` field from text to the Postgres Array type.

If for some reason you want to rollback this DB change, you’ll first
need to add the following line in `app/models/location.rb`:
```
serialize :languages, Array
```
Then you can rollback:
```
bin/rake db:rollback
```
You’ll then need to update the `language` search method to its previous
query, and update `spec/api/search/language_spec.rb`.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 28801bd on 104-search-for-many-languages into c1109c9 on master.

monfresh added a commit that referenced this pull request Sep 9, 2014
…ages

Add support for searching on multiple languages.
@monfresh monfresh merged commit ef1d3d1 into master Sep 9, 2014
@monfresh monfresh deleted the 104-search-for-many-languages branch September 9, 2014 14:49
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