Permalink
Browse files

minor edits in AM documentation [ci skip]

  • Loading branch information...
1 parent aceb4a5 commit c9a88a2c26a0d9050e6106ef5e0617fe5c4cca24 Francesco Rodriguez committed Oct 21, 2012
View
2 activemodel/lib/active_model/attribute_methods.rb
@@ -11,7 +11,7 @@ module ActiveModel
# # => ActiveModel::MissingAttributeError: missing attribute: user_id
class MissingAttributeError < NoMethodError
end
- # == Active Model Attribute Methods
+ # == Active \Model Attribute Methods
#
# <tt>ActiveModel::AttributeMethods</tt> provides a way to add prefixes and
# suffixes to your methods as well as handling the creation of Active Record
View
2 activemodel/lib/active_model/callbacks.rb
@@ -1,7 +1,7 @@
require 'active_support/callbacks'
module ActiveModel
- # == Active Model Callbacks
+ # == Active \Model \Callbacks
#
# Provides an interface for any class to have Active Record like callbacks.
#
View
2 activemodel/lib/active_model/conversion.rb
@@ -1,7 +1,7 @@
require 'active_support/inflector'
module ActiveModel
- # == Active Model Conversions
+ # == Active \Model Conversions
#
# Handles default conversions: to_model, to_key, to_param, and to_partial_path.
#
View
2 activemodel/lib/active_model/dirty.rb
@@ -3,7 +3,7 @@
require 'active_support/core_ext/object/duplicable'
module ActiveModel
- # == Active Model Dirty
+ # == Active \Model \Dirty
#
# Provides a way to track changes in your object in the same way as
# Active Record does.
View
2 activemodel/lib/active_model/errors.rb
@@ -4,7 +4,7 @@
require 'active_support/core_ext/string/inflections'
module ActiveModel
- # == Active Model Errors
+ # == Active \Model \Errors
#
# Provides a modified +Hash+ that you can include in your object
# for handling error messages and interacting with Action Pack helpers.
View
8 activemodel/lib/active_model/lint.rb
@@ -1,8 +1,8 @@
module ActiveModel
module Lint
- # == Active Model Lint Tests
+ # == Active \Model \Lint \Tests
#
- # You can test whether an object is compliant with the Active Model API by
+ # You can test whether an object is compliant with the Active \Model API by
# including <tt>ActiveModel::Lint::Tests</tt> in your TestCase. It will
# include tests that tell you whether your object is fully compliant,
# or if not, which aspects of the API are not implemented.
@@ -71,7 +71,7 @@ def test_persisted?
assert_boolean model.persisted?, "persisted?"
end
- # == Naming
+ # == \Naming
#
# Model.model_name must return a string with some convenience methods:
# <tt>:human</tt>, <tt>:singular</tt> and <tt>:plural</tt>. Check
@@ -85,7 +85,7 @@ def test_model_naming
assert model_name.plural.respond_to?(:to_str)
end
- # == Errors Testing
+ # == \Errors Testing
#
# Returns an object that implements [](attribute) defined which returns an
# Array of Strings that are the errors for the attribute in question.
View
2 activemodel/lib/active_model/model.rb
@@ -1,6 +1,6 @@
module ActiveModel
- # == Active Model Basic Model
+ # == Active \Model Basic \Model
#
# Includes the required interface for an object to interact with
# <tt>ActionPack</tt>, using different <tt>ActiveModel</tt> modules.
View
2 activemodel/lib/active_model/naming.rb
@@ -195,7 +195,7 @@ def _singularize(string, replacement='_')
end
end
- # == Active Model Naming
+ # == Active \Model \Naming
#
# Creates a +model_name+ method on your object.
#
View
6 activemodel/lib/active_model/observing.rb
@@ -8,7 +8,7 @@
require 'active_support/descendants_tracker'
module ActiveModel
- # == Active Model Observers Activation
+ # == Active \Model Observers Activation
module Observing
extend ActiveSupport::Concern
@@ -229,7 +229,7 @@ def notify_observers(method, *extra_args)
end
end
- # == Active Model Observers
+ # == Active \Model Observers
#
# Observer classes respond to life cycle callbacks to implement trigger-like
# behavior outside the original class. This is a great way to reduce the
@@ -257,7 +257,7 @@ def notify_observers(method, *extra_args)
#
# This Observer uses logger to log when specific callbacks are triggered.
#
- # == Observing a class that can't be inferred
+ # == \Observing a class that can't be inferred
#
# Observers will by default be mapped to the class with which they share a
# name. So <tt>CommentObserver</tt> will be tied to observing <tt>Comment</tt>,
View
4 activemodel/lib/active_model/railtie.rb
@@ -2,7 +2,7 @@
require "rails"
module ActiveModel
- class Railtie < Rails::Railtie
+ class Railtie < Rails::Railtie # :nodoc:
config.eager_load_namespaces << ActiveModel
end
-end
+end
View
2 activemodel/lib/active_model/serialization.rb
@@ -2,7 +2,7 @@
require 'active_support/core_ext/hash/slice'
module ActiveModel
- # == Active Model Serialization
+ # == Active \Model \Serialization
#
# Provides a basic serialization to a serializable_hash for your object.
#
View
2 activemodel/lib/active_model/translation.rb
@@ -1,6 +1,6 @@
module ActiveModel
- # == Active Model Translation
+ # == Active \Model \Translation
#
# Provides integration between your object and the Rails internationalization
# (i18n) framework.
View
2 activemodel/lib/active_model/validations.rb
@@ -6,7 +6,7 @@
module ActiveModel
- # == Active Model Validations
+ # == Active \Model Validations
#
# Provides a full validation framework to your objects.
#
View
2 activemodel/lib/active_model/validations/acceptance.rb
@@ -1,6 +1,6 @@
module ActiveModel
- # == Active Model Acceptance Validator
+ # == Active \Model Acceptance \Validator
module Validations
class AcceptanceValidator < EachValidator #:nodoc:
def initialize(options)
View
2 activemodel/lib/active_model/validations/callbacks.rb
@@ -2,7 +2,7 @@
module ActiveModel
module Validations
- # == Active Model Validation callbacks
+ # == Active \Model Validation Callbacks
#
# Provides an interface for any class to have +before_validation+ and
# +after_validation+ callbacks.
View
2 activemodel/lib/active_model/validations/confirmation.rb
@@ -1,6 +1,6 @@
module ActiveModel
- # == Active Model Confirmation Validator
+ # == Active \Model Confirmation \Validator
module Validations
class ConfirmationValidator < EachValidator #:nodoc:
def validate_each(record, attribute, value)
View
2 activemodel/lib/active_model/validations/exclusion.rb
@@ -2,7 +2,7 @@
module ActiveModel
- # == Active Model Exclusion Validator
+ # == Active \Model Exclusion \Validator
module Validations
class ExclusionValidator < EachValidator #:nodoc:
include Clusivity
View
2 activemodel/lib/active_model/validations/inclusion.rb
@@ -2,7 +2,7 @@
module ActiveModel
- # == Active Model Inclusion Validator
+ # == Active \Model Inclusion \Validator
module Validations
class InclusionValidator < EachValidator #:nodoc:
include Clusivity
View
6 activemodel/lib/active_model/validations/length.rb
@@ -1,8 +1,8 @@
module ActiveModel
- # == Active Model Length Validator
+ # == Active \Model Length \Validator
module Validations
- class LengthValidator < EachValidator #:nodoc:
+ class LengthValidator < EachValidator # :nodoc:
MESSAGES = { :is => :wrong_length, :minimum => :too_short, :maximum => :too_long }.freeze
CHECKS = { :is => :==, :minimum => :>=, :maximum => :<= }.freeze
@@ -37,7 +37,7 @@ def validate_each(record, attribute, value)
value = tokenize(value)
value_length = value.respond_to?(:length) ? value.length : value.to_s.length
errors_options = options.except(*RESERVED_OPTIONS)
-
+
CHECKS.each do |key, validity_check|
next unless check_value = options[key]
next if value_length.send(validity_check, check_value)
View
4 activemodel/lib/active_model/validations/numericality.rb
@@ -1,8 +1,8 @@
module ActiveModel
- # == Active Model Numericality Validator
+ # == Active \Model Numericality \Validator
module Validations
- class NumericalityValidator < EachValidator #:nodoc:
+ class NumericalityValidator < EachValidator # :nodoc:
CHECKS = { :greater_than => :>, :greater_than_or_equal_to => :>=,
:equal_to => :==, :less_than => :<, :less_than_or_equal_to => :<=,
:odd => :odd?, :even => :even?, :other_than => :!= }.freeze
View
4 activemodel/lib/active_model/validations/presence.rb
@@ -1,9 +1,9 @@
module ActiveModel
- # == Active Model Presence Validator
+ # == Active \Model Presence \Validator
module Validations
- class PresenceValidator < EachValidator #:nodoc:
+ class PresenceValidator < EachValidator # :nodoc:
def validate(record)
record.errors.add_on_blank(attributes, options)
end
View
2 activemodel/lib/active_model/validator.rb
@@ -2,7 +2,7 @@
module ActiveModel
- # == Active Model Validator
+ # == Active \Model \Validator
#
# A simple base class that can be used along with
# ActiveModel::Validations::ClassMethods.validates_with

0 comments on commit c9a88a2

Please sign in to comment.