From 2d3f3899af3846666eb191be95fb949ae3ec13a1 Mon Sep 17 00:00:00 2001 From: Justin Tomich Date: Sun, 26 Mar 2017 17:50:48 -0700 Subject: [PATCH] support for rails 5.1 bumped verison number for new gem release removed Gemfile.lock from git. very minor comments and docs cleanup --- .gitignore | 1 + Gemfile.lock | 143 --------------------------- README.md | 4 +- autocomplete_rails.gemspec | 2 +- lib/autocomplete_rails/controller.rb | 2 +- lib/autocomplete_rails/version.rb | 2 +- 6 files changed, 6 insertions(+), 148 deletions(-) delete mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 50672ec..3f99c1c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ spec/dummy/db/*.sqlite3-journal spec/dummy/log/*.log spec/dummy/tmp/ spec/dummy/.sass-cache +Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 9fef9aa..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,143 +0,0 @@ -PATH - remote: . - specs: - autocomplete_rails (0.1.0) - rails (>= 4.0, < 5.1) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.2.6) - actionpack (= 4.2.6) - actionview (= 4.2.6) - activejob (= 4.2.6) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.6) - actionview (= 4.2.6) - activesupport (= 4.2.6) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.6) - activesupport (= 4.2.6) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.6) - activesupport (= 4.2.6) - globalid (>= 0.3.0) - activemodel (4.2.6) - activesupport (= 4.2.6) - builder (~> 3.1) - activerecord (4.2.6) - activemodel (= 4.2.6) - activesupport (= 4.2.6) - arel (~> 6.0) - activesupport (4.2.6) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - arel (6.0.3) - builder (3.2.2) - concurrent-ruby (1.0.2) - database_cleaner (1.5.3) - diff-lcs (1.2.5) - erubis (2.7.0) - factory_girl (4.7.0) - activesupport (>= 3.0.0) - globalid (0.3.6) - activesupport (>= 4.1.0) - i18n (0.7.0) - json (1.8.3) - loofah (2.0.3) - nokogiri (>= 1.5.9) - mail (2.6.4) - mime-types (>= 1.16, < 4) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.0.0) - minitest (5.9.0) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) - rack (1.6.4) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.2.6) - actionmailer (= 4.2.6) - actionpack (= 4.2.6) - actionview (= 4.2.6) - activejob (= 4.2.6) - activemodel (= 4.2.6) - activerecord (= 4.2.6) - activesupport (= 4.2.6) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.6) - sprockets-rails - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - railties (4.2.6) - actionpack (= 4.2.6) - activesupport (= 4.2.6) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (11.1.2) - rspec-core (3.4.4) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.2) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) - shoulda-matchers (2.8.0) - activesupport (>= 3.0.0) - sprockets (3.6.0) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.0.4) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.3.11) - thor (0.19.1) - thread_safe (0.3.5) - timecop (0.8.1) - tzinfo (1.2.2) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - autocomplete_rails! - database_cleaner (~> 1.5) - factory_girl (~> 4.4) - rspec-mocks (~> 3.1) - rspec-rails (~> 3.1) - shoulda-matchers (~> 2.8) - sqlite3 (~> 1.3) - timecop (~> 0.8) - -BUNDLED WITH - 1.11.2 diff --git a/README.md b/README.md index 51faab6..7fc179e 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 ``` diff --git a/autocomplete_rails.gemspec b/autocomplete_rails.gemspec index 51feb74..723e93f 100644 --- a/autocomplete_rails.gemspec +++ b/autocomplete_rails.gemspec @@ -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' diff --git a/lib/autocomplete_rails/controller.rb b/lib/autocomplete_rails/controller.rb index 776adcb..b8ec8af 100644 --- a/lib/autocomplete_rails/controller.rb +++ b/lib/autocomplete_rails/controller.rb @@ -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) diff --git a/lib/autocomplete_rails/version.rb b/lib/autocomplete_rails/version.rb index 1c9594b..01231a5 100644 --- a/lib/autocomplete_rails/version.rb +++ b/lib/autocomplete_rails/version.rb @@ -1,3 +1,3 @@ module AutocompleteRails - VERSION = "0.2.0" + VERSION = "0.3.0" end