Obligatory #introduction. Started writing code for money in 2011, started writing Ruby in 2014 and hope for many more years of it.
Fan of programming, reading, videogames, going on walks, National Trust sites and much more. (https://jsrn.net/stuffthatilike)
Here because Twitter can be... Twitter, but I'm not ready to give up human contact altogether yet.
Devise's Authenticable module lets you set the message shown when `active_for_authentication?` is false, but I can't see the presumably obvious way of changing the controller to which inactive users are redirected.
https://www.rubydoc.info/github/plataformatec/devise/Devise/Models/Authenticatable
Anyone know how to do that?
I often hear that the increased hosting costs associated with Ruby on Rails' larger than average footprint is more than offset by the increased dev productivity. It follows that Rails salaries being pretty high at the moment is offset by being able to maintain a smaller, more productive team.
Does anyone know of any case studies where someone's actually done the numbers on that?
It "feels right" to me, but I'd be interested to read other's experiences.
Alternative: catching original exception & raising a custom class closer to the source of the error, and then at least the intent in application controller is clear.
I'm trying to catch `Net::ReadTimeout`s from a specific API and present a nice error message to the user. This API is used throughout the app, so I'd prefer not to duplicate this error handling code more than necessary.
Is having a `rescue_from` in ApplicationController and checking the exception object to see if it originated in a certain class a clumsy way of doing that?
Obligatory #introduction. Started writing code for money in 2011, started writing Ruby in 2014 and hope for many more years of it.
Fan of programming, reading, videogames, going on walks, National Trust sites and much more. (https://jsrn.net/stuffthatilike)
Here because Twitter can be... Twitter, but I'm not ready to give up human contact altogether yet.
Chatted about this with a couple local Ruby programmers and the consensus seems to be "probably not."
Is there ever a good time to define a custom `!` method on an object? Seems like setting up a footgun for people relying on the truthy/falsiness in a boolean expression.
class Thing; def !; true; end; end
my_thing = Thing.new
do_thing if my_thing# executes
do_thing if !my_thing # executes
do_thing unless my_thing # does not execute