1. 31 1月, 2017 10 次提交
  2. 30 1月, 2017 1 次提交
  3. 27 1月, 2017 1 次提交
  4. 24 1月, 2017 1 次提交
  5. 22 1月, 2017 1 次提交
  6. 19 1月, 2017 2 次提交
  7. 18 1月, 2017 2 次提交
  8. 17 1月, 2017 2 次提交
  9. 16 1月, 2017 3 次提交
    • R
      Translate Foreign Key violation to the specific exception for SQLite3 adapter · 974f5fbb
      Ryuta Kamizono 提交于
      Raise `ActiveRecord::InvalidForeignKey` when a record cannot be inserted
      or updated because it references a non-existent record for SQLite3
      adapter.
      974f5fbb
    • K
      Revert "Don't guard against `touch: []`." · a5632d84
      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.
      a5632d84
    • K
      Don't guard against `touch: []`. · 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 ]
      a0a1ede8
  10. 15 1月, 2017 1 次提交
  11. 14 1月, 2017 2 次提交
    • E
      Fix pool_from_any_process to use most recent spec · e15a23fa
      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.
      e15a23fa
    • A
      Add the touch option to ActiveRecord#increment! and decrement! · bad9bfbe
      akihiro17 提交于
      Supports the `touch` option from update_counters.
      The default behavior is not to update timestamp columns.
      bad9bfbe
  12. 13 1月, 2017 1 次提交
  13. 12 1月, 2017 2 次提交
  14. 11 1月, 2017 1 次提交
  15. 10 1月, 2017 3 次提交
  16. 09 1月, 2017 1 次提交
  17. 07 1月, 2017 2 次提交
  18. 05 1月, 2017 4 次提交
    • A
      5f03172f
    • A
      `self.` is not needed when calling its own instance method · 5473e390
      Akira Matsuda 提交于
      Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
      5473e390
    • A
      This method is never called since 8e633e50 · d8e0282a
      Akira Matsuda 提交于
      d8e0282a
    • R
      Optimizing information_schema query for `foreign_keys` · 801a21e6
      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.
      801a21e6