I'm struggling with how to model a resource and its availability using the tools, gems or plugins available to us in Rails.
Basically each resource will have a typical availability of 0..24 hours for each day (0,1,2,3,4,5,6) of the week. BUT then there will be exceptions that need to be considered for example a holiday or special event that should overrule the default for that day of the week.
I can think of two broad approaches (though I'm sure there are more). One which would query the DB on every request and test the logic to see if the resource is available at that moment. This may become cumbersome (time consuming) as system grows. The other would run a process (cron?) every x (5?) min to set a boolean (AVAILABLE) on each resource that is derived depending on the rules for its availability.
Those are broad approaches that could, conceivably, work but how to approach the model/classes is where I could really use some advice.
Any thoughts? Experience? Gems/Plugins I should be aware of?