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 …

Extracting fixtures

I’m still using fixtures. Shame, I know. Why I do use them instead of Factory Girl or other solution like that? Well, fixtures can be much more closer to real data than mocks from Factory. How come, You ask? Fixtures are imaginary data exactly like mocks from other sources! My answer is: that depends how …

Logger – simple, yet powerful Rails debugging tool

I don’t know about You, but logs are for me most powerful debugging tool. Placing many logger.debug or logger.info can quickly provide info what is happening inside Rails application. This approach is especially useful when something wrong is happening and trigger is unknown. Placing many logging directives can provide data for analysis what could be …