konsolebox has quit [Read error: Connection reset by peer]
BSaboia has quit [Quit: This computer has gone to sleep]
dualfade has quit [Ping timeout: 240 seconds]
dualfade has joined #ruby
konsolebox has joined #ruby
robotmay has quit [Ping timeout: 264 seconds]
robotmay has joined #ruby
SeepingN has joined #ruby
zacts has joined #ruby
zacts has quit [Client Quit]
sgen has quit [Ping timeout: 244 seconds]
arzWZM has quit [Ping timeout: 240 seconds]
arzWZM has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
jesfre has joined #ruby
jesfre3 has quit [Ping timeout: 265 seconds]
bambanx has joined #ruby
konsolebox has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
konsolebox has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
BSaboia has joined #ruby
<deimos_>
i'm pretty sure i already new that enumerators and lazy enumerators were so much faster than arrays, but i seem to keep relearning parts of ruby
<deimos_>
s/new/knew/
bambanx has quit [Ping timeout: 240 seconds]
BSaboia has quit [Client Quit]
dualfade has quit [Ping timeout: 265 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
alfiemax has joined #ruby
bambanx has joined #ruby
cthu| has quit [Ping timeout: 258 seconds]
konsolebox has quit [Read error: Connection reset by peer]
r3m has left #ruby ["WeeChat 3.0-dev"]
bhaak has joined #ruby
howdoi has quit []
xco has joined #ruby
howdoi has joined #ruby
konsolebox has joined #ruby
rose_nd_ash has joined #ruby
bocaneri has joined #ruby
zacts has joined #ruby
FetidToot has quit [Ping timeout: 246 seconds]
dostoyevsky has quit [Quit: leaving]
FetidToot has joined #ruby
dostoyevsky has joined #ruby
lemon has joined #ruby
arzWZM has quit [Ping timeout: 256 seconds]
arzWZM has joined #ruby
wymillerlinux has quit [Ping timeout: 256 seconds]
lemon395 has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
lemon has quit [Ping timeout: 258 seconds]
jetchisel has quit [Ping timeout: 256 seconds]
schne1der has joined #ruby
SeepingN has quit [Ping timeout: 258 seconds]
konsolebox has quit [Read error: Connection reset by peer]
zacts has quit [Ping timeout: 246 seconds]
sphex has quit [Read error: Connection reset by peer]
sphex_ has joined #ruby
alfiemax has quit [Remote host closed the connection]
konsolebox has joined #ruby
zacts has joined #ruby
thecoffemaker has quit [Ping timeout: 256 seconds]
alexherbo2 has joined #ruby
dualfade has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
jesfre has quit [Ping timeout: 240 seconds]
dualfade has quit [Ping timeout: 265 seconds]
dualfade has joined #ruby
konsolebox has joined #ruby
teej has quit [Quit: Connection closed for inactivity]
cd has quit [Quit: cd]
purefan has joined #ruby
nehsa has joined #ruby
<nehsa>
I want merge hash with duplicate keys ruby like
<nehsa>
[{"a": 1}, {"a" : 2}]
<nehsa>
output : {"a":1, "a": 2}
<nehsa>
Anyone can have solutions
<nehsa>
Simple merge not working it's reduce key with a
<leftylink>
since keys must be unique, we will need to take some other tack
<leftylink>
perhaps the values could be arrays
<nehsa>
In my case key need to be same and value is different
<leftylink>
in that case, it will be necessary to use something other than a Hash.
thecoffemaker has joined #ruby
<nehsa>
Params it's should in hash
dviola has quit [Quit: WeeChat 2.9]
vondruch has joined #ruby
<leftylink>
in life, sometimes we find that some requirements conflict with others, but at the same time that some are more firm than others. like the laws of the universe that we don't have the ability to violate
<leftylink>
so, we examine the situation in all its aspects, figure out what requirements are firm and which we have merely imagined, and thereby craft a solution
rose_nd_ash has quit [Remote host closed the connection]
<leftylink>
my role in this is simply to report on the facts of the situation and give an honest appraisal of the capabilities and potential of a hash
rose_nd_ash has joined #ruby
rose_nd_ash has quit [Remote host closed the connection]
rose_nd_ash has joined #ruby
Jonopoly has joined #ruby
rose_nd_ash has quit [Ping timeout: 240 seconds]
konsolebox has quit [Read error: Connection reset by peer]
rose_nd_ash has joined #ruby
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
rose_nd_ash has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
rose_nd_ash has joined #ruby
konsolebox has joined #ruby
user123 has joined #ruby
rose_nd_ash has quit [Remote host closed the connection]
schne1der has quit [Ping timeout: 258 seconds]
matti has quit []
matti has joined #ruby
TomyWork has joined #ruby
zapata has quit [Ping timeout: 244 seconds]
zapata has joined #ruby
rose_nd_ash has joined #ruby
camilasan has joined #ruby
camilasan_ has quit [Ping timeout: 240 seconds]
<ruurd>
and in this case it's easy either you get a violation because the key already exists OR the latest insert wins.
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
Jonopoly has quit [Quit: WeeChat 2.8]
elphe has joined #ruby
fandre1986 has joined #ruby
imode has quit [Ping timeout: 264 seconds]
oddp has joined #ruby
SeepingN has joined #ruby
user123 has left #ruby [#ruby]
zacts has quit [Ping timeout: 256 seconds]
markoong has joined #ruby
chalkmonster has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
SeepingN has quit [Read error: Connection reset by peer]
SeepingN has joined #ruby
zacts has joined #ruby
zacts has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
markoong has quit [Ping timeout: 240 seconds]
markoong has joined #ruby
dionysus69 has joined #ruby
bambanx has quit [Quit: Leaving]
konsolebox has quit [Read error: Connection reset by peer]
evdubs has quit [Ping timeout: 244 seconds]
zacts has joined #ruby
konsolebox has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zacts has quit [Quit: WeeChat 2.8]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sphex_ has quit [Ping timeout: 258 seconds]
sphex has joined #ruby
evdubs has joined #ruby
clemens3 has joined #ruby
alfiemax has joined #ruby
schne1der has joined #ruby
Mikaela has quit [Quit: Mikaela]
Mikaela has joined #ruby
drincruz has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
plutes has quit [Ping timeout: 272 seconds]
BH23 has quit [Ping timeout: 240 seconds]
rose_nd_ash has quit [Remote host closed the connection]
ujjain2 has joined #ruby
<ujjain2>
rvm not found...
<ujjain2>
but it was installed in /usr/local/rvm/ on my docker container
<ujjain2>
should it be /usr/local/rvm/bin/rvm or?
konsolebox has joined #ruby
<ujjain2>
+ /usr/local/rvm/bin/rvm --default use ruby-2.6.3
<ujjain2>
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
rose_nd_ash has joined #ruby
<TheBrayn>
I'm loading rvm from ~/.rvm/scripts/rvm in my .zshrc which turns rvm into a function
rose_nd_ash has quit [Remote host closed the connection]
ellcs has joined #ruby
fercell has joined #ruby
BH23 has joined #ruby
rose_nd_ash has joined #ruby
pwnd_nsfw has quit [Remote host closed the connection]
UncleCid has joined #ruby
Uncle_Cid has joined #ruby
markong has joined #ruby
markoong has quit [Ping timeout: 256 seconds]
alfiemax has quit [Remote host closed the connection]
TCZ has joined #ruby
UncleCid has quit [Ping timeout: 240 seconds]
TCZ has quit [Client Quit]
lemon395 has quit [Quit: Leaving]
TCZ has joined #ruby
drincruz has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
rose_nd_ash has quit [Remote host closed the connection]
ellcs has quit [Ping timeout: 244 seconds]
rose_nd_ash has joined #ruby
titanbiscuit has quit [Ping timeout: 240 seconds]
titanbiscuit has joined #ruby
Frobozz_ has joined #ruby
yasumi2136 has joined #ruby
Frobozz has quit [Ping timeout: 264 seconds]
drincruz has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
mossplix has joined #ruby
MadLamb has joined #ruby
konsolebox has joined #ruby
TCZ has quit [Quit: Leaving]
nehsa has quit [Ping timeout: 245 seconds]
purefan has quit [Quit: Leaving]
elphe has quit [Ping timeout: 264 seconds]
fandre1986 has quit [Ping timeout: 240 seconds]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wymillerlinux has joined #ruby
arahael1 has joined #ruby
TCZ has joined #ruby
Arahael has quit [Ping timeout: 256 seconds]
BSaboia has joined #ruby
elphe has joined #ruby
stryek has joined #ruby
lmat has quit [Ping timeout: 256 seconds]
baojg has quit [Remote host closed the connection]
lmat has joined #ruby
baojg has joined #ruby
rose_nd_ash has quit [Remote host closed the connection]
rose_nd_ash has joined #ruby
ujjain2 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mossplix has quit [Remote host closed the connection]
rose_nd_ash has quit [Remote host closed the connection]
rose_nd_ash has joined #ruby
mossplix has joined #ruby
<MadLamb>
I had some downtime on my rails app because its using active record include() to load an association, and the associated items got deleted. I can see two solutions to this problem. Either I can make sure the association is deleted when the model is deleted, or I need to use a join instead of a include, to make sure I only get results if the id exists on both tables. I tried to go for the first, but the model already has a ":dependent => :destroy
<MadLamb>
", which doesn't seem to be effective. I am wondering if it is even technically possible to filter out non null without a join. Since the query is limited to 3, if one of the results of the first query is null, then my resultset would be 2.
xall__ has joined #ruby
mossplix has quit [Remote host closed the connection]
xall__ has quit [Client Quit]
wallace_mu has joined #ruby
ChmEarl has joined #ruby
gitter1234 has joined #ruby
<lmat>
I told my client that we're running on "Llamas in Pajamas". He fired me
<lmat>
MadLamb: Sorry you had down time...yuck. I don't know about include(), but I'm sure coming up with some SQL that "filter out non null without a join" wouldn't be too bad at all.
baojg has quit [Remote host closed the connection]
wymillerlinux has quit [Ping timeout: 246 seconds]
baojg has joined #ruby
MadLamb has left #ruby ["Leaving"]
MadLamb has joined #ruby
<MadLamb>
lmat, yeah :D
rose_nd_ash has quit [Remote host closed the connection]
<MadLamb>
lmat, I think this approach with the include tries to optimize by not having the database to join the whole table, but instead do a small filter of 3 items first and do an additional query
<apotheon>
lmat: I must be missing the joke, because I have no idea why someone would tell a client "we're running on Llamas in Pajamas".
rose_nd_ash has joined #ruby
mossplix has joined #ruby
<MadLamb>
lmat, I also missed the joke but would guess it goes in the direction of the tech being childish
mossplix has quit [Remote host closed the connection]
<lmat>
apotheon: You run Llamas in Pajamas, too, right?
jesfre has joined #ruby
<al2o3-cr>
lmat: that's funny.
rose_nd_ash has quit [Remote host closed the connection]
impermanence has quit [Quit: Connection closed]
markong has quit [Ping timeout: 240 seconds]
rose_nd_ash has joined #ruby
rose_nd_ash has quit [Remote host closed the connection]
dualfade has quit [Ping timeout: 240 seconds]
CrazyEddy has quit [Remote host closed the connection]
rose_nd_ash has joined #ruby
rose_nd_ash has quit [Ping timeout: 260 seconds]
Doc_X has joined #ruby
CrazyEddy has joined #ruby
Doc_X has left #ruby [#ruby]
<apotheon>
lmat: No, I don't use Puma.
Doc_X has joined #ruby
Doc_X has left #ruby [#ruby]
dualfade has joined #ruby
sagax has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
<adam12>
lmat: Time to ugrade to 4.x :)
<apotheon>
I'm sure Puma is great. I just don't use it.
<adam12>
We have a bunch of great app servers now. To think there was a time that we only had Mongrel.
<apotheon>
What about WEBrick?
<apotheon>
I remember WEBrick.
<adam12>
Right! I forgot about WEBrick, tho the concensus at the time was don't run it in prod.
<apotheon>
I kinda feel like people are giving their releases names without any practical reason behind it, just because it's a thing other people do. It seems like a case of cargo-cult release details.
<apotheon>
It's probably Ubuntu that popularized this practice.
<adam12>
I prefer no names; remembering Debian Jessie, Debian Sid, etc. vs Debian 6, Debian Testing can be a challenge.
rose_nd_ash has joined #ruby
<apotheon>
yep
<apotheon>
Release names often just confuse the shit out of people.
mossplix has joined #ruby
<apotheon>
I'd prefer either semantic versioning with no names or date-based versioning with no names, depending on dev process.
mossplix has quit [Remote host closed the connection]
yasumi2136_ has joined #ruby
TCZ has quit [Quit: Leaving]
rose_nd_ash has quit [Ping timeout: 265 seconds]
yasumi2136 has quit [Ping timeout: 260 seconds]
xall__ has joined #ruby
Technodrome has joined #ruby
fercell has quit [Quit: WeeChat 2.8]
mossplix has joined #ruby
impermanence has joined #ruby
gitter1234 has quit [Quit: Connection closed for inactivity]
baojg has quit [Remote host closed the connection]
<tubbo>
al2o3-cr: i tried that but it only seems to be for refining class methods
<tubbo>
i can't actually call a class method, because the block's `self` is actually an anonymous module. i have no access to the actual class definition.
<tubbo>
refinements are lame :(
<al2o3-cr>
lol.
<tubbo>
what we _really_ want is locally-scoped reopenable classes :D
wymillerlinux has joined #ruby
<al2o3-cr>
tubbo: ok.
<al2o3-cr>
tubbo: try using a binding?
<al2o3-cr>
unbelievable, "refinements are lame"
markoong has quit [Ping timeout: 256 seconds]
Uncle_Cid has quit [Remote host closed the connection]
Uncle_Cid has joined #ruby
<tubbo>
what's unbelievable? they have such a narrow use case and there was just so much potential.
<al2o3-cr>
tubbo: ok.
<leftylink>
now I would like to try it
<leftylink>
let's go
<leftylink>
wfm
<tubbo>
haha
<tubbo>
y'all can ping me when you find an actual use for refinements
<tubbo>
j/k, i know what they work for...just kinda thought it was going to be more than that way back when it was first announced.
<leftylink>
&>> class Foo; def self.b; :orig_b end end; module Bar refine Foo.singleton_class do def a; "#{b} and new a" end end end; using Bar; Foo.a
<leftylink>
apparently I already did this on 2019-11-01 20:37:52 - and I must have forgotten it. that makes it all the more important that I remember it then, since it shows that I forgot it the first time
<leftylink>
can't make the same mistake twice
<leftylink>
s/can't/wouldn't want to/
<leftylink>
I hate being seen as a person who doesn't learn from past mistakes
<leftylink>
it is so frustrating
DarthGandalf has quit [Quit: Bye]
<al2o3-cr>
leftylink: that's what docs are for. ffs, no one can remember all of ruby.