1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #29819 from kirs/frozen-activemodel

Use frozen string literal in activemodel/
This commit is contained in:
Matthew Draper 2017-07-17 09:16:06 +09:30 committed by GitHub
commit 47eadb68bf
117 changed files with 232 additions and 0 deletions

View file

@ -85,6 +85,7 @@ Style/FrozenStringLiteralComment:
EnforcedStyle: always EnforcedStyle: always
Include: Include:
- 'activesupport/**/*' - 'activesupport/**/*'
- 'activemodel/**/*'
- 'activejob/**/*' - 'activejob/**/*'
# Use `foo {}` not `foo{}`. # Use `foo {}` not `foo{}`.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rake/testtask" require "rake/testtask"
task default: :test task default: :test

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip
Gem::Specification.new do |s| Gem::Specification.new do |s|

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# frozen_string_literal: true
COMPONENT_ROOT = File.expand_path("..", __dir__) COMPONENT_ROOT = File.expand_path("..", __dir__)
require_relative "../../tools/test" require_relative "../../tools/test"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
#-- #--
# Copyright (c) 2004-2017 David Heinemeier Hansson # Copyright (c) 2004-2017 David Heinemeier Hansson
# #

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "concurrent/map" require "concurrent/map"
require "mutex_m" require "mutex_m"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/array/extract_options" require "active_support/core_ext/array/extract_options"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
# == Active \Model \Conversion # == Active \Model \Conversion
# #

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/hash_with_indifferent_access" require "active_support/hash_with_indifferent_access"
require "active_support/core_ext/object/duplicable" require "active_support/core_ext/object/duplicable"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/array/conversions" require "active_support/core_ext/array/conversions"
require "active_support/core_ext/string/inflections" require "active_support/core_ext/string/inflections"
require "active_support/core_ext/object/deep_dup" require "active_support/core_ext/object/deep_dup"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
# Raised when forbidden attributes are used for mass assignment. # Raised when forbidden attributes are used for mass assignment.
# #

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
# Returns the version of the currently loaded \Active \Model as a <tt>Gem::Version</tt> # Returns the version of the currently loaded \Active \Model as a <tt>Gem::Version</tt>
def self.gem_version def self.gem_version

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Lint module Lint
# == Active \Model \Lint \Tests # == Active \Model \Lint \Tests

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
# == Active \Model \Basic \Model # == Active \Model \Basic \Model
# #

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/except" require "active_support/core_ext/hash/except"
require "active_support/core_ext/module/introspection" require "active_support/core_ext/module/introspection"
require "active_support/core_ext/module/remove_method" require "active_support/core_ext/module/remove_method"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_model" require "active_model"
require "rails" require "rails"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module SecurePassword module SecurePassword
extend ActiveSupport::Concern extend ActiveSupport::Concern

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/except" require "active_support/core_ext/hash/except"
require "active_support/core_ext/hash/slice" require "active_support/core_ext/hash/slice"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/json" require "active_support/json"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
# == Active \Model \Translation # == Active \Model \Translation
# #

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "type/helpers" require_relative "type/helpers"
require_relative "type/value" require_relative "type/value"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "integer" require_relative "integer"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
class Binary < Value # :nodoc: class Binary < Value # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
# == Active \Model \Type \Boolean # == Active \Model \Type \Boolean

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
class Date < Value # :nodoc: class Date < Value # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
class DateTime < Value # :nodoc: class DateTime < Value # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "bigdecimal/util" require "bigdecimal/util"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
class Float < Value # :nodoc: class Float < Value # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "helpers/accepts_multiparameter_time" require_relative "helpers/accepts_multiparameter_time"
require_relative "helpers/numeric" require_relative "helpers/numeric"
require_relative "helpers/mutable" require_relative "helpers/mutable"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
module Helpers # :nodoc: all module Helpers # :nodoc: all

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
module Helpers # :nodoc: all module Helpers # :nodoc: all

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
module Helpers # :nodoc: all module Helpers # :nodoc: all

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/time/zones" require "active_support/core_ext/time/zones"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
class ImmutableString < Value # :nodoc: class ImmutableString < Value # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
class Integer < Value # :nodoc: class Integer < Value # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
# :stopdoc: # :stopdoc:
module Type module Type

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "immutable_string" require_relative "immutable_string"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
class Time < Value # :nodoc: class Time < Value # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Type module Type
class Value class Value

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/array/extract_options" require "active_support/core_ext/array/extract_options"
require "active_support/core_ext/hash/keys" require "active_support/core_ext/hash/keys"
require "active_support/core_ext/hash/except" require "active_support/core_ext/hash/except"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
# == \Active \Model Absence Validator # == \Active \Model Absence Validator

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
class AcceptanceValidator < EachValidator # :nodoc: class AcceptanceValidator < EachValidator # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
# == Active \Model \Validation \Callbacks # == Active \Model \Validation \Callbacks

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/range" require "active_support/core_ext/range"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
class ConfirmationValidator < EachValidator # :nodoc: class ConfirmationValidator < EachValidator # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "clusivity" require_relative "clusivity"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
class FormatValidator < EachValidator # :nodoc: class FormatValidator < EachValidator # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
module HelperMethods # :nodoc: module HelperMethods # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "clusivity" require_relative "clusivity"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
class LengthValidator < EachValidator # :nodoc: class LengthValidator < EachValidator # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
class NumericalityValidator < EachValidator # :nodoc: class NumericalityValidator < EachValidator # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel module ActiveModel
module Validations module Validations
class PresenceValidator < EachValidator # :nodoc: class PresenceValidator < EachValidator # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/slice" require "active_support/core_ext/hash/slice"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/array/extract_options" require "active_support/core_ext/array/extract_options"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/module/anonymous" require "active_support/core_ext/module/anonymous"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "gem_version" require_relative "gem_version"
module ActiveModel module ActiveModel

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_support/core_ext/hash/indifferent_access" require "active_support/core_ext/hash/indifferent_access"
require "active_support/hash_with_indifferent_access" require "active_support/hash_with_indifferent_access"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
class ModelWithAttributes class ModelWithAttributes

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
class CallbacksTest < ActiveModel::TestCase class CallbacksTest < ActiveModel::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/contact" require "models/contact"
require "models/helicopter" require "models/helicopter"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
class DirtyTest < ActiveModel::TestCase class DirtyTest < ActiveModel::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_support/core_ext/string/strip" require "active_support/core_ext/string/strip"
require "yaml" require "yaml"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_support/core_ext/hash/indifferent_access" require "active_support/core_ext/hash/indifferent_access"
require "models/account" require "models/account"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_model" require "active_model"
# Show backtraces for deprecated behavior for quicker cleanup. # Show backtraces for deprecated behavior for quicker cleanup.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
class LintTest < ActiveModel::TestCase class LintTest < ActiveModel::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
class ModelTest < ActiveModel::TestCase class ModelTest < ActiveModel::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/contact" require "models/contact"
require "models/sheep" require "models/sheep"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_support/testing/isolation" require "active_support/testing/isolation"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/user" require "models/user"
require "models/visitor" require "models/visitor"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_support/core_ext/object/instance_variables" require "active_support/core_ext/object/instance_variables"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/contact" require "models/contact"
require "active_support/core_ext/object/instance_variables" require "active_support/core_ext/object/instance_variables"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/person" require "models/person"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"
require "active_support/core_ext/numeric/time" require "active_support/core_ext/numeric/time"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_model/type" require "active_model/type"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"
require "models/person" require "models/person"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
class Dog class Dog

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_support/core_ext/numeric/time" require "active_support/core_ext/numeric/time"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/person" require "models/person"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/person" require "models/person"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "active_support/all" require "active_support/all"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/person" require "models/person"
require "models/topic" require "models/topic"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "cases/helper" require "cases/helper"
require "models/topic" require "models/topic"

Some files were not shown because too many files have changed in this diff Show more