rails/activerecord/test/support
Jean Boussier a0993f81d0 Define missing attribute methods from `method_missing`
Ref: https://github.com/mastodon/mastodon/issues/27622

If applications don't eager load and use the old Rails 6.1 Marshal
format, they can load Active Record instances from caches without
calling `init_internals` hence attribute methods and aliases are
nnot defined yet, leading to `NoMethodError`

Initially I was hopping to fully get rid of the `define_attribute_methods`
call in `init_internals` in favor of this new method missing, as it would
remove work from the happy path, unfortunately that isn't possible
because if a generated method overrides a default method inherited from
object, `method_missing` won't be called. e.g. `Kernel#format`

We may want to get rid of this extra code once we remove support
for the 6.1 marshal format.
2024-01-05 16:56:19 +01:00
..
marshal_compatibility_fixtures Define missing attribute methods from `method_missing` 2024-01-05 16:56:19 +01:00
stubs Change safe guard to check for each_pair instead of stringify_keys 2020-02-07 11:36:35 -05:00
yaml_compatibility_fixtures Change ActiveRecord::Coders::YAMLColumn default to safe_load 2022-07-12 09:26:46 -07:00
adapter_helper.rb Support `RETURNING` clause for MariaDB 2023-10-30 21:08:49 +02:00
async_helper.rb fix remaining asserts that should be assert_equal 2022-09-09 19:22:21 -04:00
config.rb Refactor lookup of connection adapters 2023-11-16 09:07:44 +01:00
connection.rb Separate the CI environment from the application CI environment 2023-10-04 09:36:51 +00:00
connection_helper.rb Deprecate `#remove_connection` in favor of `#remove_connection_pool` 2020-01-21 16:49:20 -05:00
ddl_helper.rb [Fix #47203]Fix state leakage between tests 2023-02-10 15:26:32 +00:00
fake_adapter.rb Refactor lookup of connection adapters 2023-11-16 09:07:44 +01:00
load_schema_helper.rb Move load_schema from Object to AR::TestCase 2023-01-01 21:43:24 +09:00
schema_dumping_helper.rb Change `SchemaDumper.dump` default stream to `$stdout` 2023-12-12 16:39:22 +02:00
tools.rb Don't run the adapter tests when a test selection is made 2023-02-13 21:25:01 +00:00