appoxy-simple_record 1.1.5 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simple_record.rb +2 -51
- data/test/test_simple_record.rb +5 -0
- metadata +2 -2
data/lib/simple_record.rb
CHANGED
@@ -790,28 +790,6 @@ module SimpleRecord
|
|
790
790
|
|
791
791
|
def reload
|
792
792
|
super()
|
793
|
-
# puts 'decoding...'
|
794
|
-
|
795
|
-
=begin
|
796
|
-
This is done on getters now
|
797
|
-
if !@@dates.nil?
|
798
|
-
for d in @@dates
|
799
|
-
# puts 'converting created: ' + self['created'].inspect
|
800
|
-
if !self[d].nil?
|
801
|
-
self[d].collect!{ |d2|
|
802
|
-
if d2.is_a?(String)
|
803
|
-
DateTime.parse(d2)
|
804
|
-
else
|
805
|
-
d2
|
806
|
-
end
|
807
|
-
}
|
808
|
-
end
|
809
|
-
# puts 'after=' + self['created'].inspect
|
810
|
-
end
|
811
|
-
end
|
812
|
-
=end
|
813
|
-
|
814
|
-
# unpad_self
|
815
793
|
end
|
816
794
|
|
817
795
|
def update_attributes(*params)
|
@@ -850,6 +828,7 @@ This is done on getters now
|
|
850
828
|
end
|
851
829
|
end
|
852
830
|
|
831
|
+
@@regex_no_id = /.*Couldn't find.*with ID.*/
|
853
832
|
def self.find(*params)
|
854
833
|
#puts 'params=' + params.inspect
|
855
834
|
q_type = :all
|
@@ -893,36 +872,8 @@ This is done on getters now
|
|
893
872
|
return results
|
894
873
|
end
|
895
874
|
|
896
|
-
@@regex_no_id = /.*Couldn't find.*with ID.*/
|
897
875
|
def self.select(*params)
|
898
|
-
|
899
|
-
all=false
|
900
|
-
select=false
|
901
|
-
select_attributes=[]
|
902
|
-
|
903
|
-
if params.size > 0
|
904
|
-
all = params[0] == :all
|
905
|
-
first = params[0] == :first
|
906
|
-
end
|
907
|
-
|
908
|
-
options = params[1]
|
909
|
-
convert_condition_params(options)
|
910
|
-
|
911
|
-
results = all ? [] : nil
|
912
|
-
begin
|
913
|
-
results=super(*params)
|
914
|
-
cache_results(results)
|
915
|
-
rescue RightAws::AwsError, RightAws::ActiveSdb::ActiveSdbError
|
916
|
-
if ($!.message().index("NoSuchDomain") != nil)
|
917
|
-
# this is ok
|
918
|
-
elsif ($!.message() =~ @@regex_no_id)
|
919
|
-
results = nil
|
920
|
-
else
|
921
|
-
raise $!
|
922
|
-
end
|
923
|
-
end
|
924
|
-
return results
|
925
|
-
|
876
|
+
return find(*params)
|
926
877
|
end
|
927
878
|
|
928
879
|
def self.convert_condition_params(options)
|
data/test/test_simple_record.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appoxy-simple_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Reeder
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-08-01 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|