believer 0.2.11 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,6 +124,7 @@ module Believer
124
124
  else
125
125
  v = col.convert_to_type(v)
126
126
  end
127
+ v = col.default_value if v.nil? && col.has_default_value?
127
128
  end
128
129
  @attributes[attr_name] = v
129
130
  end
@@ -152,6 +153,11 @@ module Believer
152
153
  end if attrs.present?
153
154
  end
154
155
 
156
+ # Returns a hash of all the attributes with their names as keys and the values of the attributes as values.
157
+ def attributes_dup
158
+ @attributes.dup
159
+ end
160
+
155
161
  #protected
156
162
  def merge_attributes(attrs)
157
163
  @attributes ||= {}
@@ -32,10 +32,17 @@ module Believer
32
32
  pluck_res = []
33
33
  rows.each do |r|
34
34
  if fields.size > 1
35
- pluck_res << fields.map {|f| record_class.columns[f].convert_to_type(r[f.to_s]) }
35
+ pluck_res << fields.map {|f|
36
+ val = r[f.to_s]
37
+ col = record_class.columns[f]
38
+ val = (col.apply_cql_result_row_conversion? ? col.convert_to_type(val) : val)
39
+ val
40
+ }
36
41
  else
37
42
  f = fields[0]
38
- pluck_res << record_class.columns[f].convert_to_type(r[f.to_s])
43
+ val = r[f.to_s]
44
+ col = record_class.columns[f]
45
+ pluck_res << (col.apply_cql_result_row_conversion? ? col.convert_to_type(val) : val)
39
46
  end
40
47
  end
41
48
  pluck_res
@@ -1,5 +1,5 @@
1
1
  module Believer
2
2
  module Version
3
- VERSION = '0.2.11'
3
+ VERSION = '0.2.13'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: believer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-11 00:00:00.000000000 Z
12
+ date: 2013-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel