havenwood changed the topic of #ruby to: Ruby 3.3.1, 3.2.4, 3.4.0-preview1 https://www.ruby-lang.org | Logs https://libera.irclog.whitequark.org/ruby
<[0x1eef]> teardown: I switched to Sequel recently (from ActiveRecord). I've felt outside my comfort zone many times. My usage is so basic I'm not sure it would be any help: https://github.com/0x1eef/twenty/blob/main/server/lib/twenty/server/model.rb
<[0x1eef]> This is how I create: https://github.com/0x1eef/twenty/blob/main/server/lib/twenty/server/graphql/mutation/create_task.rb - you'll find delete etc in same dir.
jhass has quit [Remote host closed the connection]
jhass has joined #ruby
<teardown> thank you [0x1eef] that helps a bit
<weaksauce> teardown adam12 used sequel a lot in the past and might have some insight
Obsdark has quit [Quit: Nettalk6 - www.ntalk.de]
reset has joined #ruby
cappy has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 252 seconds]
desnudopenguino1 is now known as desnudopenguino
Inline has quit [Ping timeout: 256 seconds]
fercell has joined #ruby
fercell_ has quit [Ping timeout: 256 seconds]
<teardown> thanks, weaksauce
<teardown> ERD -> https://termbin.com/ge2t
<teardown> source -> https://termbin.com/tt4r
<teardown> in the Server.create model class method, the only thing i can get to work is to pass in IDs in the params, and then set them on 'server' like 'server.domains_id= domain', where all the params i pass to that method are IDs for the FKs
<teardown> but if i do 'Server.new; Server.associations', i get an empty hash from the #associations method
cappy has quit [Quit: Leaving]
<teardown> I guess my assumption, which may be incorrect, is that by using an ORM (and going to the trouble to setup models and associations), i would be able to skip finding the FK IDs in my controllers, and just pass model objects into my Server.create method, and have the associtaions propagate the proper FK IDs into the :server table, like Server.create( Domain[3], Environment[2], LifecycleStage[1] )
<teardown> I used rails a bit a while back and i seem to remember doing things like '@server.domain' to get the whole associated Model from an instance of the Server model class, which is what i want from Sequel. Isn't that what using an ORM gets you?
<teardown> And i do not think that @server.associations should return {}
<teardown> Shouldn't it return all the associated models for a given Server instance?
<teardown> btw this is not a web app, im using ncurses via MRDialog as a frontend for a cli script
jmcgnh has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
jmcgnh has quit [Excess Flood]
jmcgnh has joined #ruby
dannyAAM has quit [Ping timeout: 260 seconds]
_whitelogger has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
dannyAAM has joined #ruby
hellstabber has joined #ruby
reset has quit [Quit: reset]
jmjl has quit [Quit: ~nyaa]
trillion_exabyte has quit [Ping timeout: 268 seconds]
trillion_exabyte has joined #ruby
gaussianblue has joined #ruby
jaredce has joined #ruby
hellstabber has quit [Quit: Connection closed for inactivity]
Inline has joined #ruby
xdminsy has quit [Ping timeout: 260 seconds]
Inline has quit [Ping timeout: 260 seconds]
weaksauce has quit [Read error: Connection reset by peer]
weaksauce has joined #ruby
Al2O3 has quit [Read error: Connection reset by peer]
trnzecs has joined #ruby
Inline has joined #ruby
<mooff> teardown: methods defined at the top level actually get defined as instance methods on Object, the parent class of almost everything
<mooff> that probably isn't the problem, but something to be aware of. they aren't file scoped...
xdminsy has joined #ruby
<mooff> @validations at the top level will be an instance variable on the special <main> object, which is the default self for required files (and the main script: ruby entrypoint.rb)
<mooff> so different model files would overwrite the same @validations if they use the same pattern
<mooff> do you know about binding.irb ? (or binding.pry, if you've required the 'pry' gem)
<mooff> that's handy for inspecting what's going on in these cases
otisolsen70 has joined #ruby
<mooff> i've not used Sequel, but the docs indicate server.domain should work if you have class Server < Sequel::Model; one_to_one :domain; end
otisolsen70 has quit [Remote host closed the connection]
trnzecs has quit [Remote host closed the connection]
otisolsen70 has joined #ruby
gaussianblue has quit [Quit: leaving]
xdminsy has quit [Remote host closed the connection]
xdminsy has joined #ruby
otisolsen70 has quit [Read error: Connection reset by peer]
hightower3 has quit [Remote host closed the connection]
Al2O3 has joined #ruby
Al2O3 has quit [Changing host]
Al2O3 has joined #ruby
Doc_X has quit [Quit: Cheers!]
Doc_X has joined #ruby
gaussianblue has joined #ruby
jaredce has quit [Ping timeout: 268 seconds]
jaredce has joined #ruby
cxl_ is now known as cxl
jaredce has quit [Ping timeout: 260 seconds]
tirnanog has joined #ruby
jaredce has joined #ruby
konsolebox has quit [Ping timeout: 264 seconds]
jaredce has quit [Ping timeout: 268 seconds]
jmjl has joined #ruby
jaredce has joined #ruby
jaredce has quit [Ping timeout: 260 seconds]
force8 has joined #ruby
force8 has quit [Remote host closed the connection]
jaredce has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
konsolebox has joined #ruby
konsolebox_ has joined #ruby
konsolebox has quit [Ping timeout: 268 seconds]
itaipu has quit [Ping timeout: 252 seconds]
Wagner has joined #ruby
<Wagner> Bom Dia! Sou iniciante na comunidade
<Wagner> Tem alguém do NORDESTE aqui?
rinkydink has joined #ruby
tirnanog has quit [Killed (NickServ (GHOST command used by rinkydink))]
rinkydink is now known as tirnanog
force8 has joined #ruby
force8 has quit [Remote host closed the connection]
dalan03822833508 has quit [Quit: Ping timeout (120 seconds)]
Aminda has quit [Ping timeout: 260 seconds]
Aminda has joined #ruby
Wagner has quit [Quit: Client closed]
trillion_exabyte has quit [Ping timeout: 264 seconds]
trillion_exabyte has joined #ruby
itaipu has joined #ruby
user71 has joined #ruby
cappy has joined #ruby
hightower2 has joined #ruby
jaredce has quit [Ping timeout: 264 seconds]
jaredce has joined #ruby
toad has joined #ruby
jaredce has quit [Ping timeout: 272 seconds]
Inline has quit [Read error: Connection reset by peer]
jaredce has joined #ruby
Inline has joined #ruby
gaussianblue has quit [Quit: leaving]
jaredce has quit [Ping timeout: 268 seconds]
dalan03822833508 has joined #ruby
moo- is now known as moo
llua` is now known as llua
toad has quit [Ping timeout: 250 seconds]
brokkoli_origin has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
dviola has quit [Quit: WeeChat 4.2.2]
hightower2 has quit [Ping timeout: 252 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
cappy has quit [Quit: Leaving]
hightower2 has joined #ruby
Tempesta_ has joined #ruby
Tempesta has quit [Ping timeout: 264 seconds]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
reset has joined #ruby
Obsdark has joined #ruby
Obsdark has quit [Changing host]
Obsdark has joined #ruby
user71 has quit [Quit: Leaving]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
polishdub has quit [Quit: leaving]
cappy has joined #ruby
reset has quit [Quit: reset]
osc4rpt has quit [Ping timeout: 255 seconds]
osc4rpt has joined #ruby
jmcgnh has quit [Remote host closed the connection]
<[0x1eef]> https://sequel.jeremyevans.net/rdoc/files/doc/association_basics_rdoc.html is worth a read if you haven't already. I'm adding relationships via a join table so it was insightful to see how you add a record into the join table (via 'add_<association_name>').
jmcgnh has joined #ruby
Vonter has quit [Ping timeout: 268 seconds]
polishdub has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
trillion_exabyte has quit [Read error: Connection reset by peer]
trillion_exabyte has joined #ruby
rinkydink has joined #ruby
tirnanog has quit [Ping timeout: 264 seconds]
joako has quit [Quit: quit]
joako has joined #ruby
jaredce has joined #ruby
jaredce has quit [Ping timeout: 264 seconds]