module Sequel::Plugins::BooleanSubsets::ClassMethods

Private Instance Methods

boolean_subset_args(c) click to toggle source

The arguments to use when automatically defining a boolean subset for the given column.

   # File lib/sequel/plugins/boolean_subsets.rb
45 def boolean_subset_args(c)
46   [c, {c=>true}]
47 end
create_boolean_subsets() click to toggle source

Add subset methods for all of the boolean columns in this model.

   # File lib/sequel/plugins/boolean_subsets.rb
50 def create_boolean_subsets
51   if cs = check_non_connection_error(false){columns}
52     cs = cs.select{|c| db_schema[c][:type] == :boolean}.map{|c| boolean_subset_args(c)}
53     dataset_module do
54       cs.each{|c| where(*c)}
55     end
56   end
57 end