rails-autocomplete 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rails-autocomplete.rb +23 -0
- data/lib/{rails-jquery-autocomplete → rails-autocomplete}/autocomplete.rb +5 -11
- data/lib/{rails-jquery-autocomplete → rails-autocomplete}/form_helper.rb +0 -0
- data/lib/{rails-jquery-autocomplete → rails-autocomplete}/formtastic.rb +1 -1
- data/lib/{rails-jquery-autocomplete → rails-autocomplete}/formtastic_plugin.rb +1 -1
- data/lib/rails-autocomplete/orm.rb +6 -0
- data/lib/{rails-jquery-autocomplete → rails-autocomplete}/orm/active_record.rb +1 -1
- data/lib/{rails-jquery-autocomplete → rails-autocomplete}/rails/engine.rb +1 -1
- data/lib/{rails-jquery-autocomplete → rails-autocomplete}/simple_form_plugin.rb +0 -0
- data/lib/rails-autocomplete/version.rb +3 -0
- data/test/form_helper_test.rb +2 -2
- data/test/lib/{rails-jquery-autocomplete → rails-autocomplete}/autocomplete_test.rb +2 -2
- data/test/lib/{rails-jquery-autocomplete → rails-autocomplete}/orm/active_record_test.rb +2 -2
- data/test/lib/{rails-jquery-autocomplete → rails-autocomplete}/simple_form_plugin_test.rb +1 -1
- data/test/lib/{rails-jquery-autocomplete_test.rb → rails-autocomplete_test.rb} +2 -2
- data/test/test_helper.rb +4 -4
- data/test/view_test_helper.rb +1 -1
- metadata +19 -19
- data/lib/rails-jquery-autocomplete.rb +0 -23
- data/lib/rails-jquery-autocomplete/orm.rb +0 -6
- data/lib/rails-jquery-autocomplete/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2108290b367fae8288d58722cdaac3950d4a15f9
|
4
|
+
data.tar.gz: 8f755e7a8fa7100fcccee6635e4c4b693aa44df3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42b220afa97b27e559bc50a31716c900c009749b08a48f79365caa06ffdd8d96619db519f605a9a4d83815a197f2d0b5e64898549911c4f392963442a685902d
|
7
|
+
data.tar.gz: c6c60975b2c707144cb9fc8537f1a82aa7ab8e2b2fee4b2fcabf05d169339f604de5972056f8f2fd213619590642871b7ab9a66a61f848eab94b5cfecfa93d0b
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rails-autocomplete/form_helper'
|
2
|
+
require 'rails-autocomplete/autocomplete'
|
3
|
+
|
4
|
+
module RailsAutocomplete
|
5
|
+
autoload :Orm , 'rails-autocomplete/orm'
|
6
|
+
autoload :FormtasticPlugin , 'rails-autocomplete/formtastic_plugin'
|
7
|
+
|
8
|
+
unless ::Rails.version < "3.1"
|
9
|
+
require 'rails-autocomplete/rails/engine'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class ActionController::Base
|
14
|
+
include RailsAutocomplete::Autocomplete
|
15
|
+
end
|
16
|
+
|
17
|
+
require 'rails-autocomplete/formtastic'
|
18
|
+
|
19
|
+
begin
|
20
|
+
require 'simple_form'
|
21
|
+
require 'rails-autocomplete/simple_form_plugin'
|
22
|
+
rescue LoadError
|
23
|
+
end
|
@@ -1,12 +1,8 @@
|
|
1
|
-
module
|
1
|
+
module RailsAutocomplete
|
2
2
|
module Autocomplete
|
3
3
|
def self.included(target)
|
4
|
-
target.extend
|
5
|
-
|
6
|
-
target.send :include, RailsJQueryAutocomplete::Orm::Mongoid if defined?(Mongoid::Document)
|
7
|
-
target.send :include, RailsJQueryAutocomplete::Orm::MongoMapper if defined?(MongoMapper::Document)
|
8
|
-
target.send :include, RailsJQueryAutocomplete::Orm::ActiveRecord
|
9
|
-
|
4
|
+
target.extend RailsAutocomplete::Autocomplete::ClassMethods
|
5
|
+
target.send :include, RailsAutocomplete::Orm::ActiveRecord
|
10
6
|
end
|
11
7
|
|
12
8
|
#
|
@@ -41,9 +37,7 @@ module RailsJQueryAutocomplete
|
|
41
37
|
def autocomplete(object, method, options = {}, &block)
|
42
38
|
|
43
39
|
define_method("get_prefix") do |model|
|
44
|
-
|
45
|
-
'active_record'
|
46
|
-
end
|
40
|
+
'active_record'
|
47
41
|
end
|
48
42
|
|
49
43
|
define_method("get_autocomplete_order") do |method, options, model=nil|
|
@@ -63,7 +57,7 @@ module RailsJQueryAutocomplete
|
|
63
57
|
#allow specifying fully qualified class name for model object
|
64
58
|
class_name = options[:class_name] || object
|
65
59
|
items = get_autocomplete_items(:model => get_object(class_name), \
|
66
|
-
|
60
|
+
:options => options, :term => term, :method => method)
|
67
61
|
else
|
68
62
|
items = {}
|
69
63
|
end
|
File without changes
|
File without changes
|
data/test/form_helper_test.rb
CHANGED
@@ -10,7 +10,7 @@ class FormHelperTest < ActionView::TestCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_text_field
|
13
|
-
|
13
|
+
Post.new
|
14
14
|
assert_match(/autocomplete=\"some\/path\"/, text_field(:post, :author, :autocomplete => 'some/path'))
|
15
15
|
end
|
16
16
|
|
@@ -19,7 +19,7 @@ class FormHelperTest < ActionView::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_autocomplete_field
|
22
|
-
|
22
|
+
Post.new
|
23
23
|
assert_match(/data-autocomplete=\"some\/path\"/, autocomplete_field(:post, :author, 'some/path'))
|
24
24
|
end
|
25
25
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
module
|
3
|
+
module RailsAutocomplete
|
4
4
|
class AutocompleteTest < Test::Unit::TestCase
|
5
|
-
include
|
5
|
+
include RailsAutocomplete::Autocomplete
|
6
6
|
|
7
7
|
context 'ClassMethods' do
|
8
8
|
context '#autocomplete' do
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
module
|
3
|
+
module RailsAutocomplete
|
4
4
|
module Orm
|
5
5
|
class ActiveRecordTest < Test::Unit::TestCase
|
6
|
-
include
|
6
|
+
include RailsAutocomplete::Orm::ActiveRecord
|
7
7
|
|
8
8
|
context "#get_autocomplete_order" do
|
9
9
|
context 'order is specified' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
module
|
4
|
-
class
|
3
|
+
module RailsAutocomplete
|
4
|
+
class RailsAutocompleteTest < ActionController::TestCase
|
5
5
|
ActorsController = Class.new(ActionController::Base)
|
6
6
|
ActorsController.autocomplete(:movie, :name)
|
7
7
|
|
data/test/test_helper.rb
CHANGED
@@ -16,18 +16,18 @@ require 'rails/all'
|
|
16
16
|
require 'shoulda'
|
17
17
|
require 'rr'
|
18
18
|
require 'rails/test_help'
|
19
|
-
require 'rails-
|
19
|
+
require 'rails-autocomplete'
|
20
20
|
|
21
|
-
module
|
21
|
+
module RailsAutocomplete
|
22
22
|
class Application < ::Rails::Application
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
RailsAutocomplete::Application.routes.draw do
|
27
27
|
match '/:controller(/:action(/:id))', via: [:get, :post]
|
28
28
|
end
|
29
29
|
|
30
|
-
ActionController::Base.send :include,
|
30
|
+
ActionController::Base.send :include, RailsAutocomplete::Application.routes.url_helpers
|
31
31
|
|
32
32
|
class Test::Unit::TestCase
|
33
33
|
|
data/test/view_test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-autocomplete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Padilla
|
@@ -140,24 +140,24 @@ files:
|
|
140
140
|
- lib/cucumber/autocomplete.rb
|
141
141
|
- lib/generators/autocomplete/install_generator.rb
|
142
142
|
- lib/generators/autocomplete/uncompressed_generator.rb
|
143
|
-
- lib/rails-
|
144
|
-
- lib/rails-
|
145
|
-
- lib/rails-
|
146
|
-
- lib/rails-
|
147
|
-
- lib/rails-
|
148
|
-
- lib/rails-
|
149
|
-
- lib/rails-
|
150
|
-
- lib/rails-
|
151
|
-
- lib/rails-
|
152
|
-
- lib/rails-
|
143
|
+
- lib/rails-autocomplete.rb
|
144
|
+
- lib/rails-autocomplete/autocomplete.rb
|
145
|
+
- lib/rails-autocomplete/form_helper.rb
|
146
|
+
- lib/rails-autocomplete/formtastic.rb
|
147
|
+
- lib/rails-autocomplete/formtastic_plugin.rb
|
148
|
+
- lib/rails-autocomplete/orm.rb
|
149
|
+
- lib/rails-autocomplete/orm/active_record.rb
|
150
|
+
- lib/rails-autocomplete/rails/engine.rb
|
151
|
+
- lib/rails-autocomplete/simple_form_plugin.rb
|
152
|
+
- lib/rails-autocomplete/version.rb
|
153
153
|
- lib/steak/autocomplete.rb
|
154
154
|
- test/form_helper_test.rb
|
155
155
|
- test/generators/autocomplete/install_generator_test.rb
|
156
156
|
- test/generators/autocomplete/uncompressed_generator_test.rb
|
157
|
-
- test/lib/rails-
|
158
|
-
- test/lib/rails-
|
159
|
-
- test/lib/rails-
|
160
|
-
- test/lib/rails-
|
157
|
+
- test/lib/rails-autocomplete/autocomplete_test.rb
|
158
|
+
- test/lib/rails-autocomplete/orm/active_record_test.rb
|
159
|
+
- test/lib/rails-autocomplete/simple_form_plugin_test.rb
|
160
|
+
- test/lib/rails-autocomplete_test.rb
|
161
161
|
- test/test_helper.rb
|
162
162
|
- test/view_test_helper.rb
|
163
163
|
homepage: https://github.com/xpeppers/rails-jquery-autocomplete/
|
@@ -188,9 +188,9 @@ test_files:
|
|
188
188
|
- test/form_helper_test.rb
|
189
189
|
- test/generators/autocomplete/install_generator_test.rb
|
190
190
|
- test/generators/autocomplete/uncompressed_generator_test.rb
|
191
|
-
- test/lib/rails-
|
192
|
-
- test/lib/rails-
|
193
|
-
- test/lib/rails-
|
194
|
-
- test/lib/rails-
|
191
|
+
- test/lib/rails-autocomplete/autocomplete_test.rb
|
192
|
+
- test/lib/rails-autocomplete/orm/active_record_test.rb
|
193
|
+
- test/lib/rails-autocomplete/simple_form_plugin_test.rb
|
194
|
+
- test/lib/rails-autocomplete_test.rb
|
195
195
|
- test/test_helper.rb
|
196
196
|
- test/view_test_helper.rb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'rails-jquery-autocomplete/form_helper'
|
2
|
-
require 'rails-jquery-autocomplete/autocomplete'
|
3
|
-
|
4
|
-
module RailsJQueryAutocomplete
|
5
|
-
autoload :Orm , 'rails-jquery-autocomplete/orm'
|
6
|
-
autoload :FormtasticPlugin , 'rails-jquery-autocomplete/formtastic_plugin'
|
7
|
-
|
8
|
-
unless ::Rails.version < "3.1"
|
9
|
-
require 'rails-jquery-autocomplete/rails/engine'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
class ActionController::Base
|
14
|
-
include RailsJQueryAutocomplete::Autocomplete
|
15
|
-
end
|
16
|
-
|
17
|
-
require 'rails-jquery-autocomplete/formtastic'
|
18
|
-
|
19
|
-
begin
|
20
|
-
require 'simple_form'
|
21
|
-
require 'rails-jquery-autocomplete/simple_form_plugin'
|
22
|
-
rescue LoadError
|
23
|
-
end
|