lib/has_uuid.rb
# Find appropriately based whether argument is a UUID.
Find appropriately based whether argument is a UUID.
Find appropriately based whether argument is a UUID .
def find_by_id_or_uuid(id_or_uuid)
          if UUIDTools::UUID.valid?(id_or_uuid)
            send("find_by_#{self.read_inheritable_attribute(:uuid_column)}", id_or_uuid) 
          else
            find(id_or_uuid.to_i)
          end
        end
def find_by_id_or_uuid ( id_or_uuid ) if UUIDTools :: UUID . valid? ( id_or_uuid ) send ( "find_by_#{self.read_inheritable_attribute(:uuid_column)}" , id_or_uuid ) else find ( id_or_uuid . to_i ) end end
Find appropriately based whether argument is a UUID.
Find appropriately based whether argument is a UUID .
# find_by_uuid(id_or_uuid)
id_or_uuid