Skip to Content Skip to Search

module ActiveSupport

Active Support – Utility classes and Ruby extensions from Rails

Active Support is a collection of utility classes and standard library extensions that were found useful for the Rails framework. These additions reside in this package so they can be loaded as needed in Ruby projects outside of Rails.

You can read more about the extensions in the Active Support Core Extensions guide.

Download and installation

The latest version of Active Support can be installed with RubyGems:

$ gem install activesupport

Source code can be downloaded as part of the Rails project on GitHub:

License

Active Support is released under the MIT license:

Support

API documentation is at:

Bug reports for the Ruby on Rails project can be filed here:

Feature requests should be discussed on the rails-core mailing list here:

Public class methods

Source code GitHub
# File activesupport/lib/active_support.rb, line 106
def self.cache_format_version
  Cache.format_version
end
Source code GitHub
# File activesupport/lib/active_support.rb, line 110
def self.cache_format_version=(value)
  Cache.format_version = value
end
Source code GitHub
# File activesupport/lib/active_support.rb, line 94
def self.eager_load!
  super

  NumberHelper.eager_load!
end

Returns the currently loaded version of Active Support as a Gem::Version.

Source code GitHub
# File activesupport/lib/active_support/gem_version.rb, line 5
def self.gem_version
  Gem::Version.new VERSION::STRING
end
Source code GitHub
# File activesupport/lib/active_support.rb, line 114
def self.to_time_preserves_timezone
  DateAndTime::Compatibility.preserve_timezone
end
Source code GitHub
# File activesupport/lib/active_support.rb, line 118
def self.to_time_preserves_timezone=(value)
  if !value
    ActiveSupport.deprecator.warn(
      "`to_time` will always preserve the receiver timezone rather than system local time in Rails 8.1. " \
      "To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
    )
  elsif value != :zone
    ActiveSupport.deprecator.warn(
      "`to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.1. " \
      "To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
    )
  end

  DateAndTime::Compatibility.preserve_timezone = value
end
Source code GitHub
# File activesupport/lib/active_support.rb, line 134
def self.utc_to_local_returns_utc_offset_times
  DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times
end
Source code GitHub
# File activesupport/lib/active_support.rb, line 138
def self.utc_to_local_returns_utc_offset_times=(value)
  DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times = value
end

Returns the currently loaded version of Active Support as a Gem::Version.

Source code GitHub
# File activesupport/lib/active_support/version.rb, line 7
def self.version
  gem_version
end

Namespace

Definition files

161 More Less