mass_record 0.0.4.7 → 0.0.4.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56ae0469ec56c926ba04f4060436a8fdc77cf52b
4
- data.tar.gz: 428a86ffcfed8b592e1515eba3953702f090efff
3
+ metadata.gz: d288ae09db2b38e806ee05081c53fb2b8d055a1d
4
+ data.tar.gz: 022bbc03b711b6472e733de81171d8aa2320af2b
5
5
  SHA512:
6
- metadata.gz: f203ac71350fe8f680c31e81aa59766d4573daec73f3ad151565b7b37da9d4328e7f8f2eb03e861593cb6787f581266aa7737c1fdec267e7211e22ac9ef1f501
7
- data.tar.gz: cbc4ab3fd099fd0ac33034a7a57410c15459361a219c0c9ab262b9d43cd2bea19da7bd5d568d9916c68c9da308b46aa5fafced518e09e801f0b902269515df8f
6
+ metadata.gz: 01e00ca7cdf2831542a11ca52f0414476a97e8b87497c174f293aa29fc9b6396bbc029b86501961fd9d7a454f429a81ebcb1cae1dac2353d4ca51302bf66f7ff
7
+ data.tar.gz: da82973a1cb9c68b31e906e13cb18bbdbf1e1a49c4ef542bda5d6ff0f20d245ac4abc2f381da42a3e17ccd7622f1d26d33f050f496f9e9ae207662647cc95733
@@ -1,3 +1,3 @@
1
1
  module MassRecord
2
- VERSION = "0.0.4.7" # fixed error parsing so that only errored objects are put in the error folder
2
+ VERSION = "0.0.4.8" # added a temporary fix for sqlserver bit type conversion from false
3
3
  end
data/lib/mass_record.rb CHANGED
@@ -714,10 +714,11 @@ module MassRecord
714
714
  json_object.each do |k,v|
715
715
  v = Time.parse v if v.is_a? String and [:datetime, :date, :time, :timestamp].include? model.column_types[k].type.to_sym.downcase # fix funky to_json format if present
716
716
  v = time if crud_times.include? k and (v.blank? or k == updated_at) and model.column_names.include? k # add crud time if it is blank and it is a column in the model or if it is update_at just add the time
717
-
718
717
  # convert to correct database type
719
718
  begin
720
719
  v = model.connection.type_cast v, model.column_types[k]
720
+ # handles a bug in the activerecord-sqlserver-adapter gem version 4.1
721
+ v = (v=='f' ? 0 : 1) if model.column_types[k].sql_type == 'bit' and ['f','t'].include?(v.to_s.downcase)
721
722
  v = model.connection.quote_string v if v.is_a? String
722
723
  rescue Exception => e # If it is a text field, automatically yamlize it if there is a non text type passed in (just like normal active record saves)
723
724
  v = model.connection.type_cast v.to_yaml, model.column_types[k] if e.is_a? TypeError and model.column_types[k].type == :text
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mass_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.7
4
+ version: 0.0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hanna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails