Module: Ari::ModelHelpers::ClassMethods

Defined in:
lib/ari/active_record.rb

Instance Method Summary collapse

Instance Method Details

#ari_excludeObject



26
27
28
29
# File 'lib/ari/active_record.rb', line 26

def ari_exclude
  puts "GET EXS"
  return @ari_exclude || {}
end

#ari_functionsObject



21
22
23
24
# File 'lib/ari/active_record.rb', line 21

def ari_functions
  puts "GET FOOS"
  return @ari_functions || {}
end

#ari_options(options = {}) ⇒ Object

options:

:exclude   => ['column_name', 'relation_name']
:functions => ['function']


12
13
14
15
16
17
18
19
# File 'lib/ari/active_record.rb', line 12

def ari_options(options = {})
  puts "ARI OPTIONS"
  @ari_functions  ||= {}
  @ari_exclude    ||= {}
  options[:exclude].each { |x| @ari_exclude[x] = true } if options[:exclude]
  options[:functions].each { |x| @ari_functions[x] = true } if options[:functions]
  puts "ARI OPTIONS INSPECT : #{@ari_functions} : #{@ari_exclude}"
end