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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65186b25b4e980a5da42504b6a4342a7f5ac4e35
4
- data.tar.gz: 635075781bdb1d963ca439b8a10d8ff72eca851f
3
+ metadata.gz: 14c8fc302e7de5914dccd5760359da56bf438928
4
+ data.tar.gz: 51bd55ca78a9c05accafdb0b9d4ebd4c34d1bb56
5
5
  SHA512:
6
- metadata.gz: eb3e2b36e03b8fceee26683a5ff9acc9a8677fdd0d3b022a59011197ff47c4b4f9be8d21264575e87e58ffe919593877f6af05c53195e53808bb2e8c943aac1e
7
- data.tar.gz: 85a410ff7560c110640c53ecd57208a251dc3b0b728aa2164a1a81f55e6b7bf825aaac0a0aef19b21170f706aa5652f8537027228184c86ef91005a40ed9cd86
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
- (!params[filter_parameter].blank?) ? model.search { fulltext "#{params[filter_parameter]}" }.results : model.all
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
@@ -1,3 +1,3 @@
1
1
  module SmarterListing
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
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.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: 2014-11-15 00:00:00.000000000 Z
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.1
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: