- 31 1月, 2017 10 次提交
-
-
由 Kevin Huang 提交于
-
由 Rafael França 提交于
Specify complete path to AR::LegacyYamlAdapter
-
由 Aaron Patterson 提交于
Lambda scopes require a bunch more work. Ideally the `scope` list would be a homogeneous collection. In this case, the reflection knows how to construct the right reflection for this join, so lets just construct that relation rather than instance execing to figure it out later.
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
`PolymorphicReflection` needs to be custom for handling scope lambdas
-
由 eileencodes 提交于
Each reflection should be responsible for returning the scopes needed to query against the db.
-
由 Jared Beck 提交于
I can never remember if it returns `self` or `true` (seems to be `true`) [ci skip]
-
由 Jordan Lewis 提交于
column_definitions() needs to fetch the collation for every column, if present. Previously, it did so using a correlated subquery - a subquery that references results from the outer scope. This patch updates the query to remove the subquery in favor of a simpler and more efficient JOIN clause. Running the two queries through EXPLAIN against Postgres additionally shows that the original form with a correlated subquery requires a Nested Loop Left Join, while the new form with a simple JOIN can use a more efficient Merge Left Join.
-
- 30 1月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 27 1月, 2017 1 次提交
-
-
由 Akira Matsuda 提交于
this probably fixes #25840
-
- 24 1月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
Follow up to 249f71a2
-
- 22 1月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
Since `Migration` module is included in both `MigrationGenerator` and `ModelGenerator`, no need to define a common method for each class.
-
- 19 1月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
These internal initialize methods are no longer used internally.
-
由 Matthew Draper 提交于
This reverts commit 39c77eb1, reversing changes made to 9f6f51be.
-
- 18 1月, 2017 2 次提交
-
-
由 Matthew Draper 提交于
* Don't force PKs on tables that have explicitly opted out * All integer-like PKs are autoincrement unless they have an explicit default
-
由 Ryuta Kamizono 提交于
Remove `initialize_schema_migrations_table` and `initialize_internal_metadata_table` internal public methods These internal methods accidentally appeared in the doc, and so almost useless. It is enough to create these internal tables directly, and indeed do so in several places. https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/schema.rb#L55 https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/railties/databases.rake#L6 https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/tasks/database_tasks.rb#L230
-
- 17 1月, 2017 2 次提交
-
-
-
由 Kevin Glowacz 提交于
-
- 16 1月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
Raise `ActiveRecord::InvalidForeignKey` when a record cannot be inserted or updated because it references a non-existent record for SQLite3 adapter.
-
由 Kasper Timm Hansen 提交于
`timestamp_attributes_for_updates_in_model` returns an empty array when a model has no `updated_at` or `updated_on`. So my previously thought uncommon case is a lot more likely now. This reverts commit a0a1ede8.
-
由 Kasper Timm Hansen 提交于
Closes #27683. Seeing a code sample that leads to what we're guarding against: ```ruby Topic.update_counters(1, replies_count: 1, touch: []) ``` It doesn't look like a case people would ever intentionally end up with. Thus we're better off sparing the conditional. Note: it could happen if a method returns an empty array that's then passed to `update_counters` and its touchy friends. But `[].presence` can fix that once people see their query blow up. [ Eugene Kenny & Kasper Timm Hansen ]
-
- 15 1月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
`type_condition` should be overwritten by `create_with_value`. So `type` in `create_with_value` should be a string because `where_values_hash` keys are converted to string. Fixes #27600.
-
- 14 1月, 2017 2 次提交
-
-
由 eileencodes 提交于
If a process is forked more than once, the pool was grabbing the oldest spec, not the most recent spec. This wasn't noticed before because most folks are lilely forking the process only once. If you're forking the process multiple times however the wrong spec name will be returned and an incorrect connection will be used for the process. This fixes the issue by reversing the list of spec names so we can grab the most recent spec rather than the oldest spec.
-
由 akihiro17 提交于
Supports the `touch` option from update_counters. The default behavior is not to update timestamp columns.
-
- 13 1月, 2017 1 次提交
-
-
由 Akira Matsuda 提交于
because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
-
- 12 1月, 2017 2 次提交
-
-
由 Akira Matsuda 提交于
(I personally prefer writing one string in one line no matter how long it is, though)
-
由 Akira Matsuda 提交于
-
- 11 1月, 2017 1 次提交
-
-
由 Kouhei Sutou 提交于
-
- 10 1月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Passing a class to `has_and_belongs_to_many` show deprecation message three times. It is enough only once.
-
由 Kir Shatrov 提交于
The idea of `class_name` as an option of reflection is that passing a string would allow us to lazy autoload the class. Using `belongs_to :client, class_name: Customer` is eagerloading models more than necessary and creating possible circular dependencies.
-
- 09 1月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
UUID primary key with no default value feature (#10404, #18206) was lost in legacy migration caused by #25395 got merged. Restore the feature again in legacy migration.
-
- 07 1月, 2017 2 次提交
-
-
由 Nick LaMuro 提交于
Avoids a NoMethodError when table_name is a symbol instead of a string.
-
由 schneems 提交于
In Rails 4.2 calling `ActiveRecord::Migrator.migrate` would return an array of results. Without realizing that this return type was expected I accidentally introduced a change in https://github.com/rails/rails/commit/4d60e93174a3d6d90b1a06fc7515cb5cd749a6f3 This PR preserves the previous behavior and adds a test on the return type. This will need a backport to 5.0 branch.
-
- 05 1月, 2017 4 次提交
-
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
-
由 Akira Matsuda 提交于
-
由 Ryuta Kamizono 提交于
Need `table_name` to avoid all databases scan. See https://dev.mysql.com/doc/refman/5.7/en/information-schema-optimization.html. ``` > EXPLAIN SELECT fk.referenced_table_name AS 'to_table', fk.referenced_column_name AS 'primary_key', fk.column_name AS 'column', fk.constraint_name AS 'name', rc.update_rule AS 'on_update', rc.delete_rule AS 'on_delete' FROM information_schema.key_column_usage fk JOIN information_schema.referential_constraints rc USING (constraint_schema, constraint_name) WHERE fk.referenced_column_name IS NOT NULL AND fk.table_schema = 'activerecord_unittest' AND fk.table_name = 'fk_test_has_pk' AND rc.table_name = 'fk_test_has_pk'\G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: fk partitions: NULL type: ALL possible_keys: NULL key: TABLE_SCHEMA,TABLE_NAME key_len: NULL ref: NULL rows: NULL filtered: NULL Extra: Using where; Open_full_table; Scanned 0 databases *************************** 2. row *************************** id: 1 select_type: SIMPLE table: rc partitions: NULL type: ALL possible_keys: NULL key: TABLE_NAME key_len: NULL ref: NULL rows: NULL filtered: NULL Extra: Using where; Open_full_table; Scanned 1 database; Using join buffer (Block Nested Loop) 2 rows in set, 1 warning (0.00 sec) ``` Fixes #27579.
-