some rails magic