1. 20 1月, 2015 1 次提交
    • S
      Don't mutate bind values in `Relation` · 76d7d957
      Sean Griffin 提交于
      In order to better facilitate refactoring, most places that mutated
      `bind_values` have already been removed. One last spot snuck through.
      Since we're no longer mutating the array, it also does not need to be
      duped in `initialize_copy`.
      76d7d957
  2. 19 1月, 2015 1 次提交
    • S
      Don't calculate in-place changes on attribute assignment · ea721d70
      Sean Griffin 提交于
      When an attribute is assigned, we determine if it was already marked as
      changed so we can determine if we need to clear the changes, or mark it
      as changed. Since this only affects the `attributes_changed_by_setter`
      hash, in-place changes are irrelevant to this process. Since calculating
      in-place changes can be expensive, we can just skip it here.
      
      I also added a test for the only edge case I could think of that would
      be affected by this change.
      ea721d70
  3. 18 1月, 2015 1 次提交
  4. 16 1月, 2015 3 次提交
  5. 15 1月, 2015 6 次提交
  6. 13 1月, 2015 1 次提交
  7. 12 1月, 2015 1 次提交
  8. 11 1月, 2015 9 次提交
  9. 10 1月, 2015 7 次提交
    • S
      Fix typo in PostresSQLAdapter's documentation · a4139a16
      Sebastian Staudt 提交于
      a4139a16
    • C
      Remove support for the protected attributes gem · f4fbc030
      Carlos Antonio da Silva 提交于
      Related to #10690.
      f4fbc030
    • R
      Switch Secure Token generation to Base58 · 47316fee
      robertomiranda 提交于
      Update Secure Token Doc [ci skip]
      
      remove require securerandom, core_ext/securerandom already do that ref 7e006057
      47316fee
    • A
      Copy records to parent transaction should happen on TransactionManager · 86a853e4
      Arthur Neves 提交于
      It is up to the TransactionManager keep the state of current transaction, so after it commits it needs to copy any remaning record to the next current transaction
      86a853e4
    • A
      Use keyword args on committed! and rolledback! · c7f56d99
      Arthur Neves 提交于
      As discussed before, those methods should receive a keyword args instead of just parameters
      c7f56d99
    • S
      Properly copy nested bind values from subqueried relations · ec475547
      Sean Griffin 提交于
      This is cropping up all over the place. After a brief dive, I'm really
      not sure why we have `arel.bind_values` at all. A cursory grep didn't
      reveal where they're actually being assigned (it's definitely in AR, not
      in Arel). I'd like to dig further into it, as I'm fairly certain we
      don't actually need it, we just need a way for the predicate builder to
      communicate merged binds upstream.
      
      Fixes #18414
      ec475547
    • S
      Properly persist `lock_version` as 0 if the DB has no default · 13772bfa
      Sean Griffin 提交于
      The reason this bug occured is that we never actually check to see if
      this column has changed from it's default, since it was never assigned
      and is not mutable.
      
      It appears I was wrong in b301c402, with
      my statement of "there is no longer a case where a given value would
      differ from the default, but would not already be marked as changed."
      
      However, I chose not to revert the deletion of
      `initialize_internals_callback` from that commit, as I think a solution
      closer to where the problem lies is less likely to get erroneously
      removed. I'm not super happy with this solution, but it mirrors what is
      being done in `_update_record`, and a fix for one should work for the
      other.
      
      I toyed with the idea of changing the definition of `changed?` on the
      type to `changed_in_place?`. If we type cast the raw value, it'll break
      a test about updating not modifying the lock column if nothing else was
      changed. We could have the definition check if `raw_old_value` is `nil`,
      but this feels fragile and less intention revealing. It would, however,
      have the benefit of cleaning up old data that incorrectly persisted as
      `nil`.
      
      Fixes #18422
      13772bfa
  10. 09 1月, 2015 2 次提交
  11. 08 1月, 2015 1 次提交
    • B
      Fix count on a separate connection (fixes #18359) · 82486280
      brainopia 提交于
      Previosly count and other AR calculations would convert
      column_name_for_operation to sql on a default Arel::Table.engine
      (AR::Base) connection. That could lead to trouble if current
      model has a connection to a different adapter or Base connection
      is inaccessible.
      82486280
  12. 07 1月, 2015 1 次提交
  13. 06 1月, 2015 5 次提交
  14. 05 1月, 2015 1 次提交
    • M
      Fix TypeError in Fixture creation · 7b910917
      Matt Hogan 提交于
      Ruby 4.2 started doing `value.gsub('$LABEL', label)` for fixture label interpolation, but you can have have valid YAML where `label` isn't a String. 
      
      For example:
      
      ```YAML
      0:
        name: John
        email: johndoe@gmail.com
      1:
        name: Jane
        email: janedoe@gmail.com
      ```
      
      This YAML will create a label that is a Fixnum, causing `TypeError: no implicit conversion of Fixnum into String.`
      7b910917