• Sean McGivern's avatar
    Remove comma from weight system notes more efficiently · 2a0ad260
    Sean McGivern authored
    1. There is no index on system_note_metadata's action column, so add a partial
       one on 'weight'.
    2. update_column_in_batches expects a single column to be updated, but we need
       to null out note_html too. Using an SQL literal lets us get around this.
    3. Arel's UpdateManager doesn't support joins, so use a subquery instead.
    4. MySQL can't update from the same table referenced in the subquery. We use an
       alias to handle this case.
    2a0ad260
20180530201303_remove_commas_from_weight_note.rb 1.19 KB