Skip to content

Nil error in _save_fragment when I attempt to cache an action that uses send_file #57

Open
@aschmied

Description

@aschmied

Environment

  • Windows 10
  • ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]
  • Rails 5.0.6
  • actionpack-action_caching 1.2.0

Description

When I attempt to use caches_action on an action that sends a file using send_file I get the following nil error:

undefined method `each' for nil:NilClass
actionpack-action_caching (1.2.0) lib/action_controller/caching/actions.rb:122:in `_save_fragment'
actionpack-action_caching (1.2.0) lib/action_controller/caching/actions.rb:165:in `around'
activesupport (5.0.6) lib/active_support/callbacks.rb:405:in `public_send'
...

Repro

I pushed an app that demonstrates the crash here. The first commit is a clean app after rails new. Subsequent commits add the working controller action then introduce caching to reproduce the crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions