Module: ActiveRecord::Resolver

Defined in:
lib/vex/active_record/resolver.rb

Instance Method Summary collapse

Instance Method Details

#resolve(obj) ⇒ Object

resolves an object.



4
5
6
7
8
9
10
11
# File 'lib/vex/active_record/resolver.rb', line 4

def resolve(obj)
  case obj
  when self   then obj
  when String then self.find(Integer(obj))
  when Array  then obj.map { |o| resolve(o) }
  else        self.find(obj)
  end
end