harmonize 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module Harmonize
2
2
  module Gemdata
3
3
  Name = 'harmonize'
4
- Version = '0.0.3'
4
+ Version = '0.0.4'
5
5
  Authors = [ 'Bram Swenson' ]
6
6
  Email = [ 'bram@craniumisajar.com' ]
7
7
  Summary = <<-END_SUMMARY
@@ -95,7 +95,7 @@ module Harmonize
95
95
  @before = DateTime.now
96
96
  yield
97
97
  @after = DateTime.now
98
- rescue ActiveRecord::UnknownAttributeError, ActiveRecord::ActiveRecordError => e
98
+ rescue model_errors => e
99
99
  @error = e.message
100
100
  ensure
101
101
  if @error
@@ -105,6 +105,11 @@ module Harmonize
105
105
  create_log_entry if @modified || @error
106
106
  end
107
107
 
108
+ def model_errors
109
+ return [ ActiveRecord::UnknownAttributeError, ActiveRecord::ActiveRecordError ] if defined?(::ActiveRecord)
110
+ return [ Mongoid::MongoidError ] if defined?(::ActiveRecord)
111
+ end
112
+
108
113
  def create_log_entry
109
114
  @log.modifications.create(
110
115
  :instance_id => @target.id,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harmonize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-17 00:00:00.000000000Z
12
+ date: 2011-11-18 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashie
16
- requirement: &11797080 !ruby/object:Gem::Requirement
16
+ requirement: &17849480 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *11797080
24
+ version_requirements: *17849480
25
25
  description: ! 'Bring entire sets of models into harmony with external sources.
26
26
 
27
27
  '
@@ -65,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
65
  version: '0'
66
66
  segments:
67
67
  - 0
68
- hash: 4193351527517161227
68
+ hash: 2823993951482876041
69
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  none: false
71
71
  requirements:
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  segments:
76
76
  - 0
77
- hash: 4193351527517161227
77
+ hash: 2823993951482876041
78
78
  requirements: []
79
79
  rubyforge_project:
80
80
  rubygems_version: 1.8.10