When will_paginate renders strange URLs after Rails upgrade to 3.2

To be honest I didn’t expect I will write again here at this blog. But good news I did manage to find some time to write! Since 2011 I’m not freelancing anymore, but all the time I use Rails in Nettigo. Codebase used there has it’s roots in Rails 1.2 or even earlier release – …

Passing current user id to Rails models

Long time since last post, isn’t it? Well, I’m completely busy with my work in Nettigo, selling Arduinos and other nice gears :) I do not do gigs anymore, so there is a lot less reasons to write about Rails. But I still use this framework, since my backend software is written in Rails, so …

wsdl2ruby and failing SSL certificate validation

When You are about to use Ruby to connect to some SOAP-like API You will probably use SOAP4r gem. First step would be to generate client code from WSDL provided by API. If it is served via HTTPS and server has SSL certificate not signed by some common CA (like self signed certs) You will …

ActiveMerchant: dumping traffic between Your app and payment gateway

Just a quick note – if You need to dump all traffic between payment gateway and Your application using ActiveMerchant just add to Your development.rb: ActiveMerchant::Billing::QuantumGateway.wiredump_device = File.open(“/tmp/q.log”, “a+”) ActiveMerchant::Billing::QuantumGateway.wiredump_device.sync = true Just remember – it will work ONLY You have one application instance, since it uses simple file handle to write all traffic. And …

ArgumentError: marshal data too short when loading session data

I was stuck for a while when application maintained by me have started to throw ArgumentError: marshal data too short errors in random places When user have encountered that problem then it was unable to use application at all. Logs were showing that it happens when Rails was trying to create session object. Session store …