Closed wezham closed 7 years ago
It is not in the README. PRs are welcome if you have time to put into documentation.
If you want to get the flag names for a single column (the gem supports multiple flag columns per table):
ModelClass.flag_keys("custom_flag_column_name")
model_instance.all_flags("custom_flag_column_name")
(they do the same thing)If you want the hash of all flag columns as keys, and names as values:
ModelClass.flag_mapping
Thanks :D 👍
Hi I was using the gem today and thought it would be nice if possible to add a functionality like:
Record.flag_names and return an array of strings containing flag names. It would be really useful to iterate over the flag names without having to hard code the names.
Not sure if the feature exists and I haven't seen it but thanks in advance :D