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 …

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 …

Thumbnails are missing when uploading new image

Just a quick note – if You are experiencing missing thumbnails in image upload in WordPress, then probably Your PHP installation misses php-gd module. It is module by default installed on FreeBSD, but on Debian based Linux You have to add it by hand (apt-get install php5-gd). I had to move my blogs to new, …