Could this be converted to use symbols and operators notation instead for better readability:
scope :visible, where("is_hidden = false")
scope :current, where("exp_date IS NULL OR exp_date > " + timestamp)
Convert into something like this:
scope :active, where( :is_hidden => false,
(:exp_date => nil || :exp_date > timestamp)
)
Sorry for the screwed up syntax (I’m brand new to ruby)
I kinda feel like I’m stealing the glory from the people commenting your question, but here’s a possible solution as well:
With squeel, you could write your scopes something like this: