hobo_support/lib/hobo_support/array.rb:

class Array

  alias_method :multiply, :*

  def *(rhs=nil)
    if rhs
      multiply(rhs)
    else
      Enumerable::MultiSender.new(self, :map)
    end
  end

  def drop_while!
    drop = 0
    drop += 1 while yield(self[drop])
    self[0..drop-1] = []
    self
  end

  # useful function from Rails 2.3
  if !respond_to? :wrap
    def self.wrap(object)
      case object
      when nil
        []
      when self
        object
      else
        if object.respond_to?(:to_ary)
          object.to_ary
        else
          [object]
        end
      end
    end
  end

end





Warm regards,
Ignacio

El 28-09-2015 a las 15:57, Stefan Haslinger escribió:
> 
> User.all.method(:*).source_location
> points me to 
> .rvm/gems/ruby-2.1.5/gems/activerecord-4.0.13/lib/active_record/relation/delegation.rb",
> 48
> 
> in Active Record Source Code. Now I am as clever as before ... (a.k.a.
> clueless)
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/hobousers.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to