From 856fc4bbc379b330d11702adbc2b26850dca6206 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 26 Jul 2010 12:52:34 -0500 Subject: Prep for RC --- activemodel/CHANGELOG | 2 +- activemodel/lib/active_model/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activemodel') diff --git a/activemodel/CHANGELOG b/activemodel/CHANGELOG index 33602657f5..8374853231 100644 --- a/activemodel/CHANGELOG +++ b/activemodel/CHANGELOG @@ -1,4 +1,4 @@ -*Rails 3.0.0 [Release Candidate] (unreleased)* +*Rails 3.0.0 [release candidate] (July 26th, 2010)* * Added ActiveModel::MassAssignmentSecurity [Eric Chapweske, Josh Kalderimis] diff --git a/activemodel/lib/active_model/version.rb b/activemodel/lib/active_model/version.rb index c36fc8b1f7..f2f4b15520 100644 --- a/activemodel/lib/active_model/version.rb +++ b/activemodel/lib/active_model/version.rb @@ -3,7 +3,7 @@ module ActiveModel MAJOR = 3 MINOR = 0 TINY = 0 - BUILD = "beta4" + BUILD = "rc" STRING = [MAJOR, MINOR, TINY, BUILD].join('.') end -- cgit v1.2.3 From 755af497555fde16db86f7e51f6462b0aca79b49 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 30 Jul 2010 02:30:04 +0200 Subject: edit pass to apply API guideline wrt the use of "# =>" in example code --- activemodel/lib/active_model/conversion.rb | 6 +++--- activemodel/lib/active_model/errors.rb | 20 ++++++++++---------- activemodel/lib/active_model/naming.rb | 9 ++++++--- activemodel/lib/active_model/translation.rb | 2 +- activemodel/lib/active_model/validations.rb | 18 +++++++----------- activemodel/lib/active_model/validator.rb | 4 ++-- 6 files changed, 29 insertions(+), 30 deletions(-) (limited to 'activemodel') diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index 2a1650faa9..d2bd160dc7 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -17,9 +17,9 @@ module ActiveModel # end # # cm = ContactMessage.new - # cm.to_model == self #=> true - # cm.to_key #=> nil - # cm.to_param #=> nil + # cm.to_model == self # => true + # cm.to_key # => nil + # cm.to_param # => nil # module Conversion # If your object is already designed to implement all of the Active Model diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 482b3dac47..bf93126d27 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -83,8 +83,8 @@ module ActiveModel # When passed a symbol or a name of a method, returns an array of errors # for the method. # - # p.errors[:name] #=> ["can not be nil"] - # p.errors['name'] #=> ["can not be nil"] + # p.errors[:name] # => ["can not be nil"] + # p.errors['name'] # => ["can not be nil"] def [](attribute) if errors = get(attribute.to_sym) errors @@ -96,7 +96,7 @@ module ActiveModel # Adds to the supplied attribute the supplied error message. # # p.errors[:name] = "must be set" - # p.errors[:name] #=> ['must be set'] + # p.errors[:name] # => ['must be set'] def []=(attribute, error) self[attribute.to_sym] << error end @@ -124,9 +124,9 @@ module ActiveModel # Returns the number of error messages. # # p.errors.add(:name, "can't be blank") - # p.errors.size #=> 1 + # p.errors.size # => 1 # p.errors.add(:name, "must be specified") - # p.errors.size #=> 2 + # p.errors.size # => 2 def size values.flatten.size end @@ -135,16 +135,16 @@ module ActiveModel # # p.errors.add(:name, "can't be blank") # p.errors.add(:name, "must be specified") - # p.errors.to_a #=> ["name can't be blank", "name must be specified"] + # p.errors.to_a # => ["name can't be blank", "name must be specified"] def to_a full_messages end # Returns the number of error messages. # p.errors.add(:name, "can't be blank") - # p.errors.count #=> 1 + # p.errors.count # => 1 # p.errors.add(:name, "must be specified") - # p.errors.count #=> 2 + # p.errors.count # => 2 def count to_a.size end @@ -158,8 +158,8 @@ module ActiveModel # # p.errors.add(:name, "can't be blank") # p.errors.add(:name, "must be specified") - # p.errors.to_xml #=> Produces: - # + # p.errors.to_xml + # # => # # # # # # name can't be blank diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb index dc83932dde..b74d669f0a 100644 --- a/activemodel/lib/active_model/naming.rb +++ b/activemodel/lib/active_model/naming.rb @@ -17,7 +17,10 @@ module ActiveModel end # Transform the model name into a more humane format, using I18n. By default, - # it will underscore then humanize the class name (BlogPost.model_name.human #=> "Blog post"). + # it will underscore then humanize the class name + # + # BlogPost.model_name.human # => "Blog post" + # # Specify +options+ with additional translating options. def human(options={}) return @human unless @klass.respond_to?(:lookup_ancestors) && @@ -45,8 +48,8 @@ module ActiveModel # extend ActiveModel::Naming # end # - # BookCover.model_name #=> "BookCover" - # BookCover.model_name.human #=> "Book cover" + # BookCover.model_name # => "BookCover" + # BookCover.model_name.human # => "Book cover" # # Providing the functionality that ActiveModel::Naming provides in your object # is required to pass the Active Model Lint test. So either extending the provided diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb index 0554677296..0facbd6ce1 100644 --- a/activemodel/lib/active_model/translation.rb +++ b/activemodel/lib/active_model/translation.rb @@ -14,7 +14,7 @@ module ActiveModel # end # # TranslatedPerson.human_attribute_name('my_attribute') - # #=> "My attribute" + # # => "My attribute" # # This also provides the required class methods for hooking into the # Rails internationalization API, including being able to define a diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 5779ba3b29..1a58d4c4fb 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -24,20 +24,16 @@ module ActiveModel # end # # Which provides you with the full standard validation stack that you - # know from ActiveRecord. + # know from Active Record: # # person = Person.new - # person.valid? - # #=> true - # person.invalid? - # #=> false + # person.valid? # => true + # person.invalid? # => false + # # person.first_name = 'zoolander' - # person.valid? - # #=> false - # person.invalid? - # #=> true - # person.errors - # #=> #["starts with z."]}> + # person.valid? # => false + # person.invalid? # => true + # person.errors # => #["starts with z."]}> # # Note that ActiveModel::Validations automatically adds an +errors+ method # to your instances initialized with a new ActiveModel::Errors object, so diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index 689c617177..52192d5988 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -102,8 +102,8 @@ module ActiveModel #:nodoc: # # == Examples # - # PresenceValidator.kind #=> :presence - # UniquenessValidator.kind #=> :uniqueness + # PresenceValidator.kind # => :presence + # UniquenessValidator.kind # => :uniqueness # def self.kind @kind ||= name.split('::').last.underscore.sub(/_validator$/, '').to_sym unless anonymous? -- cgit v1.2.3