Implement sql escaping using ActiveRecord.