Hi Anthony,
thanks for your response. Great that you mention this. Yes I have seen
other Rubyists on the internet proposing a similar solution, but for me it
feels like a workaround, which could work in some cases, but it's not
ideal. My main objection for that is that it implies defining to_pr
On reading my first thought was "can
you do that by defining to_proc on Array".
A brief play suggests one can:
class Array
def to_proc
Proc.new { |arg| self.inject(arg) { |memo, f|
f.to_proc.call(memo) } }
end
end
Hi Rafael,
I'm glad to see you here. The reason I see its place here at first is
because I think its use case fits better with the framework than with the
language. When thinking on the Ruby language I would expect more to deal
with collections which contain objets like String, Integer, and the
If you think that method would be useful there is no reason why it should be
Rails specific. Please send a feature request to the Ruby issue tracker here
https://bugs.ruby-lang.org/.
Rafael França
On May 11, 2018, 13:10 -0400, Alberto Almagro , wrote:
> These days I have been comparing records
These days I have been comparing records in my daily job lots of times,
which made me think about a better way to retrieve and compare them. When I
want to navigate through several relations in a collection I often see
myself writing code like the following:
Given orders as a collection of Orde
Hi Pradeep,
sorry for the delay, I had a lot going on these days.
At the end the functionality would be more or less what it is at the
moment, but I like the point that you don't have to recreate everything. It
would be simply to encrypt the secrets again with a new generated key.
Provided tha