cequel 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -145,6 +145,7 @@ module Cequel
145
145
  end
146
146
 
147
147
  def load
148
+ return self if @loaded
148
149
  @row = {}
149
150
  each_pair { |column, value| @row[column] = value }
150
151
  @loaded = true
@@ -1,3 +1,3 @@
1
1
  module Cequel
2
- VERSION = '0.5.4'
2
+ VERSION = '0.5.5'
3
3
  end
@@ -256,6 +256,17 @@ describe Cequel::Model::Dictionary do
256
256
  connection.should_not_receive(:execute)
257
257
  dictionary[4].should == comment
258
258
  end
259
+
260
+ it 'should be a no-op if already loaded' do
261
+ connection.stub(:execute).with(
262
+ 'SELECT FIRST 1000 * FROM post_comments WHERE ? = ? LIMIT 1',
263
+ :post_id, 1
264
+ ).and_return result_stub(4 => comment.to_json)
265
+ dictionary.load
266
+ connection.should_not_receive(:execute)
267
+ dictionary.load
268
+ dictionary[4].should == comment
269
+ end
259
270
  end
260
271
 
261
272
  describe '#each_pair' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-04-11 00:00:00.000000000 Z
14
+ date: 2013-04-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport