[katello-devel] Manifest import error handling

Marek Hulan mhulan at redhat.com
Thu Jan 17 08:34:16 UTC 2013


On Wednesday 16 of January 2013 17:03:06 Lukas Zapletal wrote:
> If you are going to implement this flag, I vote for a generic solution.
> Something that we would be able to add flags to any other resources
> with.

Sorry I'm missing a point in here. You mean in terms of storage, DSL or what? 
Since I think this should be as simple as possible I'd just add a simple 
boolean attribute to Product named repositories_synced so you could simply use
    @product.repositories_synced?
    @product.toggle!(:repositories_synced)

Adding a flag to any model is as simple as calling
    rails g migration AddRepositoriesSyncedToProduct 
repositories_synced:boolean

There are already some gems to use bitmask as storage [1] but I don't think 
it's really worth it.

[1] https://github.com/pboling/flag_shih_tzu
-- 
Marek




More information about the katello-devel mailing list