Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upFix the configuration for Dragonfly so you can use the before_s… #3451
Conversation
f492b66
to
5f3d233
This comment has been minimized.
This comment has been minimized.
The build is failing due to the upgrade to Rails 6. Some of the functionality of this gem requires us to use the relatively new credentials feature. |
This comment has been minimized.
This comment has been minimized.
Must be all the rage. I just submitted a similar PR as the same problem was reported on the refinerycms google group. I'll pull my PR. |
@@ -32,7 +32,7 @@ def configure!(extension) | |||
|
|||
# These options require a name and block | |||
define_url extension.dragonfly_define_url if extension.dragonfly_define_url.present? | |||
before_serve extension.dragonfly_before_serve if extension.dragonfly_before_serve.present? | |||
before_serve(&extension.dragonfly_before_serve) if extension.dragonfly_before_serve.present? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
joebutler2
Nov 8, 2019
Author
Contributor
Since you're passing in a block, it would be a Proc
object at this point. So it would only execute if you invoked the call
method on it. The &
is converting the Proc
object back into a block since the before_serve
method is expecting a block.
I'm pretty sure that is the case, let me know if I mistook something.
This comment has been minimized.
This comment has been minimized.
I've fixed the build failure in #3453 |
This comment has been minimized.
This comment has been minimized.
@parndt is this good to merge in? Do you want me to do anything else? |
This comment has been minimized.
This comment has been minimized.
@joebutler2 I would just like a review from @anitagraham |
joebutler2 commentedOct 31, 2019
This fixes an issue with setting the
Dragonfly
configuration forbefore_serve
. It looked like before it was a simple attr_accessor, but sincebefore_serve
is more like a DSL it was expecting to be called with a block. This PR corrects that, and I'm able to confirm it works on my project.The good news is this also solves another use case, serving private content. If you look at this Google Groups post from a few years ago, it appears my client isn't alone in wanting this feature. https://groups.google.com/forum/#!searchin/refinery-cms/dragonfly$20before_serve%7Csort:date/refinery-cms/lRBOsddSzHM/1tXNjzaHcBUJ