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
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