<mwlang>
Hi, I wanted to take a community pulse of sorts. Back in the day, one of the most common ways to wrap some behavior around a method called in another gem/library is was to do a method chaining where an alias for the original method is held and then a new method of the same name is defined. Nowadays, I think the recommended way is to use Ruby’s prepend and define a method of the same name in the prepended module in which super is called to pass along the call c
<mwlang>
Is this like “the gold standard” or is it just yet another technique that Ruby provides and both approaches remain equally viable?
coniptor has quit [Read error: Connection reset by peer]
Technodrome has joined #ruby
Glumetu has left #ruby [#ruby]
Rudd0 has joined #ruby
coniptor has joined #ruby
JanHebler[m] has joined #ruby
turt2live has joined #ruby
electragician has joined #ruby
jcp has joined #ruby
kateskips has joined #ruby
PaulB[m] has joined #ruby
jo-so has joined #ruby
bthompson90 has joined #ruby
MeVegantheythem[ has joined #ruby
swann11[m] has joined #ruby
DanielCarlsson[m has joined #ruby
tfreedman has joined #ruby
hsiktas[m] has joined #ruby
jordanh has joined #ruby
Cubixusin[m] has joined #ruby
Hanma[m] has joined #ruby
kinduff[m] has joined #ruby
trautwein has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
jenrzzz has joined #ruby
aNewNick has joined #ruby
aNewNick has left #ruby [#ruby]
aNewNick has joined #ruby
aNewNick is now known as bb8
gueorgui_ is now known as gueorgui
jl4 has joined #ruby
prestorium has joined #ruby
dnadev2 has joined #ruby
schaerli__ has quit [Ping timeout: 272 seconds]
jpz has quit [Ping timeout: 246 seconds]
<c355e3b>
iirc alias_method_chain's behavior is replaced by prepend entirely
<c355e3b>
you only need alias method to support 1.9
jpz has joined #ruby
Rudd0 has quit [Ping timeout: 244 seconds]
dfucci has quit [Ping timeout: 265 seconds]
<dnadev2>
looking for the best way to update all children after the parent is updated successfully https://dpaste.org/hRu9
schne1der has quit [Quit: schne1der]
<dnadev2>
havenwood, that's a refactor from my question last night. moved what i was trying back into the controller/model instead of trying do that dynamic attribute assignment stuff.
ChmEarl has joined #ruby
ruurd has quit [Quit: bye folks]
dfucci has joined #ruby
<havenwood>
dnadev2: question 1: Can you `task_params.except(:id)` instead?
<havenwood>
dnadev2: question 2: Rails 6 support bulk inserts.
ccooke has quit [Quit: leaving]
<dnadev2>
havenwood, rails 4 :/ (i know i know)
<havenwood>
dnadev2: You can do it yourself with your own SQL INSERT in prior versions of Rails, but Rails 6 supports it properly.
<dnadev2>
havenwood, so what i have there in the controller works; if it's not "that bad" of a design set-up i'd probably leave it as is vs. adding a gem, etc
<havenwood>
dnadev2: In a meeting, but glancing at it it seems you might want to extract that controller logic to a model.
<dnadev2>
np, thanks for the help
coniptor has quit [Ping timeout: 240 seconds]
Rudd0 has joined #ruby
rzjian has quit [Ping timeout: 272 seconds]
fercell has quit [Ping timeout: 256 seconds]
coniptor has joined #ruby
prestorium has quit [Ping timeout: 240 seconds]
prestorium has joined #ruby
BSaboia has joined #ruby
cloaked1 has joined #ruby
cloaked1 has joined #ruby
TomyWork has quit [Remote host closed the connection]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem has joined #ruby
jwr has joined #ruby
akem has quit [Client Quit]
kristian_on_linu has joined #ruby
<jwr>
I've got a Gemfile with `gem "pghero"`, and no version pin. When I run `bundle update pghero` I'm getting `Unable to find a spec satisfying pghero (>= 0) in the set. Perhaps the lockfile is corrupted`. The lockfile looks fine though. How would I troubleshoot that?
akem has joined #ruby
<havenwood>
jwr: Just to sanity check, does `gem install pghero` work?
<havenwood>
jwr: It could be a corrupt Gemfile.lock. Could you share the file?
<jwr>
havenwood: `gem install pghero` does work, though the gem itself was already installed via `bundle install`.
fippy has joined #ruby
<havenwood>
jwr: What version of bundler?
<jwr>
havenwood: Bundler version 1.17.2
<havenwood>
jwr: That's over two years old, so I'd be tempted to bump to latest Bundler and RubyGems.
<havenwood>
jwr: Does it work with Bundler 2, by chance? We might be able to spot the issue if you can share the Gemfile.lock.
kristian_on_linu has quit [Remote host closed the connection]
trautwein has quit [Ping timeout: 272 seconds]
akem has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
postmodern has joined #ruby
wald0 has joined #ruby
wald0 has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
tumdum has quit [Quit: Leaving]
jenrzzz has joined #ruby
coniptor has quit [Ping timeout: 260 seconds]
gix has joined #ruby
coniptor has joined #ruby
yagudaev has joined #ruby
yagudaev has quit [Client Quit]
cstrahan has quit [*.net *.split]
woodruffw has quit [*.net *.split]
shenghi1 has quit [*.net *.split]
Nightmare has quit [*.net *.split]
integral has quit [*.net *.split]
jnoon has quit [*.net *.split]
alnk has quit [*.net *.split]
woodruffw has joined #ruby
woodruffw has joined #ruby
integral has joined #ruby
jnoon has joined #ruby
alnk has joined #ruby
cstrahan has joined #ruby
shenghi1 has joined #ruby
Nightmare has joined #ruby
tumdum has joined #ruby
akem has quit [Quit: Leaving]
wald0 has quit [Quit: leaving]
Technodrome has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jl4 has quit [Ping timeout: 256 seconds]
NightMonkey has quit [Read error: Connection reset by peer]
NightMonkey has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
ur5us_ has joined #ruby
nofxx has joined #ruby
nofxx_ has quit [Ping timeout: 272 seconds]
cow[moo] has quit [Read error: Connection reset by peer]
jpz has quit [Ping timeout: 256 seconds]
jpz_ has joined #ruby
postmodern_ has joined #ruby
postmodern has quit [Ping timeout: 256 seconds]
dfucci has quit [Ping timeout: 256 seconds]
dfucci has joined #ruby
coniptor has quit [Read error: Connection reset by peer]
drnerdius has joined #ruby
drnerdius has quit [Client Quit]
mwlang has joined #ruby
coniptor has joined #ruby
<mwlang>
@c355e3b Thanks for your response on method-chaining vs. prepending. Are there any well-known blog posts specifically talking about this and explaining pros and cons of switching over to prepending?
BSaboia has quit [Quit: This computer has gone to sleep]
al2o3-cr has quit [Ping timeout: 256 seconds]
linoge has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
duderonomy has joined #ruby
ccooke has quit [Remote host closed the connection]
ccooke has joined #ruby
prestorium has quit [Ping timeout: 246 seconds]
<mwlang>
Thanks, @c355e3b That one was a very clear write up and spot on with what I was looking for.
prestorium has joined #ruby
dfucci has quit [Ping timeout: 265 seconds]
Rounin has quit [Ping timeout: 240 seconds]
rzjian has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
roshanavand1 has joined #ruby
TCZ has joined #ruby
roshanavand has quit [Ping timeout: 265 seconds]
roshanavand1 is now known as roshanavand
roshanavand has quit [Client Quit]
dfucci has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
orbyt_ has joined #ruby
al2o3-cr has joined #ruby
roshanavand1 has joined #ruby
roshanavand has quit [Ping timeout: 265 seconds]
roshanavand1 is now known as roshanavand
ur5us_ has quit [Ping timeout: 264 seconds]
chouhoulis has joined #ruby
coniptor has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Quit: WeeChat 3.0]
dfucci has quit [Ping timeout: 265 seconds]
al2o3-cr has joined #ruby
s3nd1v0g1us has joined #ruby
TCZ has quit [Quit: Eurydyko, nie czekaj na mnie]
coniptor has joined #ruby
s3nd1v0g1us has quit [Ping timeout: 240 seconds]
twitch has joined #ruby
ur5us_ has joined #ruby
s3nd1v0g1us has joined #ruby
jobewan has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
ur5us has joined #ruby
GodFather has quit [Ping timeout: 258 seconds]
ur5us_ has quit [Ping timeout: 260 seconds]
s3nd1v0g1us has quit [Quit: WeeChat 2.8]
GodFather has joined #ruby
venmx has joined #ruby
Sellow has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
<Sellow>
Are there any recommended resources to look at for learning slightly more about ruby/rails than the guide? I just finished reading all of it (up to digging deeper) but wasn't really sure where to look about a couple questions I had, like transformations of inputs when creating models
<Sellow>
Also where do I go to find canonical docs for the standard library? e.g. if I google ruby string downcase I get taken to https://apidock.com/ruby/v2_5_5/String/downcase which is an old version, and it doesn't seem to document 3.0.0
coniptor has quit [Ping timeout: 240 seconds]
<apotheon>
Sellow: I find better documentation via ddg than google.
<apotheon>
The top result in ddg for "ruby string downcase" (without quotes) is:
<apotheon>
. . . and ruby-doc.org seems to be the best stdlib and core documentation I've found.
coniptor has joined #ruby
<Sellow>
Surprised there's not an official site like pretty much every other mainstream language has
<apotheon>
I gave up on Google years ago. Once in a while, there's something for which I get better results on Google, but when I compare results ddg almost always wins for relevance and value.
<apotheon>
That might be reversed for average people, whose preference is to see the newest flash-in-the-pan timewaster, and Google heavily weights results toward newness over reliable value.
<apotheon>
If you want documentation maintained by the core team, you might need to know Japanese.
<apotheon>
As far as I'm concerned, though, ruby-doc.org essentially *is* official documentation.
roshanavand has quit [Quit: roshanavand]
<apotheon>
Sellow: There's also ri.
<Sellow>
Ri?
<apotheon>
$ ri String#downcase
jenrzzz has quit [Ping timeout: 240 seconds]
<apotheon>
command line documentation
<apotheon>
It's installed by default with (most?) Ruby distributions.
<Sellow>
Oh that's very nice
<Sellow>
thank you :)
<apotheon>
welcome
<mwlang>
I google a bit more precisely and get excellent results most of the time with google. “Ruby String class downcase”. If I want a specific Ruby version, “Ruby 2.7 Array class inject”. (for example)
<apotheon>
Being precise with Google searches is getting increasingly difficult over time, though, as the machine learning systems running the show become more and more prone to ignoring searchers' precision, from what I've seen and experienced.
<apotheon>
I miss the days when plus and minus signs actually meant something in a Google search.
jenrzzz has joined #ruby
<Sellow>
Ri is fantastic, wow
Axy has joined #ruby
Mia has quit [Read error: Connection reset by peer]