- 17 6月, 2020 1 次提交
-
-
由 Ross Kaffenberger 提交于
This change swaps the CommonJS require() syntax in the Webpacker application.js pack template file and in documentation examples with ES module import syntax. Benefits of this change include: Provides continuity with the larger frontend community: Arguably, one of the main draws in adopting Webpacker is its integration with Babel to support ES module syntax. For a fresh Rails install with Webpacker, the application.js file will be the first impression most Rails developers have with webpack and Webpacker. Most of the recent documentation and examples they will find online for using other libraries will be based on ES module syntax. Reduces confusion: Developers commonly add ES imports to their application.js pack, typically by following online examples, which means mixing require() and import statements in a single file. This leads to confusion and unnecessary friction about differences between require() and import. Embraces browser-friendliness: The ES module syntax forward-looking and is meant to be supported in browsers. On the other hand, require() syntax is synchronous by design and not browser-supported as CommonJS originally was adopted in Node.js for server-side JavaScript. That webpack supports require() syntax is merely a convenience. Encourages best practices regarding optimization: webpack can statically analyze ES modules and "tree-shake", i.e., strip out unused exports from the final build (given certain conditions are met, including `sideEffects: false` designation in package.json).
-
- 14 6月, 2020 16 次提交
-
-
由 Ryuta Kamizono 提交于
Restore attribute alias resolution for `attribute_{for_inspect,present?}`
-
由 Ryuta Kamizono 提交于
It is almost no longer used in Active Record.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Backward compatibility to work `Marshal.load(legacy_relation.dump)`
-
由 Ryuta Kamizono 提交于
Follow up to c07dff72. Actually it is not the cop's fault, but we mistakenly use `^`, `$`, and `\Z` in much places, the cop doesn't correct those conservatively. I've checked all those usage and replaced all safe ones.
-
由 Ryuta Kamizono 提交于
Follow up to fc0090b3.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
It is considered as a regression for #34384.
-
由 Jonathan Hefner 提交于
Use bash code fences and prompts for shell code [ci skip]
-
由 Jonathan Hefner 提交于
Follow-up to #39594, which added CSS in order to select shell commands sans prompts on triple-click. This commit adds several bash code fences and prompts where they were missing, and removes a few where they were inappropriate.
-
由 Eugene Kenny 提交于
Use COMPONENT_ROOT as app_root when present in test unit reporting.
-
由 Josef Šimánek 提交于
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
Use html-based edge badge instead of image
-
由 Xavier Noria 提交于
Easier shell command selection in Rails guide
-
由 Josef Šimánek 提交于
-
- 13 6月, 2020 6 次提交
-
-
由 Benoit Tigeot 提交于
Shell prompt is already unselectable Co-authored-by: NJonathan Hefner <jonathan@hefner.pro>
-
由 Ryuta Kamizono 提交于
Add a setting to specify that all string columns should be immutable
-
由 Ryuta Kamizono 提交于
All types are supported for PostgreSQL >= 9.3.
-
由 Ryuta Kamizono 提交于
ActiveRecord PostgreSQL adapter: parse quoted values in range output
-
由 Ryuta Kamizono 提交于
A relation has a predicate builder, so if a predicate handler which is referenced by a legacy predicate builder is removed in the new code, `Marshal.load(legacy_relation.dump)` will fail due to referencing undefined constant. I've restored no-op `BaseHandler` constant alias to make cache rotation easier during Rails 6.1. Fixes #39601.
-
由 Ryuta Kamizono 提交于
And benchmark with this branch for immutable string type: ```ruby ActiveRecord::Schema.define do create_table :users, force: true do |t| t.string :name t.string :fast_name end end class User < ActiveRecord::Base attribute :fast_name, :immutable_string end user = User.new Benchmark.ips do |x| x.report("user.name") do user.name = "foo" user.name_changed? end x.report("user.fast_name") do user.fast_name = "foo" user.fast_name_changed? end end ``` ``` Warming up -------------------------------------- user.name 34.811k i/100ms user.fast_name 39.505k i/100ms Calculating ------------------------------------- user.name 343.864k (± 3.6%) i/s - 1.741M in 5.068576s user.fast_name 384.033k (± 2.7%) i/s - 1.936M in 5.044425s ```
-
- 12 6月, 2020 3 次提交
-
-
由 Benoit Tigeot 提交于
-
由 Kerollos Magdy 提交于
-
由 Vipul A M 提交于
Fix broken references to classic mode guide where possible and use new guide where appropriate (#39603) [ci skip]
-
- 11 6月, 2020 6 次提交
-
-
由 Rafael Mendonça França 提交于
Upgrade-safe URL-safe CSRF tokens
-
由 Étienne Barrié 提交于
This allows applications to safely upgrade to Rails 6.1 without breaking tokens while the deploy is still being rolled out.
-
由 Vipul A M 提交于
[ci skip] 4.2 Release Notes - Update link to autoloading guide to classic mode guide inst…
-
由 Sean Griffin 提交于
In Rails 4.2 we introduced mutation detection, to remove the need to call `attribute_will_change!` after modifying a field. One side effect of that change was that we needed to enforce that the `_before_type_cast` form of a value is a different object than the post type cast value, if the value is mutable. That contract is really only relevant for strings, but it meant we needed to dup them. In Rails 5 we added the `ImmutableString` type, to allow people to opt out of this duping in places where the memory usage was causing problems, and they don't need to mutate that field. This takes that a step further, and adds a class-level setting to specify whether strings should be frozen by default or not. The default value of this setting is `false` (strings are mutable), and I do not plan on changing that. While I think that immutable strings by default would be a reasonable default for new applications, I do not think that we would be able to document the value of this setting in a place that people will be looking when they can't figure out why some string is frozen. Realistically, the number of applications where this setting is relevant is fairly small, so I don't think it would make sense to ever enable it by default.
-
由 Chris Andreae 提交于
PostgreSQL uses nested quoting on output for values inside range or composite types under certain conditions(*), which include the format for timestamps. ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Range doesn't handle this in #cast_value. (*) If their string representation contains parentheses, commas, double quotes, backslashes or whitespace (manual section 8.17.5, 8.16.6). This results in a string containing nested quotes being passed to AR::CA::PostgreSQL::OID::DateTime, which causes two problems: * The special-case handling for BCE dates is bypassed, resulting in incorrect positive instead of negative year values. * ActiveModel::Type::DateTime's fast_string_to_time parser can't be used and falls back to Date._parse Note that this PR only implements the escaped range bound format when parsing Postgres output, not when serializing values for Postgres. Postgres also requires its input to be escaped in the same cases, with the exception of whitespace. Fortunately, none of Postgres' pre-defined range types use any characters requiring escaping other than whitespace. See Rails PR #39585 for the serialization side.
-
由 Ryuta Kamizono 提交于
Use statement cache for STI classes
-
- 10 6月, 2020 8 次提交
-
-
由 mstroming 提交于
-
由 Eugene Kenny 提交于
Use indifferent access for config hash in actioncable postgresql test
-
由 Tim Craft 提交于
-
由 Eugene Kenny 提交于
Strict match when choosing cookie domain for host
-
由 Ryuta Kamizono 提交于
Deprecate `map!` and `collect!` on `ActiveRecord::Result`
-
由 Ryuta Kamizono 提交于
These actually does not inplace mutate result. Use true `map` instead.
-
由 Jonathan Hefner 提交于
Revise encrypted credentials section [ci skip]
-
由 Jonathan Hefner 提交于
Unify coverage of collection helpers [ci skip]
-