scaffolding_extensions 1.4.5 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -24,12 +24,12 @@ Scaffolding Extensions currently supports:
24
24
  * Rails 3.0.0
25
25
  * Ramaze 2010.06.18
26
26
  * Camping 2.1
27
- * Sinatra 1.0
27
+ * Sinatra 1.1.0
28
28
  * Merb 1.0.4
29
- * Rack 1.1.0
29
+ * Rack 1.2.1
30
30
  * Object Relational Mappers
31
31
  * ActiveRecord 3.0.0
32
- * Sequel 3.16.0
32
+ * Sequel 3.19.0
33
33
  * DataMapper 1.0 (see doc/datamapper.txt for details)
34
34
  * Javascript Libaries (used for Ajax/Autocompleting)
35
35
  * Prototype 1.6.0.3
@@ -427,8 +427,15 @@ module ScaffoldingExtensions::MetaModel
427
427
  # Returns a completely blank object suitable for searching, updated with the given attributes.
428
428
  def scaffold_search_object(attributes = {})
429
429
  object = new
430
+
431
+ # Blank any fields set by default
430
432
  scaffold_attributes(:search).each{|field| object.send("#{field}=", nil) unless object.send(field) == nil}
431
- scaffold_set_attributes(object, attributes)
433
+
434
+ # Don't set any fields left blank by the user
435
+ h = {}
436
+ attributes.each{|k,v| h[k] = v unless v.blank?}
437
+
438
+ scaffold_set_attributes(object, h)
432
439
  object
433
440
  end
434
441
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffolding_extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 5
10
- version: 1.4.5
9
+ - 6
10
+ version: 1.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Evans
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-07 01:00:00 -07:00
18
+ date: 2011-01-21 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21