Permalink
Browse files

remove the responsibility of sanitizing from the storage proxy

  • Loading branch information...
1 parent 4fab55d commit 1876d90e7e7758826e07874889915bf9ac75cf1b @jamesgolick committed Jan 25, 2010
Showing with 1 addition and 7 deletions.
  1. +1 −2 lib/friendly/storage_proxy.rb
  2. +0 −5 spec/unit/storage_proxy_spec.rb
@@ -69,8 +69,7 @@ def index_for(conditions)
def index_for_fields(fields)
tables.detect do |t|
- t.respond_to?(:fields) &&
- t.fields.map { |f| f.to_s } == fields.map { |f| f.to_s }
+ t.respond_to?(:fields) && t.fields == fields
end.tap do |i|
raise MissingIndex, "No index found matching #{fields.join(", ")}." if i.nil?
end
@@ -235,11 +235,6 @@
[:name, :created_at]
end
- it "matches if the fields are strings" do
- @storage.index_for_fields(["name", "created_at"]).fields.should ==
- [:name, :created_at]
- end
-
it "raises missing index if there's no matching index" do
lambda {
@storage.index_for_fields([:created_at, :name])

0 comments on commit 1876d90

Please sign in to comment.