ActiveRecordTranslatable is moving towards stable

When I extracted
ActiveRecordTranslatable
from an active project is was a pretty quick thing, but since then I found, since
it is just so barebones easy, that uses pop up outside of the initial
project.

Currently I am in the process of moving it towards a more stable release,
just a couple more things are left to do, but for now at version 0.0.9 is here
with a slimmed down interface and better docs. Find and read the
docs here

ActiveRecordTranslatable, rails plugin to manage translations for ActiveRecord Models

Let’s face it translations are always a pain, be it managing po files for PHP
projects, or YAML files in Rails… Especially if the models in your
database contain some attributes being translated in different languages it
becomes hard to keep track of the translations, as well as managing the database
holding them.

Luckily Rails helps with that by providing I18n translations
across the board, and even supporting flexible backends for the translation
engine. Still if there are multiple attributes on models which
have to be provided in multiple languages, being different by model, I18n in its
basic form fails in my opinion. But the basics are already in place:

There also is the globalize gem, but
it didn’t quite fit what I needed, mainly since it stores the translations per
model, which makes it hard to provide a single interface to manage them. So I decided to roll my own and here it is,
ActiveRecordTranslatable.
The main goal was to integrate in the I18n backend itself so all available
translations can easily be found and contrasted to create an interface a group
managing translations can work in. For a basic usage just checkout the
Readme, or install
via rubygems

$ gem install activerecord_translatable

As always any remarks are highly welcome.

Enjoy

Fill Database with ActiveRecord

Rails ActiveRecord is a quite powerfull tool even without Rails itself. Since it gets all the needed information from the Database it can actually be used for all kinds of operations on the Database itself via scripting. In a current project there was the need to generate a lot of data on a table to use for testing, since the table was modified during the testing it made sense to write a script which auto generates the data based on the current table configuration.

This can be achieved by leveraging ActiveRecord, like this

https://gist.github.com/3017432.js?file=argen.rb

This can be expanded to all kinds of SQL types by extending the mapping hash, as well as the needed data generate methods. By doing so it can incoperate also database specific types like hashes by identifying the via their characteristic SQL type, i.e. md5 hash is char(40).