-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Assume unknown db column types are un-searchable #193
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
||
expect(dashboard).to contain("name: Field::String,") | ||
expect(dashboard).to contain("email: Field::String,") | ||
expect(attrs[:ip_address]).to eq(Administrate::Field::String.with_options(searchable: false)) |
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.
Line is too long. [103/80]
Yep, we faced this just a moment ago. Good work. |
This LGTM. 🚀 |
Closes #178 Problem: If users have a database set up with unknown column types, Administrate treats those columns as a string. This can cause bugs when users try to search, because the unknown database column might not support the string search operator. Solution: - Add a `searchable` option to all field types, which specifies whether it is one of the resource's plaintext search fields. - For unknown db column types, give the field a default option of `searchable: false`.
c-lliope
force-pushed
the
gw-default-field
branch
from
November 9, 2015 18:34
a3aef16
to
ae5f3ba
Compare
c-lliope
added a commit
that referenced
this pull request
Nov 12, 2015
- Update gem version - Update README with recommended optimistic versioning for bundler - Update README with warning about Administrate's pre-1.0 status - Update CHANGELOG to fill in missing PR references - sort CHANGELOG entries according to change type Changes: ``` * [#191] [CHANGE] Improve API for specifying how resources are displayed across the dashboard. * Models are now displayed with a sensible default - (e.g. "User #2") * Users can define `ModelDashboard#display_resource(resource)` for custom display behavior * Users who have generated views for the following field types may need to update them to take advantage of the new API: * HasOne * HasMany * Polymorphic * BelongsTo * [#223] [FEATURE] Translation: Vietnamese * [#161] [FEATURE] Translation: Mandarin Chinese * [#196] [FEATURE] Translation: Taiwanese Mandarin * [#142] [FEATURE] Translation: Brazilian Portuguese * [#171] [FEATURE] Translation: Polish * [#153] [FEATURE] Translation: Russian * [#148] [FEATURE] Translation: French * [#147] [FEATURE] Translation: German * [#154] [FEATURE] Translation: Spanish * [#126] [UI] Preserve whitespace when rendering text fields * [#194] [BUGFIX] Don't clear out datetime values in form fields * [#193] [BUGFIX] Don't assume that unrecognized db column types are searchable * [#124] [BUGFIX] Better detection of application models * [#156] [COMPAT] Include missing `sass-rails` dependency in gemspec * [#174] [COMPAT] Make several missing dependencies explicit. * [#144] [COMPAT] Update repository structure so Bundler can pull the gem from github. (e.g. `gem "administrate", github: "thoughtbot/administrate"`) * [#166] [COMPAT] Use ANSI SQL standards for case-insensitive search * [#120] [DOC] Add Rubygems version badge to README * [#165] [DOC] Add CircleCI badge to README * [#119] [DOC] Add CodeClimate badge to README ```
c-lliope
added a commit
that referenced
this pull request
Nov 12, 2015
- Update gem version - Update README with recommended optimistic versioning for bundler - Update README with warning about Administrate's pre-1.0 status - Update CHANGELOG to fill in missing PR references - add `[I18n]` category to CHANGELOG - sort CHANGELOG entries according to change type Changes: * [#191] [CHANGE] Improve API for specifying how resources are displayed across the dashboard. * Models are now displayed with a sensible default - (e.g. "User #2") * Users can define `ModelDashboard#display_resource(resource)` for custom display behavior * Users who have generated views for the following field types may need to update them to take advantage of the new API: * HasOne * HasMany * Polymorphic * BelongsTo * [#223] [FEATURE] Translation: Vietnamese * [#161] [FEATURE] Translation: Mandarin Chinese * [#196] [FEATURE] Translation: Taiwanese Mandarin * [#142] [FEATURE] Translation: Brazilian Portuguese * [#171] [FEATURE] Translation: Polish * [#153] [FEATURE] Translation: Russian * [#148] [FEATURE] Translation: French * [#147] [FEATURE] Translation: German * [#154] [FEATURE] Translation: Spanish * [#126] [UI] Preserve whitespace when rendering text fields * [#194] [BUGFIX] Don't clear out datetime values in form fields * [#193] [BUGFIX] Don't assume that unrecognized db column types are searchable * [#124] [BUGFIX] Better detection of application models * [#156] [COMPAT] Include missing `sass-rails` dependency in gemspec * [#174] [COMPAT] Make several missing dependencies explicit. * [#144] [COMPAT] Update repository structure so Bundler can pull the gem from github. (e.g. `gem "administrate", github: "thoughtbot/administrate"`) * [#166] [COMPAT] Use ANSI SQL standards for case-insensitive search * [#120] [DOC] Add Rubygems version badge to README * [#165] [DOC] Add CircleCI badge to README * [#119] [DOC] Add CodeClimate badge to README
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #178
Problem:
If users have a database set up with unknown column types,
Administrate treats those columns as a string.
This can cause bugs when users try to search,
because the unknown database column might not support
the string search operator.
Solution:
searchable
option to all field types,which specifies whether it is one of
the resource's plaintext search fields.
a default option of
searchable: false
.