actually noaways I would write it as flags.where(flag: 'lock', status: 'enable').exists?