Sina has quit [Quit: Connection closed for inactivity]
gix has quit [Ping timeout: 250 seconds]
anujmore has quit [Ping timeout: 256 seconds]
chalkmonster has quit [Quit: WeeChat 2.8]
_whitelogger has joined #ruby
ChmEarl has quit [Quit: Leaving]
chalkmonster has joined #ruby
troulouliou_div2 has quit [Ping timeout: 258 seconds]
SeepingN has quit [Read error: Connection reset by peer]
SeepingN has joined #ruby
banisterfiend has quit [Quit: banisterfiend]
SeepingN has quit [Ping timeout: 240 seconds]
troulouliou_div2 has joined #ruby
SeepingN has joined #ruby
banisterfiend has joined #ruby
alfiemax has quit [Ping timeout: 265 seconds]
Esa__ has quit []
hiroaki has quit [Ping timeout: 264 seconds]
bhaak has quit [Ping timeout: 265 seconds]
polishdub has joined #ruby
nofxx_ has quit [Read error: Connection reset by peer]
nofxx__ has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
zacts has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
donofrio has quit [Remote host closed the connection]
imadper has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 252 seconds]
MrCrackPot has quit [Quit: Leaving]
imadper has joined #ruby
banisterfiend has quit [Quit: banisterfiend]
zacts has quit [Quit: WeeChat 2.7.1]
`Alison has quit [Quit: ZNC 1.7.4+deb4 - https://znc.in]
cliluw has quit [Ping timeout: 256 seconds]
`Alison has joined #ruby
sauvin has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
hassox has quit [Remote host closed the connection]
shalok has quit [Ping timeout: 256 seconds]
shalok has joined #ruby
evdubs has quit [Quit: Leaving]
evdubs has joined #ruby
titanbiscuit has quit [Ping timeout: 264 seconds]
titanbiscuit has joined #ruby
alfiemax has joined #ruby
_whitelogger has joined #ruby
MrCrackPot has joined #ruby
polishdub has quit [Quit: leaving]
sergioro has quit [Quit: leaving]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sergioro has joined #ruby
Mikaela_ has joined #ruby
MrCrackPot has quit [Quit: Leaving]
bhaak has joined #ruby
alfiemax has quit [Remote host closed the connection]
howdoi has quit [Quit: Connection closed for inactivity]
nofxx_ has joined #ruby
jinmiaoluo1 has joined #ruby
nofxx__ has quit [Ping timeout: 265 seconds]
jinmiaoluo1 is now known as jinmiaoluo
jinmiaoluo has quit [Quit: WeeChat 2.7.1]
jinmiaoluo has joined #ruby
phaul has quit [Quit: :wq]
conta has joined #ruby
schne1der has joined #ruby
zapata has quit [Quit: WeeChat 2.8]
jinmiaoluo has quit [Ping timeout: 265 seconds]
jinmiaoluo has joined #ruby
Ai9zO5AP has quit [Remote host closed the connection]
ldepandis has joined #ruby
ur5us has joined #ruby
TzilTzal has joined #ruby
<TzilTzal>
Hi
<TzilTzal>
Is it possible to add a restriction in a migration so that a column can be null if-and-only-if another column is null?
vondruch has joined #ruby
vondruch has left #ruby [#ruby]
vondruch has joined #ruby
Bounga has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 256 seconds]
darkstar_13 has joined #ruby
xco has joined #ruby
cliluw has joined #ruby
ur5us has joined #ruby
roadie has joined #ruby
cliluw has quit [Ping timeout: 265 seconds]
zapata has joined #ruby
gix has joined #ruby
Ven`` has joined #ruby
<al2o3-cr>
havenwood: looking @ issue 15921 about the rightward assignment operator, how does it differentiate what `expr in var` does now (last comment).
<al2o3-cr>
&>> ->(n) { n ** 1.fdiv(2) } in sqr_r; sqr_r.(1764)
<rubydoc>
# => 42.0 stderr: -e:4: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby! (https://carc.in/#/r/8wea)
leitz has joined #ruby
<al2o3-cr>
&>> true ? :yay : :nay in answer; "Answer is #{answer}"
<rubydoc>
# => "Answer is yay" stderr: -e:4: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby! (https://carc.in/#/r/8wec)
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
<leitz>
Is there a way to take a string, like "Hash", and use it to call new? my_str = "Hash", my_str.respond_to?(:new)
<leitz>
Ah! Module.const_get
alfiemax has joined #ruby
ritalinona has quit [Ping timeout: 240 seconds]
ritalinona has joined #ruby
jinmiaoluo has quit [Quit: WeeChat 2.7.1]
<al2o3-cr>
eindoofus: rubydoc.info is back up
AndreYuhai has joined #ruby
<AndreYuhai>
Hey there, I want to use ActiveRecords without Rails but when I use establish_connection method with my credentials, connected? method returns false. Any idea?
<AndreYuhai>
I am going to share a link to what I am using
<giorgian>
AndreYuhai: after enstablish_connection, call ActiveRecord::Base.connection
<giorgian>
after that, ActiveRecord::Base.connected? will be true
<giorgian>
establish_connection doesn't *actually* establish the connection
<giorgian>
(try with bad credentials: you'll only get the error upon calling .connection)
<AndreYuhai>
giorgian, thank you so much! :) By the way, before adding ActiveRecord::Base.connection I was still able to query the table. Why is that? If I was not connected.
dionysus69 has joined #ruby
<giorgian>
well, querying the database will establish the connection if it's not already established
jinmiaoluo has joined #ruby
<AndreYuhai>
giorgian, Uh huh! Thank you :)
jinmiaoluo has quit [Remote host closed the connection]
miskatonic has joined #ruby
gix has quit [Quit: Client exiting]
gix has joined #ruby
alfiemax has quit [Remote host closed the connection]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jinmiaoluo has joined #ruby
jinmiaoluo has quit [Client Quit]
lxsameer has quit [Quit: WeeChat 2.8]
sergioro has quit [Quit: leaving]
lxsameer has joined #ruby
cd has quit [Quit: cd]
Ven`` has joined #ruby
caterfxo has quit [Quit: leaving]
caterfxo has joined #ruby
jinmiaoluo has joined #ruby
ur5us has quit [Ping timeout: 272 seconds]
Ai9zO5AP has joined #ruby
caterfxo has quit [Quit: leaving]
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
conta has quit [Quit: conta]
banisterfiend has joined #ruby
<leitz>
How do you trap errors for Module.const_get?
<leitz>
Or just use regular error handling?
caterfxo has joined #ruby
anujmore has joined #ruby
<TzilTzal>
Is there a validator that checks that a column is null if and only if another column is null?
<leitz>
TzilTzal, "if" tests with "and" fail early. So if another_column.nil? and column.nil?
<TzilTzal>
giorgian: almost what I need.. but I need to setup the shards based on the settings in a yaml file. Also, I need the shards to be accessed based on some criteria...
<TzilTzal>
is this possible?
<giorgian>
It should be possible, but I've never tried and don't know exactly how to do it
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<giorgian>
TzilTzal: it has been merged into rails 6
<TzilTzal>
oh.
<TzilTzal>
yeah, just noticed this
<giorgian>
rails 6 is the first release that natively supports multi database, with contributions from github and other big orgs (don't remember which).
cagomez has joined #ruby
<giorgian>
The docs talk about how to separate the write instance and the read replica, or how to use different read replicas for, say, heavy statistics, but I haven't stumbled upon anything that describes in detail how to do horizontal sharding
<TzilTzal>
well, if it's possible without an external gem that's better.. but not entirely sure yet.
<TzilTzal>
Octopus seems to give most of what's needed.
<apotheon>
When I first saw "model M" I thought of the IBM Model M keyboard.
rippa has joined #ruby
hiroaki has quit [Ping timeout: 256 seconds]
davispuh has joined #ruby
alfiemax has quit [Remote host closed the connection]
<mwlang>
I am writing some unit tests between a producer and consumer (each in it’s own thread) but even added “sleep(0.001)” in the loop for 5 iterations is ballooning the test run times 10 times over not having the sleep call.
burningserenity has joined #ruby
burningserenity has quit [Max SendQ exceeded]
burningserenity has joined #ruby
<mwlang>
…ah! Thread.pass looks like what I was chasing after.
evdubs_ is now known as evdubs
akem_ has joined #ruby
akem has quit [Ping timeout: 250 seconds]
travonted89 has joined #ruby
travonted89 has quit [Remote host closed the connection]
gitter1234 has joined #ruby
vondruch_ has joined #ruby
travonted has joined #ruby
fercell has quit [Read error: Connection reset by peer]
troulouliou_div2 has quit [Ping timeout: 260 seconds]
Bounga has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
lucasb has joined #ruby
zacts has quit [Quit: WeeChat 2.7.1]
zacts has joined #ruby
fluxAeon has quit [Ping timeout: 258 seconds]
ellcs has joined #ruby
fluxAeon has joined #ruby
troulouliou_div2 has joined #ruby
TCZ has joined #ruby
ctOS has quit [Quit: Connection closed for inactivity]
Bounga has quit [Ping timeout: 265 seconds]
darkphnx4805 has quit [Ping timeout: 256 seconds]
mwlang_ has joined #ruby
darkphnx4805 has joined #ruby
mwlang has quit [Ping timeout: 260 seconds]
mwlang_ is now known as mwlang
mwlang has quit [Client Quit]
MrCrackPot has quit [Quit: Leaving]
<howdoi>
is expect(method_with_types).to_not respond_to(:method_only_for_specific_type_in_this_model) a code smell?
naught-fowl has joined #ruby
wildtrees has joined #ruby
haylon[m] has joined #ruby
burningserenity has quit [Ping timeout: 258 seconds]
execat[m] has joined #ruby
mwlang has joined #ruby
jeromelanteri has quit [Quit: Leaving]
AndreYuhai has quit [Remote host closed the connection]
<mwlang>
Is there an elegant way to interrupt an Enumerator that is waiting on Ruby Queue class’s #pop(false) when the queue’s empty?
<mwlang>
my hacky solution was to set a boolean flag the enumerator can see and then push nil onto the queue
<adam12>
mwlang: Can you raise StopIteration ?
<mwlang>
if I raise that outside the enumerator, how does Ruby tie it back to the specific enumerator?
<mwlang>
If I’m in the enumerator’s local scope, I see how raising that helps break the loop and do use it for when what’s popped off the queue is nil.
<mwlang>
well, more specifically, ClosedQueueError, since we’re talking Queue class here.
<howdoi>
can know which modal is operating on the data, by looking at the migration file?
<giorgian>
ruby considers most literals to be equl
<giorgian>
equal
<giorgian>
strings, numbers, hashes, etc
<havenwood>
giorgian: Yeah, I just expected core classes to behave the same. They just don't.
<havenwood>
giorgian: It'd be easy enough to do, but they'd say "show my why you need this" and it's not code I want to show. :P Also, I don't need it.
<havenwood>
howdoi: What do you mean by "modal"?
<giorgian>
havenwood: you really don't want different classes to be equal
<havenwood>
giorgian: A duplicate is a different matter.
<havenwood>
giorgian: A duplicate of the metaclass itself, I mean.
<havenwood>
giorgian: I don't think it matters, just ran into it in some code and remarked.
nofxx_ has quit [Remote host closed the connection]
<howdoi>
havenwood: I meant, app/models/
nofxx_ has joined #ruby
<giorgian>
howdoi: what do you mean?
<havenwood>
howdoi: The db/schema.rb shows a cumulative result of applying all the migrations. That shows what shape the DB is in, so it reflects on what the models are working with but you'd have to look in the model itself for details of what's being done.
<havenwood>
howdoi: I don't get your "which model is operating on the data" question either.
<giorgian>
migrations do not need models to operate on the db
<giorgian>
You can have migrations doing all sort of things without ever writing any model
<howdoi>
nods, thanks, i just git greped
giorgian has quit [Quit: late]
banisterfiend has joined #ruby
<howdoi>
is there a easy way to remove all the binding.pry from the code base?
banisterfiend has quit [Remote host closed the connection]
davispuh has quit [Ping timeout: 250 seconds]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
fierycatnet has joined #ruby
sarink has joined #ruby
ritalinona has quit [Remote host closed the connection]
ritalinona has joined #ruby
davispuh has joined #ruby
wildtrees has quit [Remote host closed the connection]