Module: Squeel::Configuration
- Included in:
- Squeel
- Defined in:
- lib/squeel/configuration.rb
Instance Method Summary collapse
- #alias_predicate(new_name, existing_name) ⇒ Object
- #configure {|_self| ... } ⇒ Object
- #load_core_extensions(*exts) ⇒ Object
Instance Method Details
#alias_predicate(new_name, existing_name) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/squeel/configuration.rb', line 17 def alias_predicate(new_name, existing_name) raise ArgumentError, 'the existing name should be the base name, not an _any/_all variation' if existing_name.to_s =~ /(_any|_all)$/ ['', '_any', '_all'].each do |suffix| PredicateMethods.class_eval "alias :#{new_name}#{suffix} :#{existing_name}#{suffix} unless defined?(#{new_name}#{suffix})" end end |
#configure {|_self| ... } ⇒ Object
7 8 9 |
# File 'lib/squeel/configuration.rb', line 7 def configure yield self end |
#load_core_extensions(*exts) ⇒ Object
11 12 13 14 15 |
# File 'lib/squeel/configuration.rb', line 11 def load_core_extensions(*exts) exts.each do |ext| require "core_ext/#{ext}" end end |