I saw this answer Can you supply arguments to the map(&:method) syntax in Ruby?
I do not recommend it but your can hack your way around by monkey patching
the Symbol
class in your initializer
like
class Symbol
def call(*args, &block)
->(caller, *rest) { caller.send(self, *rest, *args, &block) }
end
end
and in your User model adding a simple method like
def addMessage(message)
self.messages << message
end
and in your code simply replace this
users.each do |user|
user.messages << message
end
with
users.map(&:addMessage.(message))
this is actually the same thing but it hides away the iterative style code to a simple map
I would NOT recommend doing this but I found it rather fun to play around with.