havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby
TCZ has quit [Client Quit]
TCZ has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cnsvc has joined #ruby
Esa__ has joined #ruby
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
DispelUndead has joined #ruby
cagomez has joined #ruby
troulouliou_div2 has joined #ruby
cagomez has quit [Ping timeout: 252 seconds]
DispelUndead has quit [Read error: Connection reset by peer]
chalkmonster has joined #ruby
troulouliou_div2 has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 272 seconds]
infernix has joined #ruby
TCZ has quit [Quit: Leaving]
LtHummus has quit [Quit: ZNC 1.7.5 - https://znc.in]
TCZ has joined #ruby
TCZ has quit [Client Quit]
troulouliou_div2 has joined #ruby
chalkmonster has quit [Ping timeout: 258 seconds]
imadper has joined #ruby
LtHummus has joined #ruby
ur5us has joined #ruby
LtHummus has quit [Quit: ZNC 1.7.5 - https://znc.in]
<banisterfiend> havenwood: can'tfind any info about your right-hand assignment operator
<banisterfiend> link?
<havenwood> banisterfiend: https://bugs.ruby-lang.org/issues/15921
chalkmonster has joined #ruby
alfiemax has joined #ruby
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> I've tried: validates :region_id, presence: true, if: !account_id.nil?
<TzilTzal> but I get an error saying account_id doesn't exist.
<leitz> If another_column isn't nil, it never checks the first column you mentioned.
<leitz> There's a difference between a variable having a nil value, and not existing.
<leitz> TzilTzal, if defined?(another_column)
<leitz> might give you what you need.
<TzilTzal> account_id is another column
<TzilTzal> I just use unless: -> {account_id.nil?}
<TzilTzal> seems ok
jinmiaoluo has quit [Ping timeout: 256 seconds]
* leitz isn't familiar with that dialect of Ruby.
<giorgian> TzilTzal: if: :account_id should also work
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cliluw has joined #ruby
Mikaela_ has quit [Quit: Mikaela_]
cliluw has quit [Ping timeout: 240 seconds]
burningserenity has joined #ruby
phaul has joined #ruby
caterfxo has quit [Ping timeout: 256 seconds]
Swyper has joined #ruby
caterfxo has joined #ruby
troulouliou_div2 has joined #ruby
burningserenity has quit [Quit: Leaving.]
hiroaki has joined #ruby
alfiemax has joined #ruby
kiboneu has joined #ruby
zacts has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
xco has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
fercell has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
hiroaki has quit [Ping timeout: 258 seconds]
ChmEarl has joined #ruby
impermanence has joined #ruby
Swyper has quit [Remote host closed the connection]
d3bug has joined #ruby
hiroaki has joined #ruby
Swyper has joined #ruby
<TzilTzal> Is it possible for a model M to be dynamically retrieved from different databases?
<TzilTzal> As in: some instances should have a connect_to database: A and others connect_to database: B
burningserenity has joined #ruby
dviola has quit [Quit: WeeChat 2.8]
kickr has joined #ruby
vlouvet has quit [Quit: Leaving]
kickr has quit [Client Quit]
<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
arcaos has joined #ruby
jeromelanteri has joined #ruby
<TzilTzal> giorgian: looks like https://github.com/thiagopradi/octopus/ is just what I need...
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]
MrCrackPot has joined #ruby
conta has joined #ruby
Ven`` has joined #ruby
TCZ has joined #ruby
TCZ has quit [Client Quit]
TCZ has joined #ruby
TzilTzal has quit [Quit: Leaving.]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
giorgian has quit [Quit: restart emacs]
Swyper has quit [Remote host closed the connection]
giorgian has joined #ruby
Bounga has quit [Ping timeout: 264 seconds]
SeepingN has joined #ruby
davispuh has joined #ruby
howdoi has joined #ruby
cliluw has joined #ruby
sergioro has joined #ruby
cliluw has quit [Ping timeout: 252 seconds]
Ai9zO5AP has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
Xiti has quit [Quit: Leaving]
Xiti has joined #ruby
fercell has quit [Quit: WeeChat 2.8]
cagomez has quit [Remote host closed the connection]
cow[moo] has joined #ruby
schne1der has quit [Quit: schne1der]
ellcs has joined #ruby
conta has quit [Quit: conta]
cow[moo] has quit [Quit: Textual IRC Client: www.textualapp.com]
fercell has joined #ruby
cow[moo] has joined #ruby
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 256 seconds]
buckworst has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
ctOS has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ruby
ellcs has quit [Ping timeout: 246 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
cliluw has joined #ruby
ellcs has joined #ruby
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
ivanskie has joined #ruby
anujmore has quit [Quit: anujmore]
burningserenity has quit [Ping timeout: 272 seconds]
gueorgui has joined #ruby
mwlang has joined #ruby
buckworst has joined #ruby
<mwlang> Is there the concept of, not so much as putting a Thread to sleep, but yielding it so another thread in schedule runs?
ivanskie has quit [Quit: Textual IRC Client: www.textualapp.com]
<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]
vondruch has quit [Ping timeout: 260 seconds]
vondruch_ is now known as vondruch
gix has quit [Quit: Client exiting]
ivanskie has joined #ruby
ivanskie has quit [Quit: Textual IRC Client: www.textualapp.com]
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.
ur5us has joined #ruby
Ven`` has quit [Quit: Textual IRC Client: www.textualapp.com]
drincruz has joined #ruby
sagax has quit [Remote host closed the connection]
gitter1234 has quit [Quit: Connection closed for inactivity]
impermanence has quit [Quit: Connection closed]
travonted has quit [Quit: WeeChat 2.8]
felix_221986 has joined #ruby
ellcs has quit [Ping timeout: 246 seconds]
chalkmonster has quit [Quit: WeeChat 2.8]
felix_221986 has quit [Quit: Connection closed]
sergioro has quit [Ping timeout: 264 seconds]
mwlang has quit [Quit: mwlang]
rmnull has joined #ruby
sagax has joined #ruby
leitz has quit [Quit: Leaving]
sergioro has joined #ruby
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest51428 has joined #ruby
renich has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
<Guest51428> Hey guys, anyone tute how to turn off windows features in Wine ruby??
banisterfiend_ has joined #ruby
Milos has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Ping timeout: 260 seconds]
banisterfiend_ is now known as banisterfiend
kristian_on_linu has joined #ruby
Milos has joined #ruby
banisterfiend has quit [Ping timeout: 260 seconds]
drincruz has quit [Ping timeout: 250 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
oneeggeach has joined #ruby
oneeggeach has quit [Client Quit]
Guest51428 has quit [Ping timeout: 256 seconds]
<havenwood> Guest51428: What are the Windows features?
<havenwood> &>> Object != Object.dup
<rubydoc> # => true (https://carc.in/#/r/8wis)
<havenwood> That ^ surprised me...
sarink has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarink has quit [Ping timeout: 258 seconds]
impermanence has joined #ruby
renich has quit [Quit: renich]
renich has joined #ruby
<giorgian> havenwood: well, that's how dup works. Hello = Object.dup ; Hello.instance_eval { def hello ; :hello ; end }; Hello.hello
TCZ has quit [Quit: Leaving]
<giorgian> you woudn't want Object.hello to be defined, at this point
<havenwood> giorgian: 'giorgian'.dup == 'giorgian' #=> true
<havenwood> giorgian: Object.dup == Object #=> false
<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]
sarink has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Quit: dionysus69]