CHANGELOG.md 1.4 KB
Newer Older
J
Jeremy Daer 已提交
1
## Rails 6.0.0.alpha (Unreleased) ##
E
eileencodes 已提交
2

3 4
*   Add `:private` option to ActiveSupport's `Module#delegate`
    in order to delegate methods as private:
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

        class User < ActiveRecord::Base
          has_one :profile
          delegate :date_of_birth, to: :profile, private: true

          def age
            Date.today.year - date_of_birth.year
          end
        end

        # User.new.age  # => 29
        # User.new.date_of_birth
        # => NoMethodError: private method `date_of_birth' called for #<User:0x00000008221340>

    *Tomas Valent*

21 22 23 24 25
*   `String#truncate_bytes` to truncate a string to a maximum bytesize without
    breaking multibyte characters or grapheme clusters like 👩‍👩‍👦‍👦.

    *Jeremy Daer*

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
*   `String#strip_heredoc` preserves frozenness.

        "foo".freeze.strip_heredoc.frozen?  # => true

    Fixes that frozen string literals would inadvertently become unfrozen:

        # frozen_string_literal: true

        foo = <<-MSG.strip_heredoc
          la la la
        MSG

        foo.frozen?  # => false !??

    *Jeremy Daer*

J
Jeremy Daer 已提交
42 43 44 45 46 47 48 49 50
*   Rails 6 requires Ruby 2.4.1 or newer.

    *Jeremy Daer*

*   Adds parallel testing to Rails

    Parallelize your test suite with forked processes or threads.

    *Eileen M. Uchitelle*, *Aaron Patterson*
E
eileencodes 已提交
51

52

53
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/activesupport/CHANGELOG.md) for previous changes.