1. 18 3月, 2015 15 次提交
  2. 17 3月, 2015 14 次提交
  3. 16 3月, 2015 7 次提交
  4. 15 3月, 2015 4 次提交
    • A
      Merge pull request #19342 from yui-knk/fix/missed_link · 575839d7
      Arthur Nogueira Neves 提交于
      [ci skip] Fix dead link
      575839d7
    • Y
      [ci skip] Fix dead link · 45f307fb
      yui-knk 提交于
      getting_started.html#the-mvc-architecture is lost by this commit
      2f06c94e (Mar 14 2012 !).
      
      So replace it with wikipedia link.
      45f307fb
    • E
      Fix leaky chain on polymorphic association · 51660f01
      eileencodes 提交于
      If there was a polymorphic hm:t association with a scope AND second
      non-scoped hm:t association on a model the polymorphic scope would leak
      through into the call for the non-polymorhic hm:t association.
      
      This would only break if `hotel.drink_designers` was called before
      `hotel.recipes`. If `hotel.recipes` was called first there would be
      no problem with the SQL.
      
      Before (employable_type should not be here):
      ```
      SELECT COUNT(*) FROM "drink_designers" INNER JOIN "chefs" ON
      "drink_designers"."id" = "chefs"."employable_id" INNER JOIN
      "departments" ON "chefs"."department_id" = "departments"."id" WHERE
      "departments"."hotel_id" = ? AND "chefs"."employable_type" = ?
      [["hotel_id", 1], ["employable_type", "DrinkDesigner"]]
      ```
      
      After:
      ```
      SELECT COUNT(*) FROM "recipes" INNER JOIN "chefs" ON "recipes"."chef_id"
      = "chefs"."id" INNER JOIN "departments" ON "chefs"."department_id" =
      "departments"."id" WHERE "departments"."hotel_id" = ?  [["hotel_id", 1]]
      ```
      
      From the SQL you can see that `employable_type` was leaking through when
      calling recipes. The solution is to dup the chain of the polymorphic
      association so it doesn't get cached. Additionally, this follows
      `scope_chain` which dup's the `source_reflection`'s `scope_chain`.
      
      This required another model/table/relationship because the leak only
      happens on a hm:t polymorphic that's called before another hm:t on the
      same model.
      
      I am specifically testing the SQL here instead of the number of records
      becasue the test could pass if there was 1 drink designer recipe for the
      drink designer chef even though the `employable_type` was leaking through.
      This needs to specifically check that `employable_type` is not in the SQL
      statement.
      51660f01
    • A
      Merge pull request #19339 from y-yagi/mailer_preview_comment · b6c038b6
      Andrew White 提交于
      add mailer suffix to comments for email previews
      b6c038b6