simple_record 1.4.6 → 1.4.7

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.
Files changed (2) hide show
  1. data/lib/simple_record/active_sdb.rb +8 -7
  2. metadata +4 -4
@@ -1,5 +1,3 @@
1
- # Moved this into SimpleRecord because it's too tightly tied together and ActiveSDB should go away.
2
-
3
1
  #
4
2
  # Copyright (c) 2008 RightScale Inc
5
3
  #
@@ -372,9 +370,9 @@ module SimpleRecord
372
370
  options[:conditions] = build_conditions(options[:conditions])
373
371
  # join ids condition and user defined conditions
374
372
  options[:conditions] = options[:conditions].blank? ? ids_cond : "(#{options[:conditions]}) AND #{ids_cond}"
375
- # puts 'options=' + options.inspect
373
+ #puts 'options=' + options.inspect
376
374
  result = sql_select(options)
377
- # puts 'select_from_ids result=' + result.inspect
375
+ #puts 'select_from_ids result=' + result.inspect
378
376
  # if one record was requested then return it
379
377
  unless bunch_of_records_requested
380
378
  record = result[:items].first
@@ -399,9 +397,10 @@ module SimpleRecord
399
397
  count = options[:count] || false
400
398
  #puts 'count? ' + count.to_s
401
399
  @next_token = options[:next_token]
400
+ @consistent_read = options[:consistent_read]
402
401
  select_expression = build_select(options)
403
402
  # request items
404
- query_result = self.connection.select(select_expression, @next_token)
403
+ query_result = self.connection.select(select_expression, @next_token, @consistent_read)
405
404
  # puts 'QR=' + query_result.inspect
406
405
  ret = {}
407
406
  if count
@@ -466,6 +465,7 @@ module SimpleRecord
466
465
  #
467
466
  def query(options) # :nodoc:
468
467
  @next_token = options[:next_token]
468
+ @consistent_read = options[:consistent_read]
469
469
  query_expression = build_conditions(options[:query_expression])
470
470
  # add sort_options to the query_expression
471
471
  if options[:sort_option]
@@ -484,7 +484,7 @@ module SimpleRecord
484
484
  query_expression += sort_by_expression
485
485
  end
486
486
  # request items
487
- query_result = self.connection.query(domain, query_expression, options[:max_number_of_items], @next_token)
487
+ query_result = self.connection.query(domain, query_expression, options[:max_number_of_items], @next_token, @consistent_read)
488
488
  @next_token = query_result[:next_token]
489
489
  items = query_result[:items].map do |name|
490
490
  new_item = self.new('id' => name)
@@ -508,7 +508,8 @@ module SimpleRecord
508
508
  records = query( :query_expression => options[:conditions],
509
509
  :max_number_of_items => options[:limit],
510
510
  :next_token => options[:next_token],
511
- :sort_option => options[:sort] || options[:order] )
511
+ :sort_option => options[:sort] || options[:order],
512
+ :consistent_read => options[:consistent_read] )
512
513
  options[:auto_load] ? reload_all_records(records) : records
513
514
  end
514
515
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_record
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 6
10
- version: 1.4.6
9
+ - 7
10
+ version: 1.4.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Travis Reeder
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-07-20 00:00:00 -07:00
20
+ date: 2010-07-22 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency