20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/hash_extension.rb', line 20
def find_as_hashes(*args)
options = (
args.respond_to?(:extract_options!) ?
args. :
(args) )
if options.include?(:include)
raise ActiveRecord::StatementInvalid, "find_as_hashes cannot accept :include options!"
end
validate_find_options(options)
set_readonly_option!(options)
case args.first
when :first
find_initial_as_hashes(options)
when :all
find_every_as_hashes(options)
else
find_from_ids_as_hashes(args, options)
end
end
|