From 019df9887519701b321c668c1d27d5c0c26fee7a Mon Sep 17 00:00:00 2001 From: claudiob Date: Tue, 4 Dec 2012 22:11:54 -0800 Subject: Replace comments' non-breaking spaces with spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes, on Mac OS X, programmers accidentally press Option+Space rather than just Space and don’t see the difference. The problem is that Option+Space writes a non-breaking space (0XA0) rather than a normal space (0x20). This commit removes all the non-breaking spaces inadvertently introduced in the comments of the code. --- activemodel/lib/active_model/errors.rb | 6 +++--- activemodel/lib/active_model/serialization.rb | 2 +- activemodel/lib/active_model/validator.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index c82d4f012c..963e52bff3 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -122,7 +122,7 @@ module ActiveModel # Delete messages for +key+. Returns the deleted messages. # # person.errors.get(:name) # => ["can not be nil"] - # person.errors.delete(:name) # => ["can not be nil"] + # person.errors.delete(:name) # => ["can not be nil"] # person.errors.get(:name) # => nil def delete(key) messages.delete(key) @@ -213,7 +213,7 @@ module ActiveModel # Returns +true+ if no errors are found, +false+ otherwise. # If the error message is a string it can be empty. # - # person.errors.full_messages # => ["name can not be nil"] + # person.errors.full_messages # => ["name can not be nil"] # person.errors.empty? # => false def empty? all? { |k, v| v && v.empty? && !v.is_a?(String) } @@ -246,7 +246,7 @@ module ActiveModel to_hash(options && options[:full_messages]) end - # Returns a Hash of attributes with their error messages. If +full_messages+ + # Returns a Hash of attributes with their error messages. If +full_messages+ # is +true+, it will contain full messages (see +full_message+). # # person.to_hash # => {:name=>["can not be nil"]} diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index dfd68a90fd..fdb06aebb9 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -90,7 +90,7 @@ module ActiveModel # person.name = 'bob' # person.age = 22 # person.serializable_hash # => {"name"=>"bob", "age"=>22} - # person.serializable_hash(only: :name) # => {"name"=>"bob"} + # person.serializable_hash(only: :name) # => {"name"=>"bob"} # person.serializable_hash(except: :name) # => {"age"=>22} # person.serializable_hash(methods: :capitalized_name) # # => {"name"=>"bob", "age"=>22, "capitalized_name"=>"Bob"} diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index 629b157fed..ff3dfa01c8 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -109,8 +109,8 @@ module ActiveModel # Return the kind for this validator. # - # PresenceValidator.new.kind # => :presence - # UniquenessValidator.new.kind # => :uniqueness  + # PresenceValidator.new.kind # => :presence + # UniquenessValidator.new.kind # => :uniqueness def kind self.class.kind end -- cgit v1.2.3