added rails classes and fixed schema mixin