- 01 11月, 2015 4 次提交
-
-
由 Andrew White 提交于
Route generator should be idempotent
-
由 Vijay Dev 提交于
-
由 Arun Agrawal 提交于
Fix double word 'be' [ci skip]
-
由 Jake Worth 提交于
-
- 31 10月, 2015 15 次提交
-
-
由 Arun Agrawal 提交于
minor formatting changes [ci skip]
-
由 yuuji.yaginuma 提交于
* add newline for display the fenced code block * add "#" in the comments section
-
由 Thiago Pinto 提交于
-
由 Aaron Patterson 提交于
this allows us to construct mailer objects without possibly disastrous side-effects.
-
由 Sean Griffin 提交于
Alias left_joins to left_outer_joins
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Sean Griffin 提交于
Add test for parsing application/vnd.api+json
-
由 Rafael França 提交于
rails/application: allow passing an env to config_for
-
由 Simon Eskildsen 提交于
-
由 Aaron Patterson 提交于
we should be using a countdown latch instead of rolling our own busy-loop.
-
由 Sean Griffin 提交于
Make migrations concurrent safe (using advisory locks)
-
由 Sam Davies 提交于
- Addresses issue #22092 - Works on Postgres and MySQL - Uses advisory locks because of two important properties: 1. The can be obtained outside of the context of a transaction 2. They are automatically released when the session ends, so if a migration process crashed for whatever reason the lock is not left open perpetually - Adds get_advisory_lock and release_advisory_lock methods to database adapters - Attempting to run a migration while another one is in process will raise a ConcurrentMigrationError instead of attempting to run in parallel with undefined behavior. This could be rescued and the migration could exit cleanly instead. Perhaps as a configuration option? Technical Notes ============== The Migrator uses generate_migrator_advisory_lock_key to build the key for the lock. In order to be compatible across multiple adapters there are some constraints on this key. - Postgres limits us to 64 bit signed integers - MySQL advisory locks are server-wide so we have to scope to the database - To fulfil these requirements we use a Migrator salt (a randomly chosen signed integer with max length of 31 bits) that identifies the Rails migration process as the owner of the lock. We multiply this salt with a CRC32 unsigned integer hash of the database name to get a signed 64 bit integer that can also be converted to a string to act as a lock key in MySQL databases. - It is important for subsequent versions of the Migrator to use the same salt, otherwise different versions of the Migrator will not see each other's locks.
-
由 Sean Griffin 提交于
This assumes only one query was ever executed, but it appears to sometimes be loading schema information. We can just look at the array of queries, rather than the "first" one that was run
-
由 Takashi Kokubun 提交于
-
- 30 10月, 2015 21 次提交
-
-
由 Sean Griffin 提交于
When testing cache issues, it is useful to log the actual key, including namespace
-
由 Sean Griffin 提交于
added ActiveRecord::Relation#outer_joins
-
由 Rafael Mendonça França 提交于
We are using the same version constraint in the database adapters so when a new version of the adapter that doesn't work with the version of rails is released we don't break new applications.
-
由 Aaron Patterson 提交于
This reverts commit 9f93a5ef.
-
由 Sean Griffin 提交于
Before this commit, if `ActiveRecord::Base.belongs_to_required_by_default` is set to `true`, then creating a record through `has_and_belongs_to_many` fails with the cryptic error message `Left side must exist`. This is because `inverse_of` isn't working properly in this case, presumably since we're doing trickery with anonymous classes in the middle. Rather than following this rabbit hole to try and get `inverse_of` to work in a case that we know is not publicly supported, we can just turn off this validation to match the behavior of 4.2 and earlier.
-
由 Aaron Patterson 提交于
rather than an action name and *args. The *args were not being used in regular applications outside tests. This causes a backwards compatibility issue, but reduces array allocations for most users.
-
由 Aaron Patterson 提交于
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
Support SQL sanitization in AR::QueryMethods#order
-
由 eileencodes 提交于
`dispatch` sets the request and response on the controller for us automatically, so the test harness doesn't need to know the internals of how request / response is set. Conflicts: actionpack/lib/action_controller/test_case.rb
-
由 eileencodes 提交于
-
由 Sean Griffin 提交于
PostgreSQL, Replace static connection param list by libpq's dynamic list
-
由 Andrew White 提交于
Set standard_conforming_strings with SET
-
由 Harry Marr 提交于
-
由 Andrew White 提交于
ActiveSupport::TimeWithZone documentation
-
由 Sean Griffin 提交于
This is part of a refactoring to make it easier to allow `order` to use sanitize like just about everything else on relation. The deleted test doesn't give any reasoning as to why passing `nil` to `order` needs to be supported, and it's rather nonsensical. I can almost see allowing an empty string being passed (though I'm tempted to just disallow it...)
-
由 Yves Senn 提交于
default value for FixtureSet.fixture_class_names ought to be a Class
-
由 Phil Ross 提交于
The stated value of `now` would actually give the same result for `now - 24.hours` and `now - 1.day`. Use an alternative value for `now` that demonstrates the difference between subtracting `24.hours` and `1.day`.
-
由 Phil Ross 提交于
-
由 Jamis Buck 提交于
Look at `TestFixtures.set_fixture_class`. As documented, it accepts a mapping of fixture identifiers (string or symbol) to Classes (the model classes that implement the named fixture). Look now at the initialization of `TestFixtures.fixture_class_names`. It defines a Hash, which will return a string by default (where the string is the estimated class name of the given fixture identifier). Now look at TestFixtures.load_fixtures. It calls `FixtureSet.create_fixtures`, passing in the mapping of `fixture_class_names`. Following this on to `FixtureSet.create_fixtures`, this instantiates a `FixtureSet::ClassCache`, passing in the map of class names. `ClassCache`, in turn, calls `insert_class` for each value in the cache. (Recall that `set_fixture_class` puts Class objects in there, while the default proc for the mapping puts String objects.) Look finally at `insert_class`. If the value is present, it checks to see if the value is a subclass of `AR::Base`. Fair enough...but wait! What if the value is a String? You get an exception, because a String instance cannot be compared with a Class. Judging from the implementation, it seems like the expected behavior here is for `fixture_class_names` to have no default proc. Look-ups are supposed to happen via `ClassCache`, with `fixture_class_names` existing solely as a repository for explicitly-registered class mappings. That is what this change does.
-
由 Andrew White 提交于
-