action_crud 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d00252806780a27d33fe1a5e0da095fc3800fc9a
4
- data.tar.gz: 5f474851b6b228f456d0e52c7a8c3598e89b3b8a
3
+ metadata.gz: c51722b57f6ba361a53dd83f5115f8eec9f5000e
4
+ data.tar.gz: 0e1dfbe0fc1601c97d6c3b1af3e9dde57a1e4b00
5
5
  SHA512:
6
- metadata.gz: 419b05fb125bdbf81933f2bbecd47a3e6e9960926b196ebfba20fabb7f3c7615d03dbef53bb77b85a778b2d110ff340ed2198a9fd371e42a2669cb607967be4f
7
- data.tar.gz: d4c84b8008fc65dd9b15d757c33a465774d69738c387848605887bd4fd34437d52ff54df125c19df5ce0ac99dbac19ce16cd0829b2e52cc0d8b2d9a539a9243f
6
+ metadata.gz: 9a7e1bdf41822e1f468687f519a1e3646107c5ef93d9dd6d29243f7ad07c5a2adc5da3f150c4f5225348fc769796dc56f513874efaab76a36c66d87594c4ba53
7
+ data.tar.gz: 9d1a07b99583e942aae7aa6870b850e4dcdd15ad90e8a5d12f2fd1886d6eadffdcea5bdb10fb4b14af65df3776e9f5d788d9cdf9e33bce7c145ed77a58a8e34a
@@ -85,6 +85,7 @@ module ActionCrud
85
85
  # GET /model
86
86
  def index
87
87
  self.records = model.send index_scope
88
+ self.records = model.send(:search, params[:search]) if should_search?
88
89
  self.records = paginate(records) if respond_to? :per_page
89
90
 
90
91
  respond_to do |format|
@@ -207,5 +208,10 @@ module ActionCrud
207
208
 
208
209
  self.permitted_params = Array(attributes)
209
210
  end
211
+
212
+ # Check if model responds to search
213
+ def should_search?
214
+ params[:search].present? and model.respond_to? :search
215
+ end
210
216
  end
211
217
  end
@@ -1,3 +1,3 @@
1
1
  module ActionCrud
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_crud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonian Guveli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-07 00:00:00.000000000 Z
11
+ date: 2017-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -88,7 +88,6 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - Gemfile
91
- - Gemfile.lock
92
91
  - LICENSE.txt
93
92
  - README.md
94
93
  - Rakefile
@@ -120,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
119
  version: '0'
121
120
  requirements: []
122
121
  rubyforge_project:
123
- rubygems_version: 2.6.13
122
+ rubygems_version: 2.6.14
124
123
  signing_key:
125
124
  specification_version: 4
126
125
  summary: Inherited restful actions
data/Gemfile.lock DELETED
@@ -1,64 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- action_crud (0.1.1)
5
- actionpack (~> 5.0)
6
- i18n (~> 0.8)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionpack (5.1.4)
12
- actionview (= 5.1.4)
13
- activesupport (= 5.1.4)
14
- rack (~> 2.0)
15
- rack-test (>= 0.6.3)
16
- rails-dom-testing (~> 2.0)
17
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
- actionview (5.1.4)
19
- activesupport (= 5.1.4)
20
- builder (~> 3.1)
21
- erubi (~> 1.4)
22
- rails-dom-testing (~> 2.0)
23
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
24
- activesupport (5.1.4)
25
- concurrent-ruby (~> 1.0, >= 1.0.2)
26
- i18n (~> 0.7)
27
- minitest (~> 5.1)
28
- tzinfo (~> 1.1)
29
- builder (3.2.3)
30
- concurrent-ruby (1.0.5)
31
- crass (1.0.2)
32
- erubi (1.6.1)
33
- i18n (0.8.6)
34
- loofah (2.1.1)
35
- crass (~> 1.0.2)
36
- nokogiri (>= 1.5.9)
37
- mini_portile2 (2.3.0)
38
- minitest (5.10.3)
39
- nokogiri (1.8.1)
40
- mini_portile2 (~> 2.3.0)
41
- rack (2.0.3)
42
- rack-test (0.7.0)
43
- rack (>= 1.0, < 3)
44
- rails-dom-testing (2.0.3)
45
- activesupport (>= 4.2.0)
46
- nokogiri (>= 1.6)
47
- rails-html-sanitizer (1.0.3)
48
- loofah (~> 2.0)
49
- rake (10.5.0)
50
- thread_safe (0.3.6)
51
- tzinfo (1.2.3)
52
- thread_safe (~> 0.1)
53
-
54
- PLATFORMS
55
- ruby
56
-
57
- DEPENDENCIES
58
- action_crud!
59
- bundler (~> 1.14)
60
- minitest (~> 5.0)
61
- rake (~> 10.0)
62
-
63
- BUNDLED WITH
64
- 1.15.4