Skip to content

Commit

Permalink
support for rails 5.1
Browse files Browse the repository at this point in the history
bumped verison number for new gem release
removed Gemfile.lock from git.
very minor comments and docs cleanup
  • Loading branch information
Justin Tomich committed Mar 27, 2017
1 parent 421adfa commit 2d3f389
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 148 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ spec/dummy/db/*.sqlite3-journal
spec/dummy/log/*.log
spec/dummy/tmp/
spec/dummy/.sass-cache
Gemfile.lock
143 changes: 0 additions & 143 deletions Gemfile.lock

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please use [GitHub Issues] to report bugs. You can contact me directly on twitte
`AutocompleteRails` is a lightweight component with easily understandable, minimal, source code. There are
other autocomplete gems out there that support multiple ORMs and provide client-side javascript, at the cost
of increased complexity. `AutocompleteRails` only supports ActiveRecord, and only provides rails
controller functionality. Client side, you just use jQuery UI's autocomplete widget.
controller functionality. Client side, you use jQuery UI's autocomplete widget, which you wire up yourself.

`AutocompleteRails` supports Rails 4 and Rails 5.

Expand Down Expand Up @@ -65,7 +65,7 @@ Add a route to your `autocomplete` action. For the controller listed above, you

```ruby
resources :posts do
get :autocomplete_user_email, :on => :collection
get :autocomplete_user_email, on: :collection
end
```

Expand Down
2 changes: 1 addition & 1 deletion autocomplete_rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |s|
s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.rdoc']
s.test_files = Dir['test/**/*']

s.add_dependency 'rails', '>= 4.0', '< 5.1'
s.add_dependency 'rails', '>= 4.0', '< 5.2'

s.add_development_dependency 'sqlite3', '~> 1.3'
s.add_development_dependency 'factory_girl', '~> 4.4'
Expand Down
2 changes: 1 addition & 1 deletion lib/autocomplete_rails/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def autocomplete_where_clause(term, model, value_method, options)
table_name = model.table_name
lower = options[:case_sensitive] ? '' : 'LOWER'
["#{lower}(#{table_name}.#{value_method}) LIKE #{lower}(?)", term] # escape default: \ on postgres, mysql, sqlite
# ["#{lower}(#{table_name}.#{value_method}) LIKE #{lower}(?) ESCAPE \"\\\"", term] # use single-quotes, not double
#["#{lower}(#{table_name}.#{value_method}) LIKE #{lower}(?) ESCAPE \"\\\"", term] # use single-quotes, not double
end

def autocomplete_limit_clause(options)
Expand Down
2 changes: 1 addition & 1 deletion lib/autocomplete_rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AutocompleteRails
VERSION = "0.2.0"
VERSION = "0.3.0"
end

0 comments on commit 2d3f389

Please sign in to comment.