appoxy-simple_record 1.0.28 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simple_record.rb +8 -11
- data/test/test_simple_record.rb +5 -0
- metadata +1 -1
data/lib/simple_record.rb
CHANGED
@@ -844,33 +844,30 @@ This is done on getters now
|
|
844
844
|
|
845
845
|
def self.find(*params)
|
846
846
|
#puts 'params=' + params.inspect
|
847
|
-
|
848
|
-
first=false
|
849
|
-
all=false
|
850
|
-
select=false
|
847
|
+
q_type = :all
|
851
848
|
select_attributes=[]
|
852
849
|
|
853
850
|
if params.size > 0
|
854
|
-
|
855
|
-
first = params[0] == :first
|
851
|
+
q_type = params[0]
|
856
852
|
end
|
857
853
|
|
858
|
-
|
859
854
|
# Pad and Offset number attributes
|
860
855
|
options = {}
|
861
856
|
if params.size > 1
|
862
857
|
options = params[1]
|
863
858
|
#puts 'options=' + options.inspect
|
864
859
|
#puts 'after collect=' + options.inspect
|
860
|
+
convert_condition_params(options)
|
865
861
|
end
|
866
|
-
convert_condition_params(options)
|
867
862
|
#puts 'params2=' + params.inspect
|
868
863
|
|
869
|
-
results = all ? [] : nil
|
864
|
+
results = q_type == :all ? [] : nil
|
870
865
|
begin
|
871
866
|
results=super(*params)
|
872
|
-
|
873
|
-
|
867
|
+
if q_type != :count
|
868
|
+
cache_results(results)
|
869
|
+
results = SimpleRecord::ResultsArray.new(self, params, results, next_token)
|
870
|
+
end
|
874
871
|
rescue RightAws::AwsError, RightAws::ActiveSdb::ActiveSdbError
|
875
872
|
puts "RESCUED: " + $!.message
|
876
873
|
if ($!.message().index("NoSuchDomain") != nil)
|
data/test/test_simple_record.rb
CHANGED