1. 27 12月, 2014 1 次提交
    • S
      We don't need additional type casting for locking updates · 796574c9
      Sean Griffin 提交于
      Part of the larger refactoring to remove type casting from Arel. We can
      inform it that we already have the right type by wrapping the value in
      an `Arel::Nodes::Quoted`. This commit can be reverted when we have
      removed type casting from Arel in Rail 5.1
      796574c9
  2. 18 11月, 2014 1 次提交
  3. 28 6月, 2014 1 次提交
    • S
      Stop using instance exec for type decorators · ccc1d3db
      Sean Griffin & Sean Doyle 提交于
      We are moving this behavior out to an object that we would like to keep
      separated from `ActiveRecord::Base`, which means not passing the class
      object to it. As such, we need to stop using `instance_exec`, and
      instead close over the subclass on global type decorators that are
      applied in `Base`.
      ccc1d3db
  4. 24 6月, 2014 1 次提交
    • Y
      add missing `:nodoc:` for recent refactorings. [ci skip] · b27e856d
      Yves Senn 提交于
      Adding `# :nodoc:` to the parent `class` / `module` is not going
      to ignore nested classes or modules.
      
      There is a modifier `# :nodoc: all` but sadly the containing class
      or module will continue to be in the docs.
      
      /cc @sgrif
      b27e856d
  5. 17 6月, 2014 1 次提交
  6. 11 6月, 2014 1 次提交
  7. 07 6月, 2014 1 次提交
  8. 31 5月, 2014 1 次提交
    • S
      Rename attribute related instance variables to better express intent · eb6cee9c
      Sean Griffin 提交于
      `@attributes` was actually used for `_before_type_cast` and friends,
      while `@attributes_cache` is the type cast version (and caching is the
      wrong word there, but I'm working on removing the conditionals around
      that). I opted for `@raw_attributes`, because `_before_type_cast` is
      also semantically misleading. The values in said hash are in the state
      given by the form builder or database, so raw seemed to be a good word.
      eb6cee9c
  9. 20 2月, 2014 1 次提交
  10. 17 11月, 2013 1 次提交
  11. 24 9月, 2013 1 次提交
  12. 22 7月, 2013 2 次提交
    • B
      Tidy up the "Specified column type for quote_value" changes · c083dc22
      Ben Woosley 提交于
      This includes fixing typos in changelog, removing a deprecated
      mocha/setup test require, and preferring the `column_for_attribute`
      accessor over direct access to the columns_hash in the new code.
      c083dc22
    • A
      Specified column type for quote_value · 39b5bfe2
      Alfred Wong 提交于
      When calling quote_value the underlying connection sometimes requires
      more information about the column to properly return the correct quoted
      value.
      
      I ran into this issue when using optimistic locking in JRuby and the
      activerecord-jdbcmssql-adapter. In SQLSever 2000, we aren't allowed to
      insert a integer into a NVARCHAR column type so we need to format it as
      N'3' if we want to insert into the NVARCHAR type. Unfortuantely, without
      the column type being passed the connection adapter cannot properly return
      the correct quote value because it doesn't know to return N'3' or '3'.
      
      This patch is fairly straight forward where it just passes in the column
      type into the quote_value, as it already has the ability to take in the column,
      so it can properly handle at the connection level.
      
      I've added the tests required to make sure that the quote_value method
      is being passed the column type so that the underlying connection can
      determine how to quote the value.
      39b5bfe2
  13. 14 7月, 2013 1 次提交
  14. 10 3月, 2013 1 次提交
  15. 04 1月, 2013 1 次提交
  16. 26 10月, 2012 1 次提交
    • J
      Remove ActiveRecord::Model · 9e4c41c9
      Jon Leighton 提交于
      In the end I think the pain of implementing this seamlessly was not
      worth the gain provided.
      
      The intention was that it would allow plain ruby objects that might not
      live in your main application to be subclassed and have persistence
      mixed in. But I've decided that the benefit of doing that is not worth
      the amount of complexity that the implementation introduced.
      9e4c41c9
  17. 21 10月, 2012 1 次提交
  18. 20 10月, 2012 1 次提交
    • J
      Get rid of the ActiveRecord::Model::DeprecationProxy thing. · 83846838
      Jon Leighton 提交于
      I think it's going to be too much pain to try to transition the
      :active_record load hook from executing against Base to executing
      against Model.
      
      For example, after Model is included in Base, and modules included in
      Model will no longer get added to the ancestors of Base.
      
      So plugins which wish to be compatible with both Model and Base should
      use the :active_record_model load hook which executes *before* Base gets
      loaded.
      
      In general, ActiveRecord::Model is an advanced feature at the moment and
      probably most people will continue to inherit from ActiveRecord::Base
      for the time being.
      83846838
  19. 18 8月, 2012 1 次提交
  20. 14 7月, 2012 1 次提交
  21. 16 6月, 2012 1 次提交
  22. 30 5月, 2012 1 次提交
  23. 24 5月, 2012 1 次提交
    • V
      Revert "Remove blank trailing comments" · 1ad0b378
      Vijay Dev 提交于
      This reverts commit fa6d921e.
      
      Reason: Not a fan of such massive changes. We usually close such changes
      if made to Rails master as a pull request. Following the same principle
      here and reverting.
      
      [ci skip]
      1ad0b378
  24. 20 5月, 2012 1 次提交
    • H
      Remove blank trailing comments · fa6d921e
      Henrik Hodne 提交于
      For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace
      with the first match, and voilà! Note that the regex matches a little bit too
      much, so you probably want to `git add -i .` and go through every single diff
      to check if it actually should be changed.
      fa6d921e
  25. 30 3月, 2012 1 次提交
  26. 08 3月, 2012 1 次提交
  27. 07 3月, 2012 1 次提交
  28. 04 3月, 2012 1 次提交
  29. 31 1月, 2012 1 次提交
    • C
      Improve readonly examples and optimistic locking docs · 31fce019
      Carlos Antonio da Silva 提交于
      * Relation#order can receive order attributes as different arguments,
        add example;
      * Readonly does not handle deletion of records, only modification;
      * locking_version column does not need to default to 0, Rails handles
        nil values;
      * Change references from "set_locking_column" to "self.locking_column".
      31fce019
  30. 29 12月, 2011 1 次提交
    • J
      Support configuration on ActiveRecord::Model. · 93c1f11c
      Jon Leighton 提交于
      The problem: We need to be able to specify configuration in a way that
      can be inherited to models that include ActiveRecord::Model. So it is
      no longer sufficient to put 'top level' config on ActiveRecord::Base,
      but we do want configuration specified on ActiveRecord::Base and
      descendants to continue to work.
      
      So we need something like class_attribute that can be defined on a
      module but that is inherited when ActiveRecord::Model is included.
      
      The solution: added ActiveModel::Configuration module which provides a
      config_attribute macro. It's a bit specific hence I am not putting this
      in Active Support or making it a 'public API' at present.
      93c1f11c
  31. 24 12月, 2011 1 次提交
  32. 22 12月, 2011 1 次提交
  33. 23 12月, 2011 1 次提交
  34. 15 12月, 2011 1 次提交
  35. 30 11月, 2011 1 次提交
  36. 25 10月, 2011 1 次提交
  37. 15 10月, 2011 1 次提交
  38. 14 10月, 2011 1 次提交
  39. 09 8月, 2011 1 次提交
    • J
      Make it the responsibility of the connection to hold onto an ARel visitor for... · 7db90aa7
      Jon Leighton 提交于
      Make it the responsibility of the connection to hold onto an ARel visitor for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now.
      7db90aa7