Skip to content

Commit

Permalink
Bugs, bugs, bugs.....
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Aug 1, 2009
1 parent 1db2dae commit c126756
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 54 deletions.
4 changes: 3 additions & 1 deletion VERSION.yml
@@ -1,6 +1,8 @@
---
:major: 1
:minor: 1
:patch: 5
:patch: 7




53 changes: 2 additions & 51 deletions lib/simple_record.rb
Expand Up @@ -790,28 +790,6 @@ def unpad_self

def reload
super()
# puts 'decoding...'

=begin
This is done on getters now
if !@@dates.nil?
for d in @@dates
# puts 'converting created: ' + self['created'].inspect
if !self[d].nil?
self[d].collect!{ |d2|
if d2.is_a?(String)
DateTime.parse(d2)
else
d2
end
}
end
# puts 'after=' + self['created'].inspect
end
end
=end

# unpad_self
end

def update_attributes(*params)
Expand Down Expand Up @@ -850,6 +828,7 @@ def self.quote_regexp(a, re)
end
end

@@regex_no_id = /.*Couldn't find.*with ID.*/
def self.find(*params)
#puts 'params=' + params.inspect
q_type = :all
Expand Down Expand Up @@ -893,36 +872,8 @@ def self.find(*params)
return results
end

@@regex_no_id = /.*Couldn't find.*with ID.*/
def self.select(*params)
first=false
all=false
select=false
select_attributes=[]

if params.size > 0
all = params[0] == :all
first = params[0] == :first
end

options = params[1]
convert_condition_params(options)

results = all ? [] : nil
begin
results=super(*params)
cache_results(results)
rescue RightAws::AwsError, RightAws::ActiveSdb::ActiveSdbError
if ($!.message().index("NoSuchDomain") != nil)
# this is ok
elsif ($!.message() =~ @@regex_no_id)
results = nil
else
raise $!
end
end
return results

return find(*params)
end

def self.convert_condition_params(options)
Expand Down
4 changes: 2 additions & 2 deletions simple_record.gemspec
Expand Up @@ -2,11 +2,11 @@

Gem::Specification.new do |s|
s.name = %q{simple_record}
s.version = "1.1.5"
s.version = "1.1.7"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Travis Reeder", "RightScale"]
s.date = %q{2009-07-31}
s.date = %q{2009-08-01}
s.description = %q{Drop in replacement for ActiveRecord to Amazon SimpleDB instead.}
s.email = %q{travis@appoxy.com}
s.extra_rdoc_files = [
Expand Down
5 changes: 5 additions & 0 deletions test/test_simple_record.rb
Expand Up @@ -190,6 +190,11 @@ def test_count

end

def test_select
# just passes through to find
MyModel.select(:count)
end

def test_attributes_correct

#MyModel.defined_attributes.each do |a|
Expand Down

0 comments on commit c126756

Please sign in to comment.