diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-05-23 22:43:08 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-05-23 22:43:08 +0530 |
commit | 1ad0b378cc081937c117577ab628f2160fcc448d (patch) | |
tree | a675d20ea606caa653010c57b90d10f173f7dd93 /activemodel/lib/active_model | |
parent | 2642c2961cda2074cc1495a4635898ca8ab33adf (diff) | |
download | rails-1ad0b378cc081937c117577ab628f2160fcc448d.tar.gz rails-1ad0b378cc081937c117577ab628f2160fcc448d.tar.bz2 rails-1ad0b378cc081937c117577ab628f2160fcc448d.zip |
Revert "Remove blank trailing comments"
This reverts commit fa6d921e11363e9b8c4bc10f7aed0b9faffdc33a.
Reason: Not a fan of such massive changes. We usually close such changes
if made to Rails master as a pull request. Following the same principle
here and reverting.
[ci skip]
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 1 | ||||
-rw-r--r-- | activemodel/lib/active_model/callbacks.rb | 1 | ||||
-rw-r--r-- | activemodel/lib/active_model/conversion.rb | 1 | ||||
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 1 | ||||
-rw-r--r-- | activemodel/lib/active_model/lint.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/mass_assignment_security.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/observing.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/serialization.rb | 1 | ||||
-rw-r--r-- | activemodel/lib/active_model/validations.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/validations/validates.rb | 1 | ||||
-rw-r--r-- | activemodel/lib/active_model/validator.rb | 2 |
11 files changed, 16 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 61985e241b..99918fdb96 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -53,6 +53,7 @@ module ActiveModel # hash value. # # Hash keys must be strings. + # module AttributeMethods extend ActiveSupport::Concern diff --git a/activemodel/lib/active_model/callbacks.rb b/activemodel/lib/active_model/callbacks.rb index 50709e5ee1..ebb4b51aa3 100644 --- a/activemodel/lib/active_model/callbacks.rb +++ b/activemodel/lib/active_model/callbacks.rb @@ -83,6 +83,7 @@ module ActiveModel # # obj is the MyModel instance that the callback is being called on # end # end + # def define_model_callbacks(*callbacks) options = callbacks.extract_options! options = { diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index cea11c1a18..d7f30f0920 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -22,6 +22,7 @@ module ActiveModel # cm.to_key # => nil # cm.to_param # => nil # cm.to_partial_path # => "contact_messages/contact_message" + # module Conversion extend ActiveSupport::Concern diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 7b311a50ff..aba6618b56 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -317,6 +317,7 @@ module ActiveModel # * <tt>activemodel.errors.messages.blank</tt> # * <tt>errors.attributes.title.blank</tt> # * <tt>errors.messages.blank</tt> + # def generate_message(attribute, type = :invalid, options = {}) type = options.delete(:message) if options[:message].is_a?(Symbol) diff --git a/activemodel/lib/active_model/lint.rb b/activemodel/lib/active_model/lint.rb index 2c7f2a9334..88b730626c 100644 --- a/activemodel/lib/active_model/lint.rb +++ b/activemodel/lib/active_model/lint.rb @@ -52,6 +52,7 @@ module ActiveModel # # Returns a string giving a relative path. This is used for looking up # partials. For example, a BlogPost model might return "blog_posts/blog_post" + # def test_to_partial_path assert model.respond_to?(:to_partial_path), "The model should respond to to_partial_path" assert_kind_of String, model.to_partial_path @@ -73,6 +74,7 @@ module ActiveModel # # Model.model_name must return a string with some convenience methods: # :human, :singular, and :plural. Check ActiveModel::Naming for more information. + # def test_model_naming assert model.class.respond_to?(:model_name), "The model should respond to model_name" model_name = model.class.model_name diff --git a/activemodel/lib/active_model/mass_assignment_security.rb b/activemodel/lib/active_model/mass_assignment_security.rb index 50951b28d9..893fbf92c3 100644 --- a/activemodel/lib/active_model/mass_assignment_security.rb +++ b/activemodel/lib/active_model/mass_assignment_security.rb @@ -56,6 +56,8 @@ module ActiveModel # # You can specify your own sanitizer object eg. MySanitizer.new. # See <tt>ActiveModel::MassAssignmentSecurity::LoggerSanitizer</tt> for example implementation. + # + # module ClassMethods # Attributes named in this macro are protected from mass-assignment # whenever attributes are sanitized before assignment. A role for the diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb index 117c19c412..f5ea285ccb 100644 --- a/activemodel/lib/active_model/observing.rb +++ b/activemodel/lib/active_model/observing.rb @@ -124,6 +124,7 @@ module ActiveModel # # This will call +custom_notification+, passing as arguments # the current object and :foo. + # def notify_observers(method, *extra_args) self.class.notify_observers(method, self, *extra_args) end @@ -191,6 +192,7 @@ module ActiveModel # If you're using an Observer in a Rails application with Active Record, be sure to # read about the necessary configuration in the documentation for # ActiveRecord::Observer. + # class Observer include Singleton extend ActiveSupport::DescendantsTracker diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index 5fabfb7219..6d8fd21814 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -115,6 +115,7 @@ module ActiveModel # @data[key] # end # end + # alias :read_attribute_for_serialization :send # Add associations specified via the <tt>:include</tt> option. diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 019d4b22cf..611e9ffd55 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -38,6 +38,7 @@ module ActiveModel # Note that <tt>ActiveModel::Validations</tt> automatically adds an +errors+ method # to your instances initialized with a new <tt>ActiveModel::Errors</tt> object, so # there is no need for you to do this manually. + # module Validations extend ActiveSupport::Concern @@ -221,6 +222,7 @@ module ActiveModel # @data[key] # end # end + # alias :read_attribute_for_validation :send protected diff --git a/activemodel/lib/active_model/validations/validates.rb b/activemodel/lib/active_model/validations/validates.rb index b6a1cfcf41..d94c4e3f4f 100644 --- a/activemodel/lib/active_model/validations/validates.rb +++ b/activemodel/lib/active_model/validations/validates.rb @@ -77,6 +77,7 @@ module ActiveModel # Or to all at the same time: # # validates :password, :presence => true, :confirmation => true, :if => :password_required? + # def validates(*attributes) defaults = attributes.extract_options!.dup validations = defaults.slice!(*_validates_default_keys) diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index de1a271dde..2953126c3c 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -94,6 +94,7 @@ module ActiveModel #:nodoc: # # This setup method is only called when used with validation macros or the # class level <tt>validates_with</tt> method. + # class Validator attr_reader :options @@ -101,6 +102,7 @@ module ActiveModel #:nodoc: # # PresenceValidator.kind # => :presence # UniquenessValidator.kind # => :uniqueness + # def self.kind @kind ||= name.split('::').last.underscore.sub(/_validator$/, '').to_sym unless anonymous? end |