Monday, April 05, 2010

Ezgraphix update.

Ezgraphix has been updated,

Main changes:



The ezgraphixdemo also was updated. check it out! live @ Heroku

Tuesday, March 30, 2010

Adding tags to Mongoid Documents

In our latest project at Martian Interactive we are using Mongoid to support some document-based models instead of a relational approach like ActiveRecord models. As many applications, this one needed a tagging system (nothing magic, we all know there are a lot of gems/plugins out there that works pretty fine with AR) for Mongoid documents, so I ended up writting a really basic and simple tagging system that's working pretty well, since we are using a document-based schema each document has it's own set of embedded tags that are loaded when the document is required allowing us to save some queries, with a relational schema this solution wouldn't be an option due to the redundance it introduces.

Here's the code.

Tuesday, November 17, 2009

employees-directory a new Radiant CMS extension

Martian Interactive has created a new Radiant CMS extension to support large number of employees information. A more detailed information about the extension can be found in the company's blog or the project repository.

Thursday, November 05, 2009

Simple Rake task for dumps on SQLite

In previous posts I showed you some Rake tasks that I constantly use to make dumps and dump import operations on a database, these scripts were designed to work with MySQL.

Even when SQLite has become the default Rails DB (since Rails 2.0.2), I preffer to work with MySQL, but in the last days I had to make some work using SQLite, and since dump tasks save you a lot of time, here's the simple script I wrote to make this work with SQLite. I hope you find this useful.


Tuesday, September 15, 2009

Migrating ezgraphixdemo from HerokuGarden to Heroku

HerokuGarden is not longer supported, so I had to migrate the ezgraphix demo to Heroku, that process was really simple and elegant, the guys behind Heroku have done a great work, I still remember the first days of Heroku (when we needed a beta account), deployment and performance weren't as good as they are today, there is a big enhancement since these days and this will help people to easily deploy Rails apps, so keep up the good work!

So here's where you can find the new demo http://ezgraphixdemo.heroku.com/

Sunday, August 30, 2009

Simple Rake task for dumps

Rails ships with a lot of rake tasks, you can check the defaults by typing rake -T from your project's root, many of them make operations over the database, like; create, drop, reset, clone among others, but we wanted a simple rake task to generate dumps and import them into the current environment's db, Rails include a dump task that generates your current db schema, in our case we dump everything, data and schema in a sql file. You can find a LOT of rake tasks for dumps out there, but I like this simplicity!


Tuesday, May 05, 2009

Overriding RAILS_ASSET_ID based on the last git commit number

Lately I've been working with some 3D contents made in Unity3D and having Rails as web support in order to visualize those contents. I had to override the ENV["RAILS_ASSET_ID"] variable value in order to make the contents cacheables between commits changes, I'm using Git as scm, so I wanted to use the last commit number as value for the asset id, (there is another similar post for svn), this is exactly what I did:




The first line gets the last commit number and stores it in the variable, then it can be used to make objects cacheables.

Stylesheets, javascripts, etc ... also will get this asset id as default.