1. 12 3月, 2014 5 次提交
  2. 11 3月, 2014 12 次提交
  3. 10 3月, 2014 15 次提交
  4. 09 3月, 2014 8 次提交
    • A
      Merge pull request #14262 from sferik/flat_map · ec232771
      Andrew White 提交于
      Replace additional instances of map.flatten with flat_map
      ec232771
    • C
    • A
      Copy shallow options from normal options when using scope · af4c9b78
      Andrew White 提交于
      If the options :shallow_prefix and :shallow_path are not set in the
      scope options then copy them from the normal :as and :path options
      if they are set.
      af4c9b78
    • A
      Pull namespace defaults out of the options hash · 8711086f
      Andrew White 提交于
      If a developer has specified either :path or :as in the options hash then
      these should be used as the defaults for :shallow_path and :shallow_prefix.
      
      Fixes #14241.
      8711086f
    • A
      Only use shallow nested scope when depth is > 1 · dcc91a04
      Andrew White 提交于
      By tracking the depth of resource nesting we can push the need for nested
      shallow scoping to only those routes that are nested more than one deep.
      This allows us to keep the fix for #12498 and fix the regression in #14224.
      
      Fixes #14224.
      dcc91a04
    • A
      Move setting :scope_level_resource to resource_scope · ed0fb4ae
      Andrew White 提交于
      Originally with_scope_level was exclusively for managing scope levels with
      resources, however it is now used for other things so it makes more sense
      to move the responsibility for setting the :scope_level_resource to the
      resource_scope method. This eliminates repeatedly setting it to the same
      resource as each resource method scope is evaluated.
      ed0fb4ae
    • Y
      Merge pull request #14313 from m-Peter/active_model_doc_fixes · 002c0634
      Yves Senn 提交于
      Fix errors for four of the code samples [ci skip]
      002c0634
    • P
      Fix errors for four of the code samples · f6ab7782
      Peter Markou 提交于
      The four code samples that fail to run are:
      
      - Add attribute magic to objects. Fixed by introducing a Person
        instance variable.
      
      - Tracking value changes. Fixed by replacing `attr_accessor` with
        `define_attribute_methods`, providing getter and setter methods
        for `name` and providing the missing `Person#save` method. A
        call to `Person#save` has to precede the `person.name = 'robert'`
        assignment, if we want `previous_changes` to include 'bob'.
      
      - Adding `errors` interface to objects. Fixed by introducing a
        Person instance variable, assigning `nil` to its name and calling
        `Person#validate!`.
      
      - Custom validators. Fixed by defining `HasNameValidator` before
        it is used by `ValidatorPerson`.
      
      All the code samples can now be run smoothly.
      
      Call Dirty#changes_applied in Person#save, instead of modifying instance vars.
      f6ab7782