aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 20:20:22 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 20:20:22 +0200
commitb326e82dc012d81e9698cb1f402502af1788c1e9 (patch)
tree6b6452129a5b6b684f3d44f21afd2b1bea83fa22 /activemodel/lib
parent80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (diff)
downloadrails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.gz
rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.bz2
rails-b326e82dc012d81e9698cb1f402502af1788c1e9.zip
applies remaining conventions across the project
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/lint.rb1
-rw-r--r--activemodel/lib/active_model/model.rb1
-rw-r--r--activemodel/lib/active_model/translation.rb1
-rw-r--r--activemodel/lib/active_model/type/decimal.rb18
-rw-r--r--activemodel/lib/active_model/validations.rb1
-rw-r--r--activemodel/lib/active_model/validations/acceptance.rb1
-rw-r--r--activemodel/lib/active_model/validations/confirmation.rb1
-rw-r--r--activemodel/lib/active_model/validations/exclusion.rb1
-rw-r--r--activemodel/lib/active_model/validations/inclusion.rb1
-rw-r--r--activemodel/lib/active_model/validations/length.rb1
-rw-r--r--activemodel/lib/active_model/validations/numericality.rb1
-rw-r--r--activemodel/lib/active_model/validations/presence.rb1
-rw-r--r--activemodel/lib/active_model/validator.rb1
13 files changed, 9 insertions, 21 deletions
diff --git a/activemodel/lib/active_model/lint.rb b/activemodel/lib/active_model/lint.rb
index 010eaeb170..291a545528 100644
--- a/activemodel/lib/active_model/lint.rb
+++ b/activemodel/lib/active_model/lint.rb
@@ -20,7 +20,6 @@ module ActiveModel
# to <tt>to_model</tt>. It is perfectly fine for <tt>to_model</tt> to return
# +self+.
module Tests
-
# Passes if the object's model responds to <tt>to_key</tt> and if calling
# this method returns +nil+ when the object is not persisted.
# Fails otherwise.
diff --git a/activemodel/lib/active_model/model.rb b/activemodel/lib/active_model/model.rb
index dac8d549a7..f5765c0c54 100644
--- a/activemodel/lib/active_model/model.rb
+++ b/activemodel/lib/active_model/model.rb
@@ -1,5 +1,4 @@
module ActiveModel
-
# == Active \Model \Basic \Model
#
# Includes the required interface for an object to interact with
diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb
index 8470915abb..75509b0588 100644
--- a/activemodel/lib/active_model/translation.rb
+++ b/activemodel/lib/active_model/translation.rb
@@ -1,5 +1,4 @@
module ActiveModel
-
# == Active \Model \Translation
#
# Provides integration between your object and the Rails internationalization
diff --git a/activemodel/lib/active_model/type/decimal.rb b/activemodel/lib/active_model/type/decimal.rb
index 273798593b..6266933636 100644
--- a/activemodel/lib/active_model/type/decimal.rb
+++ b/activemodel/lib/active_model/type/decimal.rb
@@ -17,16 +17,16 @@ module ActiveModel
def cast_value(value)
casted_value = case value
- when ::Float
- convert_float_to_big_decimal(value)
- when ::Numeric, ::String
- BigDecimal(value, precision.to_i)
+ when ::Float
+ convert_float_to_big_decimal(value)
+ when ::Numeric, ::String
+ BigDecimal(value, precision.to_i)
else
- if value.respond_to?(:to_d)
- value.to_d
- else
- cast_value(value.to_s)
- end
+ if value.respond_to?(:to_d)
+ value.to_d
+ else
+ cast_value(value.to_s)
+ end
end
apply_scale(casted_value)
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index 86f1418843..df6d3f2bcb 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -3,7 +3,6 @@ require "active_support/core_ext/hash/keys"
require "active_support/core_ext/hash/except"
module ActiveModel
-
# == Active \Model \Validations
#
# Provides a full validation framework to your objects.
diff --git a/activemodel/lib/active_model/validations/acceptance.rb b/activemodel/lib/active_model/validations/acceptance.rb
index 8484413950..4fadc795cd 100644
--- a/activemodel/lib/active_model/validations/acceptance.rb
+++ b/activemodel/lib/active_model/validations/acceptance.rb
@@ -1,5 +1,4 @@
module ActiveModel
-
module Validations
class AcceptanceValidator < EachValidator # :nodoc:
def initialize(options)
diff --git a/activemodel/lib/active_model/validations/confirmation.rb b/activemodel/lib/active_model/validations/confirmation.rb
index dcd0317f64..33ca6f6946 100644
--- a/activemodel/lib/active_model/validations/confirmation.rb
+++ b/activemodel/lib/active_model/validations/confirmation.rb
@@ -1,5 +1,4 @@
module ActiveModel
-
module Validations
class ConfirmationValidator < EachValidator # :nodoc:
def initialize(options)
diff --git a/activemodel/lib/active_model/validations/exclusion.rb b/activemodel/lib/active_model/validations/exclusion.rb
index 6f4276cc2a..82a1893823 100644
--- a/activemodel/lib/active_model/validations/exclusion.rb
+++ b/activemodel/lib/active_model/validations/exclusion.rb
@@ -1,7 +1,6 @@
require "active_model/validations/clusivity"
module ActiveModel
-
module Validations
class ExclusionValidator < EachValidator # :nodoc:
include Clusivity
diff --git a/activemodel/lib/active_model/validations/inclusion.rb b/activemodel/lib/active_model/validations/inclusion.rb
index 03e0ef56d8..0ea6012a5d 100644
--- a/activemodel/lib/active_model/validations/inclusion.rb
+++ b/activemodel/lib/active_model/validations/inclusion.rb
@@ -1,7 +1,6 @@
require "active_model/validations/clusivity"
module ActiveModel
-
module Validations
class InclusionValidator < EachValidator # :nodoc:
include Clusivity
diff --git a/activemodel/lib/active_model/validations/length.rb b/activemodel/lib/active_model/validations/length.rb
index 25a51c89cf..c924c8d2f8 100644
--- a/activemodel/lib/active_model/validations/length.rb
+++ b/activemodel/lib/active_model/validations/length.rb
@@ -97,7 +97,6 @@ module ActiveModel
end
module HelperMethods
-
# Validates that the specified attributes match the length restrictions
# supplied. Only one constraint option can be used at a time apart from
# +:minimum+ and +:maximum+ that can be combined together:
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb
index 21e6603ba4..af27955554 100644
--- a/activemodel/lib/active_model/validations/numericality.rb
+++ b/activemodel/lib/active_model/validations/numericality.rb
@@ -1,5 +1,4 @@
module ActiveModel
-
module Validations
class NumericalityValidator < EachValidator # :nodoc:
CHECKS = { greater_than: :>, greater_than_or_equal_to: :>=,
diff --git a/activemodel/lib/active_model/validations/presence.rb b/activemodel/lib/active_model/validations/presence.rb
index 5d593274eb..0c11cf4265 100644
--- a/activemodel/lib/active_model/validations/presence.rb
+++ b/activemodel/lib/active_model/validations/presence.rb
@@ -1,6 +1,5 @@
module ActiveModel
-
module Validations
class PresenceValidator < EachValidator # :nodoc:
def validate_each(record, attr_name, value)
diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb
index 9ee38c1239..9c6065f61f 100644
--- a/activemodel/lib/active_model/validator.rb
+++ b/activemodel/lib/active_model/validator.rb
@@ -1,7 +1,6 @@
require "active_support/core_ext/module/anonymous"
module ActiveModel
-
# == Active \Model \Validator
#
# A simple base class that can be used along with