1. 29 5月, 2015 6 次提交
    • S
      Persist user provided default values, even if unchanged · 2f9d8895
      Sean Griffin 提交于
      This is a usability change to fix a quirk from our definition of partial
      writes. By default, we only persist changed attributes. When creating a
      new record, this is assumed that the default values came from the
      database. However, if the user provided a default, it will not be
      persisted, since we didn't see it as "changed". Since this is a very
      specific case, I wanted to isolate it with the other quirks that come
      from user provided default values. The number of edge cases which are
      presenting themselves are starting to make me wonder if we should just
      remove the ability to assign a default, in favor of overriding
      `initialize`. For the time being, this is required for the attributes
      API to not have confusing behavior.
      
      We had to delete one test, since this actually changes the meaning of
      `.changed?` on Active Record models. It now specifically means
      `changed_from_database?`. While I think this will make the attributes
      API more ergonomic to use, it is a subtle change in definition (though
      not a backwards incompatible one). We should probably figure out the
      right place to document this. (Feel free to open a PR doing that if
      you're reading this).
      
      /cc @rafaelfranca @kirs @senny
      
      This is an alternate implementation of #19921.
      
      Close #19921.
      
      [Sean Griffin & Kir Shatrov]
      2f9d8895
    • S
      Allow proc defaults with the Attributes API · a6e3cdae
      Sean Griffin 提交于
      This is a variant implementation of the changes proposed in #19914.
      Unlike that PR, the change in behavior is isolated in its own class.
      This is to prevent wonky behavior if a Proc is assigned outside of the
      default, and it is a natural place to place the behavior required by #19921
      as well.
      
      Close #19914.
      
      [Sean Griffin & Kir Shatrov]
      a6e3cdae
    • R
      Merge pull request #20017 from eliotsykes/configurable-static-index-filename · 73aab036
      Rafael Mendonça França 提交于
      config.static_index configures directory Index "index.html" filename
      73aab036
    • R
      Merge pull request #20331 from arunagw/arunagw-remove-unused-package-tasks · 233ceda5
      Rafael Mendonça França 提交于
      Remove unused package tasks
      233ceda5
    • L
      Merge pull request #20344 from jcockhren/fix_docs_presence_validation · 3b727898
      Lauro Caetano 提交于
      removed erroneous line. Corrected presence validation example.
      3b727898
    • J
      removed erroneous line. Corrected presence validation example. · d30f0011
      Jurnell Cockhren 提交于
      Addresses #20343.
      Removes erroneous line of code in the sample codeblock.
      d30f0011
  2. 28 5月, 2015 34 次提交