Sha256: 0803fead64d26708ef26d6dc600f2bf5c1b15ca76feffefd31f5cf943481a89b
Contents?: true
Size: 499 Bytes
Versions: 10
Compression:
Stored size: 499 Bytes
Contents
module LazyModel class LazyBoolean include LazyModelSupport def define_methods define_class_methods end private def define_class_methods model.class_eval <<-LZY class << self def #{attribute} where(self.arel_table[:#{attribute}].eq(true)) end def not_#{attribute} where(self.arel_table[:#{attribute}].eq(false)) end def nil_#{attribute} where(self.arel_table[:#{attribute}].eq(nil)) end end LZY end end end
Version data entries
10 entries across 10 versions & 1 rubygems