Notes posted by benissimo
RSS feed![Default_avatar_30](https://www.gravatar.com/avatar/e580eaf74a5f97c7ea01e0c026221a1d?default=http://apidock.com/images/default_avatar_30.png&size=30)
conditional rescue_from
Would it be possible to do something like:
rescue_from Exception, :with => my_handler, :unless => request.local?
![Default_avatar_30](https://www.gravatar.com/avatar/e580eaf74a5f97c7ea01e0c026221a1d?default=http://apidock.com/images/default_avatar_30.png&size=30)
Checking content_for
@tordans You asked your question 3 years ago, but in any case, should anyone have that same issue, you can manage that with:
- unless content_for(:footer).blank? yield(:footer) - else == render "layouts/footer_big"
content_for(:x) defaults to an empty string, that’s why you need to check for blank? not nil?.
![Default_avatar_30](https://www.gravatar.com/avatar/e580eaf74a5f97c7ea01e0c026221a1d?default=http://apidock.com/images/default_avatar_30.png&size=30)
Why gsub!
I notice other adapters use sql.sub!, not sql.gsub! and in fact I had trouble with adding the limit parameter to any query involving nested selects. Replacing sql.gsub! with sql.sub! solved that problem for me. Has anyone else had a similar experience with this method?
In other words, replace:
sql.gsub!(/SELECT/i, 'SELECT B.* FROM (SELECT A.*, row_number() over () AS internal$rownum FROM (SELECT')
With:
sql.sub!(/SELECT/i, 'SELECT B.* FROM (SELECT A.*, row_number() over () AS internal$rownum FROM (SELECT')
![Default_avatar_30](https://www.gravatar.com/avatar/e580eaf74a5f97c7ea01e0c026221a1d?default=http://apidock.com/images/default_avatar_30.png&size=30)
reload is deprecated? what's the new alternative?
What’s the recommended alternative to reload for more recent versions of Rails?