Magic for rails