change_log 1.0.2 → 1.0.3

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.
@@ -55,7 +55,7 @@ module ChangeLog
55
55
  self.attributes.map do |key,value|
56
56
  unless self.ignore.include?(key.to_sym)
57
57
  field_type = ChangeLogs.get_field_type(self.class.table_name,key)
58
- value = value.gsub("'", %q(\\\')) unless value.blank?
58
+ value = value.gsub("'", %q(\\\')) unless value.blank? || !value.is_a?(String)
59
59
  column_values << '(' + ["'INSERT'", self.id, "'#{self.class.table_name}'", "'#{ChangeLog.whodidit}'", "'#{field_type}'", "'#{key}'", "'#{value}'",1].join(',') + ')'
60
60
  end
61
61
  end
@@ -79,8 +79,8 @@ module ChangeLog
79
79
  # and ignore the changes for ignored columns
80
80
  unless value[1].eql?(value[0]) || (value[1].blank?&&value[0].blank?) || self.ignore.include?(attribute_name.to_s)
81
81
  field_type = ChangeLogs.get_field_type(self.class.table_name,attribute_name)
82
- value[0] = value[0].gsub("'", %q(\\\')) unless value[0].blank?
83
- value[1] = value[1].gsub("'", %q(\\\')) unless value[1].blank?
82
+ value[0] = value[0].gsub("'", %q(\\\')) unless value[0].blank? || !value[0].is_a?(String)
83
+ value[1] = value[1].gsub("'", %q(\\\')) unless value[1].blank? || !value[1].is_a?(String)
84
84
 
85
85
  column_values << '(' + ["'UPDATE'", self.id, "'#{self.class.table_name}'", "'#{ChangeLog.whodidit}'","'#{field_type}'", "'#{attribute_name}'", "'#{value[0]}'","'#{value[1]}'",ChangeLogs.get_version_number(self.id,self.class.table_name)].join(',') + ')'
86
86
  end
@@ -1,3 +1,3 @@
1
1
  module ChangeLog
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: change_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
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-05-08 00:00:00.000000000 Z
12
+ date: 2013-05-09 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A gem for tracking who did what and when it happened -- keeps all the
15
15
  changes done by user into a maintenance log