1. 08 5月, 2014 1 次提交
    • F
      Fixed HABTM's CollectionAssociation size · f045663d
      Fred Wu 提交于
      HABTM should fall back to using the normal CollectionAssociation's size calculation if the collection is not cached or loaded.
      
      This addresses both #14913 and #14914 for master.
      f045663d
  2. 07 5月, 2014 1 次提交
    • J
      Follow-up to #14990 [ci skip] · 22f25183
      Jon Atack 提交于
      Rewrite to avoid 'we'/'you', add missing period, and keep lines at 80 chars. Cheers :)
      
      Improve readability with help from @senny
      
      [ci skip]
      22f25183
  3. 06 5月, 2014 3 次提交
    • F
      Fixed grammar · fe126f10
      Fred Wu 提交于
      fe126f10
    • E
      refactor and clean up delete_all method · 255de98a
      eileencodes 提交于
      Now that delete_all with destroy or delete_all dependency behave
      the same we no longer need this conditional. This means we can remove
      the new delete_all_with_dependency method I added and go straight
      to delete_records from delete_all, passing :all and the dependent
      directly.
      255de98a
    • E
      Refactor AssociationScope#get_bind_values · bf4a8022
      Eric Chahin 提交于
      Added #join_id_for(owner) to reflection to avoid accessing the source_macro
      bf4a8022
  4. 29 4月, 2014 4 次提交
    • E
      flip conditional in delete_all to handle nullify better · fe5d0988
      eileencodes 提交于
      Nullify (or nil dependency) was doing the same thing delete_all
      was doing in issue #14546, creating a large IN statement if
      the association was loaded. Loaded and not loaded associations
      should behave the same. The IN statement is also not great because
      it's inefficient.
      fe5d0988
    • E
      simplify the delete all w/ dependency method · e0e58609
      eileencodes 提交于
      After reviewing this code I realized the conditional that was
      there previously was basically saying if the dependency is not
      delete all. This is a better, cleaner, and clearer way to write
      this method.
      e0e58609
    • E
      remove unnecessary code from delete method · 7ad476be
      eileencodes 提交于
      Now that we have a new method delete_all_with_dependency this
      coupled conditional is no longer needed.
      7ad476be
    • E
      write a new method to be accessed from delete_all · 0d4bf177
      eileencodes 提交于
      The delete method is very coupled with delete all even
      though only a portion of the conditionals apply. Decoupling
      this will make the code easier to understand and manipulate.
      0d4bf177
  5. 26 4月, 2014 1 次提交
    • K
      Fix custom join_table name on habtm reflections · 18fa87b8
      Kassio Borges 提交于
      When used a custom join_table name on a habtm, rails was not saving it
      on Reflections. This causes a problem when rails loads fixtures, because
      it uses the reflections to set database with fixtures.
      18fa87b8
  6. 25 4月, 2014 1 次提交
  7. 23 4月, 2014 1 次提交
  8. 22 4月, 2014 2 次提交
  9. 16 4月, 2014 2 次提交
  10. 15 4月, 2014 3 次提交
  11. 14 4月, 2014 3 次提交
  12. 08 4月, 2014 1 次提交
  13. 07 4月, 2014 1 次提交
  14. 04 4月, 2014 1 次提交
  15. 03 4月, 2014 3 次提交
  16. 01 4月, 2014 1 次提交
    • E
      fix delete_all to remove records directly · e247f325
      eileencodes 提交于
      When delete_all is run on a CollectionProxy and has a
      dependency of delete_all the SQL that is produced has an IN
      statement. (DELETE FROM `associated_model` where `associated_model`
      .`parent_id` = 1 AND `associated_model`.`id` IN (1, 2, 3...)).
      This only happens if the association is not loaded (both loaded
      and non-loaded delete_all should behave the same. This is a huge
      problem when it comes to deleting many records because the query
      becomes very slow. Instead the SQL produced should be (DELETE FROM
      `assoicated_model` where `associated_model`.`parent_model_id`=1).
      
      I fixed this by making sure the check for loaded and destroy also
      makes sure that the dependent is not delete_all, so the conditional
      goes to the else and deletes the records directly without the IN
      statement.
      e247f325
  17. 31 3月, 2014 2 次提交
    • T
      Simplify Preloader#grouped_records code. · 055942d6
      thedarkone 提交于
      The new method relies on AR::Associations::Association knowing about both reflection and a model class.
      
      AR::Base#association now raises a descriptive error when trying to access non-existent associations. Previously it would blow up with a confusing NoMethodError: undefined method `association_class' for nil:NilClass.
      055942d6
    • T
      Fix polymorphic preloads on NOT NULL _type columns. · de32d972
      thedarkone 提交于
      Defer to Association#klass instead of having a custom/duplicate code.
      de32d972
  18. 14 3月, 2014 3 次提交
  19. 04 3月, 2014 1 次提交
  20. 01 3月, 2014 1 次提交
  21. 26 2月, 2014 1 次提交
    • A
      let `insert_record` actuall save the object. · b1656fa6
      Aaron Patterson 提交于
      `before_add` callbacks are fired before the record is saved on
      `has_and_belongs_to_many` assocations *and* on `has_many :through`
      associations.  Before this change, `before_add` callbacks would be fired
      before the record was saved on `has_and_belongs_to_many` associations, but
      *not* on `has_many :through` associations.
      
      Fixes #14144
      b1656fa6
  22. 22 2月, 2014 1 次提交
  23. 21 2月, 2014 1 次提交
  24. 20 2月, 2014 1 次提交