amee-data-persistence 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.2.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{amee-data-persistence}
8
- s.version = "2.2.0"
8
+ s.version = "2.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Hetherington", "Andrew Berkeley", "James Smith", "George Palmer"]
12
- s.date = %q{2011-10-20}
12
+ s.date = %q{2011-10-24}
13
13
  s.description = %q{Part of the AMEEappkit, this gem provides storage and retrival of data provided by the amee-data-abstraction gem}
14
14
  s.email = %q{help@amee.com}
15
15
  s.extra_rdoc_files = [
@@ -34,13 +34,9 @@ module AMEE
34
34
 
35
35
  # Same as <i>save</i> but raises an exception on error
36
36
  def save!
37
- if dirty?
38
- validate!
39
- record = db_calculation || get_db_calculation
40
- record.update_calculation!(to_hash)
41
- else
42
- true
43
- end
37
+ validate!
38
+ record = db_calculation || get_db_calculation
39
+ record.update_calculation!(to_hash)
44
40
  end
45
41
 
46
42
  # Saves a representation of <tt>self<tt> to the database. Returns
@@ -197,14 +197,7 @@ describe AMEE::DataAbstraction::OngoingCalculation do
197
197
  record.to_hash[:co2][:value].should == 1200
198
198
  record.to_hash[:usage][:value].should == 6000
199
199
  end
200
-
201
- it "should only save if the calculation is dirty" do
202
- @ongoing_calculation.save.should be_true
203
- mock = flexmock(@ongoing_calculation)
204
-
205
- mock.should_receive(:update_calculation!).times(0)
206
- @ongoing_calculation.save.should be_true
207
- end
200
+
208
201
  end
209
202
 
210
203
  describe "when storage method is :metadata" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amee-data-persistence
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 2
9
- - 0
10
- version: 2.2.0
9
+ - 1
10
+ version: 2.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Hetherington
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-10-20 00:00:00 +01:00
21
+ date: 2011-10-24 00:00:00 +01:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency