| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When subclassing abstract_class table_name should be always computed
based on class name, no matter if superclass is subclassing base
or another abstract_class. So:
class FirstAbstract < ActiveRecord::Base
self.abstract_class = true
end
class SecondAbstract < FirstAbstract
self.abstract_class = true
end
class Post < SecondAbstract
self.table_name #=> 'posts' (not 'second_abstracts')
end
|
| |
|
|
|
|
| |
#[] and #[]= are no longer interchangeable with #read_attribute and #write_attribute
|
|
|
|
| |
correctly handle order calls after a reorder
|
| |
|
|
|
|
| |
allow reorder to affect eager loading correctly
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|