Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
removing fake sanitize methods in specs because we're using Active Re…
Browse files Browse the repository at this point in the history
…cord now
  • Loading branch information
ryanb committed Dec 30, 2010
1 parent 8628aa0 commit e8d298c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,4 @@ class Category < SuperModel::Base

class Project < SuperModel::Base
belongs_to :category

class << self
protected

def sanitize_sql(hash_cond)
case hash_cond
when Hash
sanitize_hash(hash_cond).join(' AND ')
when Array
hash_cond.shift.gsub('?'){"#{hash_cond.shift.inspect}"}
when String then hash_cond
end
end

def sanitize_hash(hash)
hash.map do |name, value|
if Hash === value
sanitize_hash(value).map{|cond| "#{name}.#{cond}"}
else
"#{name}=#{value}"
end
end.flatten
end
end
end

0 comments on commit e8d298c

Please sign in to comment.