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

Version Path
lazy_model-0.0.10 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.9 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.8 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.7 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.6 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.5 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.4 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.3 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.2 lib/lazy_model/lazy_boolean.rb
lazy_model-0.0.1 lib/lazy_model/lazy_boolean.rb