smarter_listing 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smarter_listing/controller_extension.rb +15 -1
- data/lib/smarter_listing/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14c8fc302e7de5914dccd5760359da56bf438928
|
4
|
+
data.tar.gz: 51bd55ca78a9c05accafdb0b9d4ebd4c34d1bb56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0caec399dc8bcb698cf2906b6aee3e02f59b1269ed671ffa0bb53bff3917f93912780b8259223e8b61399bd5d7f754a3a43eeb4bfaa4eb7e7924e15d5252896e
|
7
|
+
data.tar.gz: 206b56d738ca0f7f47047f8ee3ad82054f1075edc8238403b2303ed085191449316e1840fb891559ca56cab824cceb2773aa35486b9bf835e316a1b7bc1ceb63
|
@@ -38,6 +38,11 @@ module SmarterListing::ControllerExtension
|
|
38
38
|
render 'smarter_listing/edit'
|
39
39
|
end
|
40
40
|
|
41
|
+
def multi_edit
|
42
|
+
@multi = true
|
43
|
+
edit
|
44
|
+
end
|
45
|
+
|
41
46
|
def update
|
42
47
|
resource.update _resource_params
|
43
48
|
render 'smarter_listing/update'
|
@@ -53,7 +58,16 @@ module SmarterListing::ControllerExtension
|
|
53
58
|
end
|
54
59
|
|
55
60
|
def filtered(model)
|
56
|
-
|
61
|
+
results = model.all
|
62
|
+
unless params[filter_parameter].blank?
|
63
|
+
if model.respond_to?(:search)
|
64
|
+
results = results.search { fulltext "#{params[filter_parameter]}" }.results
|
65
|
+
elsif model.respond_to?(:name)
|
66
|
+
results = results.where("name LIKE ?", "%#{params[filter_parameter]}%")
|
67
|
+
end
|
68
|
+
end
|
69
|
+
results = results.where.not(deleted_at: nil) if params[:show_deleted]
|
70
|
+
results
|
57
71
|
end
|
58
72
|
|
59
73
|
def load_collection
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smarter_listing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Sprauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.4.
|
152
|
+
rubygems_version: 2.4.5
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Smart Listing even smarter (and DRYer)
|
@@ -205,4 +205,3 @@ test_files:
|
|
205
205
|
- test/controllers/listings_controller_test.rb
|
206
206
|
- test/helpers/smarter_listing_loader_test.rb
|
207
207
|
- test/fixtures/listings.yml
|
208
|
-
has_rdoc:
|