Commits

Sean Cribbs  committed 05f7cb2

Cleanup, restore reverted change.

  • Participants
  • Parent commits 8638637

Comments (0)

Files changed (3)

File ripple/lib/ripple/locale/en.yml

 #    limitations under the License.
 en:
   ripple:
-    property_type_mismatch: "Cannot cast %{value} into a %{class}"
     attribute_hash: "value of attributes must be a Hash"
     document_invalid: "Validation failed: %{errors}"
     document_not_found: 
       no_key: "Couldn't find document without a key"
       one_key: "Couldn't find document with key: %{key}"
       many_keys: "Couldn't find documents with keys: %{keys}"
-    no_root_document: "You cannot call %{method} on %{doc} without a root document"
+    no_root_document: "You cannot call %{method} on %{doc} without a root document"
+    property_type_mismatch: "Cannot cast %{value} into a %{class}"

File ripple/lib/ripple/validations/associated_validator.rb

 #
 # Taken from ActiveRecord::Validations::AssociatedValidators
 #
-
 require 'ripple'
 
 module Ripple
   module Validations
     class AssociatedValidator < ActiveModel::EachValidator
       def validate_each(record, attribute, value)
-        return if (value.is_a?(Array) ? value : [value]).collect{ |r| r.nil? || r.valid? }.all?
-        record.errors.add(attribute, :invalid, :default => options[:message], :value => value)
+        unless Array(value).all? {|r| r.nil? || r.valid? }
+          record.errors.add(attribute, :invalid, :default => options[:message], :value => value)
+        end
       end
     end
 

File ripple/spec/ripple/associations/proxy_spec.rb

     end
 
     it "should send resulting in a method missing if neither the proxy nor the target respond to the method" do
-      # lambda { @proxy.send(:gsub) }.should raise_error(NoMethodError)
       lambda { @proxy.send(:explode) }.should raise_error(NoMethodError)
     end
   end