bolter 0.3.1 → 0.3.2
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/README.md +20 -2
- data/bolter.gemspec +1 -1
- data/lib/bolter/version.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aee6b2793c3662803bf4dac0de89cadccaba719
|
4
|
+
data.tar.gz: ea0cc67491451dad652aaffe9dea451e1c2a7032
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 224809dd5b1fd24dcf113638797cf2f092dcedffa1e5ade5ce0f4c961c90022ad4f2a6c136dcaf4af47966a0a15cd1c33eb83ade94f75c02bea0dde4ac6becf8
|
7
|
+
data.tar.gz: 53b344f902f7ca7f186f9b0503419e66dbb9c1746f42942d897a53e5deafe5682e4410ffab4b534231bbb7fe4427d88066b012a5a27dac1c106869ec48587223
|
data/README.md
CHANGED
@@ -27,7 +27,6 @@ Model:
|
|
27
27
|
class Book < ActiveRecord::Base
|
28
28
|
include Bolter::Searchable
|
29
29
|
include Bolter::Sortable
|
30
|
-
|
31
30
|
scope :with_author, -> (author) {
|
32
31
|
self.where("author like ?",author)
|
33
32
|
}
|
@@ -52,9 +51,28 @@ View:
|
|
52
51
|
|
53
52
|
Controller:
|
54
53
|
```ruby
|
55
|
-
|
54
|
+
class BooksController < ApplicationController
|
55
|
+
def index
|
56
|
+
@books = Book.search(params[:search]).sorting(params[:sorting])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
```
|
60
|
+
|
61
|
+
Using strong_parameters:
|
62
|
+
```ruby
|
63
|
+
class BooksController < ApplicationController
|
64
|
+
def index
|
65
|
+
@books = Book.search(search_params).sorting(params[:sorting])
|
66
|
+
end
|
67
|
+
private
|
68
|
+
def search_params
|
69
|
+
params.fetch(:search, {}).permit(:with_user)
|
70
|
+
end
|
71
|
+
end
|
56
72
|
```
|
57
73
|
|
74
|
+
|
75
|
+
|
58
76
|
## Development
|
59
77
|
|
60
78
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/bolter.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
|
18
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
18
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
19
19
|
spec.add_development_dependency 'rake', '~> 10.0'
|
20
20
|
spec.add_development_dependency 'activerecord'
|
21
21
|
spec.add_development_dependency 'sqlite3'
|
data/lib/bolter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Shurmin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,4 +153,3 @@ signing_key:
|
|
153
153
|
specification_version: 4
|
154
154
|
summary: This gem include sorting and filtering methods
|
155
155
|
test_files: []
|
156
|
-
has_rdoc:
|