From cf55e4e3821f8a57663351c87f596e8161bcb71d Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Sun, 17 Jan 2010 15:35:18 +1100 Subject: Added documentation for ActiveModel::Lint --- activemodel/README | 7 +++++++ activemodel/lib/active_model/lint.rb | 14 +++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/activemodel/README b/activemodel/README index 9af10d8a38..d4b4489a2c 100644 --- a/activemodel/README +++ b/activemodel/README @@ -110,3 +110,10 @@ functionality from the following modules: # => ["Name Can not be nil"] {Learn more}[link:classes/ActiveModel/Errors.html] + +* Testing the compliance of your object + + User ActiveModel::Lint to test the compliance of your object to the + basic ActiveModel API... + + {Learn more}[link:classes/ActiveModel/Lint/Tests.html] diff --git a/activemodel/lib/active_model/lint.rb b/activemodel/lib/active_model/lint.rb index 0be82aa180..eabd542485 100644 --- a/activemodel/lib/active_model/lint.rb +++ b/activemodel/lib/active_model/lint.rb @@ -13,8 +13,7 @@ module ActiveModel module Lint module Tests - # valid? - # ------ + # == Responds to valid? # # Returns a boolean that specifies whether the object is in a valid or invalid # state. @@ -23,8 +22,7 @@ module ActiveModel assert_boolean model.valid?, "valid?" end - # new_record? - # ----------- + # == Responds to new_record? # # Returns a boolean that specifies whether the object has been persisted yet. # This is used when calculating the URL for an object. If the object is @@ -41,8 +39,7 @@ module ActiveModel assert_boolean model.destroyed?, "destroyed?" end - # naming - # ------ + # == Naming # # Model.model_name must returns a string with some convenience methods as # :human and :partial_path. Check ActiveModel::Naming for more information. @@ -55,9 +52,8 @@ module ActiveModel assert_kind_of String, model_name.partial_path end - # errors - # ------ - # + # == Errors Testing + # # Returns an object that has :[] and :full_messages defined on it. See below # for more details. -- cgit v1.2.3