Fixing “uninitialized constant” errors in rake tasks when using Rails threadsafe! mode

I ran into this problem where I was getting “uninitialized constant” errors when running rake tasks. These are tasks which had been working and I verified that the proper paths were set (eager_load_paths). When searching I saw information about config.threadsafe! being a problem so I disabled it and the problems vanished. However, I wanted to …

Continue reading ‘Fixing “uninitialized constant” errors in rake tasks when using Rails threadsafe! mode’ »

Decimal precision for geocoding coordinates

I did some research and found a lot of discrepancy among recommendations for the decimal precision when doing geocoding. Some say you only need 4 digits of precision and others suggest up to 15. In my own testing the best results seemed to be with 6-digits and SQL type of PRECISION(9,6) for latitude and longitude. …

Continue reading ‘Decimal precision for geocoding coordinates’ »

gems for validating email and urls in rails

Validating URL Addresses http_url_validation_improved (1.3.1) – uses Addressable::URI.parse, can check url connectivity url_validation (1.0.0) – uses Addressable::URI.parse, can check url connectivity url_validator (0.1.0) – uses Addressable::URI.parse validate_url (0.2.0) – simple, Rails 3 only, uses URI.parse validates_url_format_of (0.3.0) – Rails 2 and 3, uses regexp Obviously people’s needs will differ but I think validate_url suites my …

Continue reading ‘gems for validating email and urls in rails’ »