Allow precompile assets without opening db connection

Move the LIKE constant to the core gem as that is the place where it
gets called