| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| | |
Check for valid options in validate method
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change prevents a certain class of user error which results when
mistakenly using the `validate` class method instead of the `validates`
class method.
Only apply when all arguments are symbols, because some validations use
the `validate` method and pass in additional options, namely the
`LenghValidator` via the `ActiveMode::Validations::validates_with`
method.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
These tests were passing before because the precision were not using to
cast the value. Not it is being used so it would fail on sqlite3
|
| |
| |
| |
| |
| | |
One of the branches is using a proc to check if the value respond_to a
method so it is better to not do case comparations
|
|\ \
| | |
| | |
| | | |
Fix rational to decimal on type_cast_from_user
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
|/|
| |
| |
| | |
only on forking systems though. Feel free to revert this if it causes
problems.
|
| |
| |
| |
| |
| |
| |
| |
| | |
"recall" is a terrible name. This variable contains the parameters that
we got from the path (e.g. for "/posts/1" it has :controller => "posts",
:id => "1"). Since it contains the parameters we got from the path,
"path_parameters" is a better name. We always pass path_parameters to
`generate`, so lets make it required.
|
| |
| |
| |
| |
| | |
this allows us to avoid 2 hash allocations per named helper definition,
also we can avoid a `merge` and `delete`.
|
| |
| |
| |
| |
| |
| |
| | |
Also make it accept a list of attributes to be changed. This will make
possible to restore only a subset of the changed attributes.
Closes #16203
|
| |
| |
| |
| |
| |
| | |
since we know that the route should be a path or fully qualified, we can
pass a strategy object that handles generation. This allows us to
eliminate an "if only_path" branch when generating urls.
|
| |
| |
| |
| |
| | |
also if you want a path from a named helper, you should call
helper_path, not helper_url(:only_path => true).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[Jonas Baumann & Yves Senn]
The submitted params from a select with `multiple: true` look as follows:
```
{post: {category: [""]}}
{post: {category: ["", "Category 1", "Category 2"]}}
```
This is a follow up to #1552.
|
|\ \
| | |
| | | |
Remove need for macro instance var
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Same as we did for collection, removed the `@macro` instance var
and it is now set in each association. Unfortunately it can't be
left undefined in AssociationReflection so it has to be set there.
For now I am setting it to NotImplementedError since there is no
default macro and it changes based on the reflection type.
|
|\ \ \
| |/ /
|/| | |
Remove "profile and benchmark" line from command line guide
|
|/ /
| |
| |
| | |
The profiling and benchmarking commands are no longer built into Rails.
|
|\ \
| | |
| | | |
Fix broken list formatting in API docs [ci skip]
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
this way we only have to test for whether it is a rails app once.
|
| |
| |
| |
| |
| | |
Use an is_a check to ensure it's a Railsish app so we can avoid
respond_to calls everywhere.
|
| | |
|
| |
| |
| |
| |
| | |
Hopefully `object.class` always returns something that is_a?(Class), so
the previous logic didn't really make sense.
|
|\ \
| | |
| | | |
Remove unused 1:1 association :remote option
|
|/ /
| |
| | |
This option is unused, left over from pre-1.0 Rails to internally distinguish the location of the foreign key.
|
|\ \
| | |
| | | |
Revert "Rename to test_mysql_strict_mode_disabled_dont_override_global_sql_mode"
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit babc24c1b07c1fd58b9b3249b0256f9b0d45c0f0.
Conflicts:
activerecord/test/cases/adapters/mysql/connection_test.rb
activerecord/test/cases/adapters/mysql2/connection_test.rb
|
|\ \ \
| | | |
| | | | |
Fix typos in string_ext_test.rb
|
|/ / / |
|
|\ \ \ |
|
| |\ \ \
| | | | |
| | | | |
| | | | | |
Word truncation
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If we extract the options from the user facing method call ASAP, then we
can simplify internal logic.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The performance is almost the same with both implementations but this is
clear.
Before this patch:
Calculating -------------------------------------
small erb template 1452 i/100ms
-------------------------------------------------
small erb template 17462.1 (±13.3%) i/s - 85668 in 5.031395s
.Calculating -------------------------------------
small erb template with 1 partial
887 i/100ms
-------------------------------------------------
small erb template with 1 partial
8899.6 (±18.8%) i/s - 42576 in 5.009453s
.Calculating -------------------------------------
small erb template with 2 partials
666 i/100ms
-------------------------------------------------
small erb template with 2 partials
6821.5 (±8.8%) i/s - 33966 in 5.020791s
After the patch:
Calculating -------------------------------------
small erb template 1479 i/100ms
-------------------------------------------------
small erb template 15956.6 (±7.6%) i/s - 79866 in 5.036001s
.Calculating -------------------------------------
small erb template with 1 partial
841 i/100ms
-------------------------------------------------
small erb template with 1 partial
9242.2 (±6.9%) i/s - 46255 in 5.029497s
.Calculating -------------------------------------
small erb template with 2 partials
615 i/100ms
-------------------------------------------------
small erb template with 2 partials
6524.7 (±6.8%) i/s - 32595 in 5.020456s
You can find the benchmark code at
https://gist.github.com/rafaelfranca/dee31120cfdb1ddc3b56
|
|\ \ \ \ \
| |/ / / /
|/| | | |
| | | | | |
remove Set.new from DetailsKey::get, impacts rendering overhead
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Using ruby-prof, I noticed that Set#add had the largest 'self time'
percentage (5% of the overall time spent rendering) when
benchmarking the rendering of a small cached ERB template that was 3
lines long. It turns out it was from this line. I don't believe the
Set is necessary, either. Removing this line increases the rendering
ips using Benchmark::ips accordingly.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Treat invalid uuid as nil
Conflicts:
activerecord/CHANGELOG.md
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Implement required #encode_with
|