Here are two things I discovered this weekend:
Thing 1: FasterCSV is really cool! It’s easy to use and does exactly what it should. Here’s Scott Becker’s exporting tutorial. For importing, i’ve hacked together bits from Peter Larkmund’s travels and the FasterCSV documentation. Thanks to these tutorials, AMB will give users the ability to upload and export CSVs.
Thing 2: Default values for the win! If you have a table that has a column for an amount, feel free to set the default value to 0.00. Otherwise you won’t be able to do the following:
a = Account.new
a.amount += 20
…because a.amount will be nil. You’ll throw an error and if you just updated a bunch of code, you might waste an hour trying to figure out why you’re throwing an exception. However, if you declare a default value, you’ll be able to avoid any issues.
If you want me to go into further detail on either thing, just leave a comment.
Thanks for reading and happy hacking.