havenwood changed the topic of #ruby to: Ruby 3.2.2, 3.1.4, 3.3.0-preview1: https://www.ruby-lang.org | Rules: https://ruby-community.com | Logs: https://libera.irclog.whitequark.org/ruby
goldfish has quit [Ping timeout: 245 seconds]
yziquel has quit [Quit: Client closed]
keb has quit [Quit: Leaving]
OverCoder has joined #ruby
constxqt has quit [Ping timeout: 258 seconds]
constxqt has joined #ruby
constxqt has quit [Ping timeout: 248 seconds]
constxqt has joined #ruby
blop_ has quit [Remote host closed the connection]
blop_ has joined #ruby
clemens3 has quit [Ping timeout: 245 seconds]
constxqt has quit [Ping timeout: 258 seconds]
clemens3 has joined #ruby
b3lm0nt has joined #ruby
OverCoder has quit [Quit: Connection closed for inactivity]
Vonter has joined #ruby
misper has joined #ruby
_ht has joined #ruby
duderonomy has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
misper has quit [Ping timeout: 246 seconds]
konsolebox has joined #ruby
_ht has quit [Quit: _ht]
grenierm has joined #ruby
hd1 has joined #ruby
hd1 has left #ruby [#ruby]
misper has joined #ruby
teclator has joined #ruby
misper has quit [Ping timeout: 244 seconds]
Vonter has quit [Ping timeout: 246 seconds]
Vonter has joined #ruby
tardybaker has quit [Server closed connection]
tardybaker has joined #ruby
infernix has quit [Server closed connection]
konsolebox has quit [Quit: Leaving]
taupiqueur_shiny has joined #ruby
infernix has joined #ruby
justache has quit [Server closed connection]
justache has joined #ruby
RDMengineer has quit [Ping timeout: 246 seconds]
joast has quit [Ping timeout: 245 seconds]
cnsvc has quit [Server closed connection]
cnsvc has joined #ruby
Vonter has quit [Ping timeout: 246 seconds]
RDMengineer has joined #ruby
supay has quit [Server closed connection]
Vonter has joined #ruby
supay has joined #ruby
brokkoli_origin has quit [Quit: (Leaving)]
brokkoli_origin has joined #ruby
willfish has joined #ruby
brokkoli_origin has quit [Ping timeout: 255 seconds]
brokkoli_origin has joined #ruby
Vonter has quit [Ping timeout: 246 seconds]
Vonter has joined #ruby
yziquel has joined #ruby
Vonter has quit [Ping timeout: 258 seconds]
Vonter has joined #ruby
grenierm has quit [Ping timeout: 245 seconds]
John_Ivan has quit [Ping timeout: 246 seconds]
Vonter has quit [Quit: WeeChat 4.0.4]
yziquel has quit [Quit: Client closed]
yziquel has joined #ruby
kiwi_36 has joined #ruby
Linux_Kerio has joined #ruby
Vonter has joined #ruby
joast has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
pounce has quit [Ping timeout: 246 seconds]
pounce has joined #ruby
nona has joined #ruby
<nona> Hi all!
yziquel has quit [Ping timeout: 245 seconds]
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
Vonter has quit [Ping timeout: 246 seconds]
Vonter has joined #ruby
konsolebox has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
OverCoder has joined #ruby
taupiqueur_shiny has joined #ruby
John86 has joined #ruby
taupiqueur_shiny has quit [Ping timeout: 245 seconds]
<John86> Hey, I'm having a hard time connecting to a db in production. The logs tell me ` /app/config/database.yml:27:in `<main>': undefined method `database' for nil:NilClass`. The yaml file is here: https://gist.github.com/jdescelliers/56f4c4fa5b52289bc58cca8866cf931a
<John86> I can connect to the db with my IDE with these settings on my local machine.
infinityfye has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Vonter has quit [Ping timeout: 258 seconds]
Tempesta has quit [Quit: See ya!]
taupiqueur_shiny has joined #ruby
taupiqueur_shiny has quit [Ping timeout: 245 seconds]
Tempesta has joined #ruby
constxqt has joined #ruby
taupiqueur_shiny has joined #ruby
<nona> how would y'all feel about a concern module with less than a dozen methods, none of which is used more than once by the 4 including controller classes? when is something like that warranted and when is it unnecessary, where, and how, does one draw the line? my own feeling is that it might have been created just out of dogmatic reasons ("this project uses concerns, so we must use them wherever
<nona> possible") by the original author...
<John86> Anyone to help me on the db connection string?
Linux_Kerio has quit [Ping timeout: 255 seconds]
splud has quit [Ping timeout: 248 seconds]
<nona> John86: since this seems to be a Rails app, I'm already confused by the path to your `database.yml`. Why is it in app/config/ and not config/? Aside from that, where does Rails.application.credentials.production.database come from and what is inside of it? Actually, first perhaps look at ENV.fetch("RAILS_MAX_THREADS") { 5 } since your error is in line 27 which includes the block from line 7. What
<nona> does the YAML file look like in its rendered form, without the ERB?
<nona> By the way, there is also a (very slow) #rubyonrails channel. I know I asked in here, myself, and not there, but just so you know, there's a good number of people in here who don't use Rails at all.
<nona> Another thought about your problem: if you want to go the easy path, and just for debugging, why not remove all the ERB from your database.yaml piece by piece and replace it with hard-coded strings?
yziquel has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
splud has joined #ruby
<konsolebox> John86: If I have that issue I'll just debug the code and examine why the property is nil; even modify the gem rb files if needed.
<konsolebox> John86: If the application exists because of the NilClass exception there's a good chance you can run a backtrace on it so you can know where to start examining the code. If you're using https://github.com/ruby/debug, you can setup a `catch Exception` and run `bt` once the exception is caught and causes a runtime break.
yziquel has quit [Quit: Client closed]
yziquel has joined #ruby
Vonter has joined #ruby
<konsolebox> s/exists/exits/
konsolebox has quit [Quit: Leaving]
Vonter has quit [Ping timeout: 245 seconds]
Vonter has joined #ruby
John86 has quit [Ping timeout: 245 seconds]
yziquel has quit [Quit: Client closed]
gcd has quit [Server closed connection]
gcd has joined #ruby
<ox1eef_> nona: The fact that it is used by four different controllers suggests that re-use is warranted.
eddof13 has joined #ruby
fcser has quit [Server closed connection]
fcser has joined #ruby
Fridtjof_ is now known as Fridtjof
John_Ivan has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teclator has quit [Ping timeout: 255 seconds]
phenom has quit [Server closed connection]
Linux_Kerio has joined #ruby
phenom has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
John_Ivan has quit [Read error: Connection reset by peer]
<nona> ox1eef_: even though every single method is only used once?
willfish has quit [Ping timeout: 246 seconds]
<nona> (i've since removed the one that was monkeypatching a part of Devise ... that was the only one which was used more than once, but also only by a single controller)
<johnjaye> does smalltalk also assume that method definitions are instance unless specified otherwise?
<johnjaye> now that I think about it java does that as well. it's just in java you have a 'this' keyword that means the current instance. but in ruby you only have 'self' which means the *class* not the instance
<johnjaye> so if i call self.foo in a method it's referring to a class method right
<weaksauc_> no self.foo inside a method would refer to the instance not the class. self.foo would refer to the class _object_ outside a method call though.
John_Ivan has joined #ruby
konsolebox has joined #ruby
John_Ivan has quit [Read error: Connection reset by peer]
John_Ivan has joined #ruby
_ht has joined #ruby
m_antis has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
m_antis has joined #ruby
<johnjaye> strange. so ruby 'self' is the same as java 'this'?
<johnjaye> not sure how to test the second thing you said about being outside a method call
gr33n7007h has quit [Ping timeout: 246 seconds]
gr33n7007h has joined #ruby
<weaksauc_> def self.foo end being the other thing or since it's all executable just outside the scope of a method
<johnjaye> when i do def self.foo in a class it becomes a class method.
<johnjaye> not an instance method. is this right
<weaksauc_> yeah
<johnjaye> ok. so self is not the same as this in java
<johnjaye> but if i refer to self.something inside a method body it's different?
<johnjaye> then it is the java 'this'?
<weaksauc_> the class itself is an object so def self.foo is operating on that object i guess you can say
<johnjaye> but inside a method of the class it's then operating as that individual object?
swaggboi has quit [Ping timeout: 240 seconds]
taupiqueur_shiny has joined #ruby
<johnjaye> so basically self changes meaning from the class to the instance depending on where you use it
Thanzex has quit [Quit: The Lounge - https://thelounge.chat]
Thanzex has joined #ruby
<weaksauc_> well at the time you invoke that self it's operating inside the instance object so self is the instance object
Vonter has quit [Ping timeout: 245 seconds]
<leftylink> I guess I disagree because I see it differently
<leftylink> pandabot rb class C; p [self, self.class] end
<pandabot> [C, Class] - 1 more lines - https://carc.in/#/r/fr3s
<ox1eef_> nona: Not sure I follow. If you mean that each controller uses exactly one method from the module, then sure, you could avoid the module altogether. But I think I'm lacking context.
r3m has quit [Quit: WeeChat 4.1.0-dev]
r3m has joined #ruby
phryk has quit [Server closed connection]
phryk has joined #ruby
<johnjaye> i think i'm just used to the java way where there is a separate keyword for class things ("static") and another for instance things ("this")
<johnjaye> in seems in ruby self can do both jobs based on context
<leftylink> because classes are instances of Class
<leftylink> therefore, in both contexts, it's the current receiver
ule has quit [Changing host]
ule has joined #ruby
Linux_Kerio has quit [Ping timeout: 255 seconds]
<johnjaye> ah ok. i guess a lot of this is smalltalk stuff because ruby is heavily influenced by it. at least what i've heard
<johnjaye> perl,smalltalk,eiffel,ada, and lisp was the exact list
<ox1eef_> I think the big difference between Java and Ruby in this context is that Java uses a class body to define code, where as Ruby uses it to run code.
kiwi_36 has quit [Remote host closed the connection]
infinityfye has quit [Quit: Leaving]
ox1eef_ has quit [Quit: Leaving]
ox1eef_ has joined #ruby
<johnjaye> i don't see the distinction
<johnjaye> i thought the big difference was ruby is more about the message send/receive model of objects
<ox1eef_> Sure, but in Ruby, the class body can contain code that is run at runtime, where as with Java, it serves purely to define code.
<ox1eef_> This goes back to your comment a few days ago, where you mentioned you can call new in a class body, and receive an instance of the class in return. That only works because the code is being run, vs serving as the blueprints for an AST.
konsolebox has quit [Quit: Leaving]
<weaksauc_> in fact that's what makes rails possible
<weaksauc_> has_many is just a function call
<weaksauc_> s/function/method
<johnjaye> oh i see
<johnjaye> yeah running code in a class doesn't make sense in java
<johnjaye> only main does that.
_ht has quit [Quit: _ht]
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
yziquel has joined #ruby
Pixi has quit [Quit: Leaving]
swaggboi has joined #ruby
gr33n7007h has quit [Ping timeout: 245 seconds]
Pixi has joined #ruby
Pixi has quit [Read error: Connection reset by peer]
Pixi has joined #ruby
gr33n7007h has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
eddof13 has joined #ruby
yziquel has quit [Quit: Client closed]
yziquel has joined #ruby
yziquel has quit [Quit: Client closed]
weathere1watcher has joined #ruby
weatheredwatcher has quit [Ping timeout: 246 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
yziquel has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
OverCoder has quit [Quit: Connection closed for inactivity]
yziquel has quit [Quit: Client closed]
dalan0382283 has quit [Ping timeout: 245 seconds]
yziquel has joined #ruby
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #ruby
swaggboi has quit [Quit: C-x C-c]
eddof13 has joined #ruby