| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
Update callbacks skipping methods in guide.
[ci skip]
|
| | |
|
|\ \
| | |
| | | |
Ensure that rendered templates always have a format
|
| | |
| | |
| | |
| | |
| | | |
This removes one call to `lookup_context` and also eliminates a
conditional in `_render_template`.
|
| |/
|/|
| |
| | |
Somehow `ENV["BUILDKITE"]` didn't work as expected.
|
|\ \
| | |
| | | |
Pass lookup context to the layout handlers
|
| |/
| |
| |
| |
| |
| |
| | |
I want to start reducing the calls to `lookup_context`. That method
caches the lookup context in an ivar, but I would like to cache the
lookup context on the stack. That way we aren't coupled to the behavior
of the `lookup_context` method.
|
| |
| |
| |
| |
| |
| | |
Buildkite as well
https://buildkite.com/rails/rails/builds/58981#2423c707-7c56-4639-a76e-8db4fd1e5cf3/102-111
|
|\ \
| | |
| | |
| | |
| | | |
abhaynikam/35351-allows-rich-text-area-to-have-translated-placeholder
Allows rich_text_area_tag to add translated placeholder text if placeholder option set to true
|
| |/
| |
| |
| | |
placeholder option set to true
|
| | |
|
|\ \
| | |
| | | |
Bumps Zeitwerk
|
| | |
| | |
| | |
| | | |
Possible thanks to Zeitwerk 1.3.0.
|
| | |
| | |
| | |
| | | |
Possible thanks to Zeitwerk 1.3.0.
|
| |/ |
|
|\ \
| |/
|/| |
Fix `pluck` and `select` with `from` if `from` has original table name
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I'm not sure why the test is failed on Travis, it passed on locally.
I suspect that failure is a bug on SQLite3, so just skip the test for
now, since it was not covered by before.
https://travis-ci.org/rails/rails/jobs/496726410#L1198-L1208
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is caused by 0ee96d1.
Since #18744, `select` columns doesn't be qualified by table name if
using `from`. 0ee96d1 follows that for `pluck` as well.
But people depends that `pluck` columns are qualified even if using
`from`.
So I've fixed that to be qualified if `from` has the original table name
to keep the behavior as much as before.
Fixes #35359.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The argument of `_update_record` and `_create_record` is
`attribute_names`, that is reserved for overriding by partial writes
attribute names.
https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/persistence.rb#L719
https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/persistence.rb#L737
https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/attribute_methods/dirty.rb#L171
https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/attribute_methods/dirty.rb#L177
The reason that no failing with extra args is that `Timestamp` module
which is most outside module of the `_update_record` discards the extra
args.
https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/timestamp.rb#L104
But that looks odd dependency. It should not be passed extra args,
should only be passed attribute names.
|
|\
| |
| | |
Define Rails.autoloaders.logger=
|
| | |
|
|\ \
| |/
|/|
| |
| | |
kamipo/dont_allow_non_numeric_string_matches_to_zero
Don't allow `where` with non numeric string matches to 0 values
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a follow-up of #35310.
Currently `Topic.find_by(id: "not-a-number")` matches to a `id = 0`
record. That is considered as silently leaking information.
If non numeric string is given to find by an integer column, it should
not be matched to any record.
Related #12793.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
collation issues
In MySQL, the default collation is case insensitive. Since the
uniqueness validator enforces case sensitive comparison by default, it
frequently causes mismatched collation issues (performance, weird
behavior, etc) to MySQL users.
https://grosser.it/2009/12/11/validates_uniqness_of-mysql-slow/
https://github.com/rails/rails/issues/1399
https://github.com/rails/rails/pull/13465
https://github.com/gitlabhq/gitlabhq/commit/c1dddf8c7d947691729f6d64a8ea768b5c915855
https://github.com/huginn/huginn/pull/1330#discussion_r55152573
This extracts `default_uniqueness_comparison` to ease to handle the
mismatched collation issues on the connection.
|
|\ \
| | |
| | | |
Fix lint `ShadowingOuterLocalVariable`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Revert "Fix lint `ShadowingOuterLocalVariable`"
This reverts commit 38bd45a48992b500478a82d56d31468a322937a8.
Change of variable name
Fix lint `ShadowingOuterLocalVariable`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 52fddcc653458456f98b3683dffd781cf00b35fe.
52fddcc was to short-circuit `ensure_in_range` in `cast_value`. But that
caused a regression for empty string deserialization.
Since 7c6f393, `ensure_in_range` is moved into `serialize`. As 52fddcc
said, the absolute gain is quite small. So I've reverted that commit to
fix the regression.
|
|\ \ \
| |/ /
|/| | |
Add missing require to active_storage.rb
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since b21f50d8ae36d9b50b673579e17bccbe55363b34, requiring active_storage
on its own has failed with the following error:
activestorage/lib/active_storage.rb:55:in `<module:ActiveStorage>': undefined method `minutes' for 5:Integer (NoMethodError)
|
|/ / |
|
|\ \
| | |
| | | |
[ci skip] actionview typo fixes.
|
|/ / |
|
| |
| |
| |
| | |
This covers what #34626 fixes.
|
|\ \
| | |
| | | |
Reduce unused allocations when casting UUIDs for Postgres
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Using the subscript method `#[]` on a string has several overloads and
rather complex implementation. One of the overloads is the capability to
accept a regular expression and then run a match, then return the
receiver (if it matched) or one of the groups from the MatchData.
The function of the `UUID#cast` method is to cast a UUID to a type and
format acceptable by postgres. Naturally UUIDs are supposed to be
string and of a certain format, but it had been determined that it was
not ideal for the framework to send just any old string to Postgres and
allow the engine to complain when "foobar" or "" was sent, being
obviously of the wrong format for a valid UUID. Therefore this code was
written to facilitate the checking, and if it were not of the correct
format, a `nil` would be returned as is conventional in Rails.
Now, the subscript method will allocate one or more strings on a match
and return one of them, based on the index parameter. However, there
is no need for a new string, as a UUID of the correct format is already
such, and so long as the format was verified then the string supplied is
adequate for consumption by the database.
The subscript method also creates a MatchData object which will never be
used, and so must eventually be garbage collected.
Garbage collection indeed. This innocuous method tends to be called
quite a lot, for example if the primary key of a table is a uuid, then
this method will be called. If the foreign key of a relation is a UUID,
once again this method is called. If that foreign key is belonging to
a has_many relationship with dozens of objects, then again dozens of
UUIDs shall be cast to a dup of themselves, and spawn dozens of
MatchData objects, and so on.
So, for users that:
* Use UUIDs as primary keys
* Use Postgres
* Operate on collections of objects
This accomplishes a significant savings in total allocations, and may
save many garbage collections.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
cpruitt/fix-actionview-notimplemented-with-path-set
Deprecate ActionView::PathSet as argument to ActionView::Base.new
|
|/ / /
| | |
| | |
| | | |
Currently, `ActionView::Base.new` will raise a `NotImplementedError` when given an instance of `ActionView::PathSet` on initialization. This commit prevents the raised error in favor of a deprecation warning.
|
|\ \ \
| | | |
| | | | |
[ci skip] Updated the documentation for bulk delete in activerecord
|
|/ / / |
|
|\ \ \
| |_|/
|/| | |
Replaced usage of where.delete/destroy_all with delete/destroy_by
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix reset of the source association when through association is loaded
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The special case happens when through association has a custom scope
that is applied to the source association when loading.
In this case, the soucre association would need to be reset after
main association is loaded. See tests.
The special case exists when a through association has
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
abhaynikam/add-query-method-delegation-test-for-destory-by-and-delete-by
Added delegation tests for delete_by and destroy_by methods
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Deprecate LookupContext#rendered_format
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We no longer depend on `rendered_format` side effects, so we can remove
this method now. 🎉
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Let Zeitwerk integration unhook AS::Dependencies
|