searchlight 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/TODO.md +1 -4
- data/lib/searchlight.rb +3 -1
- data/lib/searchlight/adapters/action_view.rb +10 -17
- data/lib/searchlight/version.rb +1 -1
- data/spec/searchlight/adapters/action_view_spec.rb +2 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6535dc6c570b01a67e7a25a51819bd57c155abb5
|
4
|
+
data.tar.gz: 6741f5d2dd6a1bc93641263848b926662df22307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06768634ad235bb9b45fe93ceaf2f5d1a07fcfc016f396d1fa70b727721ac802ac8956869bcc2715539b413f6b22126e614a9042277b2bfe04c80af213d2fe9f
|
7
|
+
data.tar.gz: 4350283762d804a7c1747b49815598f5b17eddd28ca8ee591ad0857ace1f578099d57d8e1f517d03cacbaf18cda126ab04e1a6d37eeb2eb5d7636cfa028f74a6
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
Searchlight does its best to use [semantic versioning](http://semver.org).
|
4
4
|
|
5
|
+
## v3.0.0
|
6
|
+
|
7
|
+
Two major releases in two days!? Well, I thought of another good, but breaking, change. To the major version bump, Robin!
|
8
|
+
|
9
|
+
Inputs generated using `ActionView` forms are now named after your search form. Eg, the form for 'UserSearch' will submit parameters under 'user_search', not just 'search'. This makes the code more standard and namespaces the form, in case, eg, you want to have two forms on the same page.
|
10
|
+
|
11
|
+
Note that to upgrade, Rails users will need to change references to `params[:search]` to something like `params[:user_search]` (depending on name of the search class).
|
12
|
+
|
5
13
|
## v2.0.0
|
6
14
|
|
7
15
|
Now with fewer features! :D
|
data/TODO.md
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
# TODO
|
2
2
|
|
3
|
-
-
|
4
|
-
- Run rcov and mutant
|
3
|
+
- Do some mutation testing
|
5
4
|
- Make nice Github page
|
6
|
-
- Test with ActiveRecord 4
|
7
|
-
- Add more complex example searches to show where Searchlight shines. Eg: for a given disease, find people who've traveled in a given time period and visited countries that had an outbreak of that disease during their visit.
|
data/lib/searchlight.rb
CHANGED
@@ -1,30 +1,23 @@
|
|
1
|
+
require 'action_view'
|
2
|
+
require 'active_model'
|
3
|
+
require 'active_support/core_ext'
|
4
|
+
|
1
5
|
module Searchlight
|
2
6
|
module Adapters
|
3
7
|
module ActionView
|
4
8
|
|
5
|
-
|
6
|
-
|
7
|
-
def model_name
|
8
|
-
::ActiveModel::Name.new(self, nil, 'search')
|
9
|
-
end
|
9
|
+
include ::ActiveModel::Conversion
|
10
10
|
|
11
|
+
def self.included(target)
|
12
|
+
target.extend ::ActiveModel::Naming
|
11
13
|
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
def to_key
|
16
|
-
[]
|
17
|
-
end
|
18
|
-
|
19
|
-
def persisted?
|
20
|
-
false
|
21
|
-
end
|
22
|
-
|
15
|
+
def persisted?
|
16
|
+
false
|
23
17
|
end
|
24
18
|
|
25
19
|
end
|
26
20
|
end
|
27
21
|
end
|
28
22
|
|
29
|
-
Searchlight::Search.send(:include, Searchlight::Adapters::ActionView
|
30
|
-
Searchlight::Search.extend(Searchlight::Adapters::ActionView::ClassMethods)
|
23
|
+
Searchlight::Search.send(:include, Searchlight::Adapters::ActionView)
|
data/lib/searchlight/version.rb
CHANGED
@@ -6,10 +6,8 @@ describe 'Searchlight::Adapters::ActionView', type: :feature, adapter: true do
|
|
6
6
|
let(:search) { AccountSearch.new(paid_amount: 15) }
|
7
7
|
|
8
8
|
before :all do
|
9
|
+
# Only required when running these tests
|
9
10
|
require 'searchlight/adapters/action_view'
|
10
|
-
require 'action_view'
|
11
|
-
require 'active_model'
|
12
|
-
require 'active_support/core_ext'
|
13
11
|
end
|
14
12
|
|
15
13
|
before :each do
|
@@ -21,7 +19,7 @@ describe 'Searchlight::Adapters::ActionView', type: :feature, adapter: true do
|
|
21
19
|
f.text_field(:paid_amount)
|
22
20
|
end
|
23
21
|
|
24
|
-
expect(form).to have_selector("form input[name='
|
22
|
+
expect(form).to have_selector("form input[name='account_search[paid_amount]'][value='15']")
|
25
23
|
end
|
26
24
|
|
27
25
|
it "tells the form that it is not persisted" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: searchlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Long
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: named
|