attr_bucket 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,7 +41,7 @@ module AttrBucket
41
41
  def assign_multiparameter_attributes_with_attr_bucket(pairs)
42
42
  bucket_pairs = pairs.select {|p| self.class.bucketed_attributes.include?(p.first.split('(').first)}
43
43
  extract_callstack_for_multiparameter_attributes(bucket_pairs).each do |name, value|
44
- send(name + '=', value)
44
+ send(name + '=', value.compact.empty? ? nil : value)
45
45
  end
46
46
  assign_multiparameter_attributes_without_attr_bucket(pairs - bucket_pairs)
47
47
  end
@@ -92,6 +92,7 @@ module AttrBucket
92
92
 
93
93
  def cast_to_time(value, column_class, dummy_time = false)
94
94
  if value.is_a?(Array)
95
+ value[0] ||= Date.today.year
95
96
  Time.time_with_datetime_fallback(self.class.default_timezone, *value)
96
97
  else
97
98
  dummy_time ? column_class.string_to_dummy_time(value) : column_class.string_to_time(value)
@@ -1,3 +1,3 @@
1
1
  module AttrBucket
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ernie Miller
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-29 00:00:00 -05:00
17
+ date: 2011-01-30 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency