Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Hiding self.include from RDoc, and final small touches.

  • Loading branch information...
commit 3525830ed384aeb45e28e36a1a60b4a2c5bdc623 1 parent 98c9701
Jonas Grimfelt grimen authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/validation_reflection.rb
9 lib/validation_reflection.rb
View
@@ -53,7 +53,7 @@ module ValidationReflection # :nodoc:
mattr_accessor :reflected_validations,
:in_ignored_subvalidation
- def included(base)
+ def included(base) # :nodoc:
return if base.kind_of?(::ActiveRecordExtensions::ValidationReflection::ClassMethods)
base.extend(ClassMethods)
end
@@ -76,7 +76,7 @@ def load_config
#
def install(base)
@@reflected_validations.each do |validation_type|
- next if base.respond_to?("#{validation_type}_with_reflection")
+ next if base.respond_to?(:"#{validation_type}_with_reflection")
ignore_subvalidations = false
if validation_type.kind_of?(::Hash)
@@ -105,14 +105,13 @@ module ClassMethods
# Returns an array of MacroReflection objects for all validations in the class
def reflect_on_all_validations
- read_inheritable_attribute(:validations) || []
+ self.read_inheritable_attribute(:validations) || []
end
# Returns an array of MacroReflection objects for all validations defined for the field +attr_name+.
def reflect_on_validations_for(attr_name)
- attr_name = attr_name.to_sym
self.reflect_on_all_validations.select do |reflection|
- reflection.name == attr_name
+ reflection.name == attr_name.to_sym
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.