| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|\
| |
| | |
bypass preloading for ids_reader
|
| |
| |
| |
| |
| | |
when fetching ids for a collection, bypass preloading
to avoid the unnecessary performance overhead
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
| |
Allows two models to use the same table but have different primary keys.
|
| |
|
| |
|
| |
|
|
|
|
| |
object. Fixes a regression from 3.0.x
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With transactional fixtures enabled, the session records would end up in
@_current_transaction_records, and at the end of the transaction,
methods would be called on them that would trigger method_missing and
trigger attribute methods to be generated.
However, at this point the sessions table would not exist, and the
columns were not cached, so an exception would be raised because we
can't find the columns to generate attribute methods for.
Not sure exactly why this didn't crop up before but there have been
changes to the schema cache code and perhaps that means that column data
that was cached previously at that point is now uncached.
|
|
|
|
|
|
|
|
|
|
| |
It was a bad idea to rescue exceptions here. This can interfere with
transaction rollbacks which seems to be the cause of current CI
failure.
Instead, each adapter should implement its own DB-specific O(1)
implementation, and we fall back on the generic, slower, implementation
otherwise.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Example:
ActiveRecord::Migrator.migrate(path) do |migration|
migration.name =~ /User/
end
The above example will migrate only migrations with User in
the name
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
With this commit, ActiveRecord will also look for migrations
in db/migrate subdirectories.
|
|
|
|
|
|
|
| |
49ebe51 fixed copying migrations, but existing migrations would still
trigger warnings. The proper way to compare migrations is to ignore
origin lines - if migration is identical it means that we can
silently skip it, regardless where it comes from.
|
|
|
|
|
|
|
|
|
|
| |
There was a bug in ActiveRecord::Migration.copy method, which
prevented adding special comment about the origin of migration.
Because of that, the check if migration is identical or if it's
not and should be skipped was always saying that migration is
skipped, which was causing additional useless warnings about
skipped migrations.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Do not validate associated records marked for destruction
|
| |
| |
| |
| |
| |
| | |
The main reason for this change is to fix a bug where
`validates_associated` would prevent `accepts_nested_attributes_for`
with `allow_destroy: true` from destroying invalid associated records.
|
|\ \
| |/
|/| |
Fix sequence name with abstract classes.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit vastly reduces the impact of auto
explain logging when enabled, while keeping
a negligible cost when disabled.
The first implementation was based on the idea
of subscribing to "sql.active_record" when
needed, and unsubscribing once done. This is
the idea behind AR::Relation#explain. Subscribe,
collect, unsubscribe.
But with the current implementation of notifications
unsubscribing is costly, because it wipes an internal
cache and that puts a penalty on the next event.
So we are switching to an approach where a long-running
subscriber is listening. Instead of collecting the
queries with a closure in a dedicated subscriber, now
we setup a thread local.
If the feature is disabled by setting the threshold
to nil, the subscriber will call a method that does
nothing. That's totally cheap.
|
| |
|
| |
|
|
|
|
|
| |
We also need to time zone convert time zone aware attributes when
accessed via read_attribute, not only when via direct access.
|
|
|
|
|
|
|
| |
Rationale: As discussed with José and Jon, this convenience
shortcut is not clearly justified and it could let the user
thing the disabled EXPLAINs are related to the model instance
rather than being globally disabled.
|
|\
| |
| | |
reintroduce patch from #726 to handle nested eager loading via associations
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This means we never have to rely on define_method (which is slower and
uses more memory), even when we have attributes containing characters
that are not allowed in standard method names.
(I am mainly changing this because the duplication annoys me, though.)
|
| |
| |
| |
| |
| |
| |
| |
| | |
Also make it actually work.
It slows down all read_attribute accesses to map 'id' to whatever the PK
actually is, inside read_attribute. So instead make sure the necessary
methods are defined and that they redirect wherever they need to go.
|