Use frozen string literal in activemodel/

This commit is contained in:
Kir Shatrov 2017-07-16 20:11:16 +03:00
parent 83f39a3bcf
commit d7b1521db8
117 changed files with 232 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/hash_with_indifferent_access"
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/string/inflections"
require "active_support/core_ext/object/deep_dup"

View File

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

View File

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

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel
# == 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/module/introspection"
require "active_support/core_ext/module/remove_method"

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel
module SecurePassword
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/slice"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActiveModel
module Type
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/hash/keys"
require "active_support/core_ext/hash/except"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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