havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: 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!
schne1der has quit [Ping timeout: 272 seconds]
jcalla has quit [Ping timeout: 240 seconds]
davidw has quit [Ping timeout: 268 seconds]
galaxie has quit [Ping timeout: 240 seconds]
s3nd1v0g1us has joined #ruby
galaxie has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
<Pika> this seems to imply that there's an _insert_attributes method I can use to add attributes but when I call ._insert_attribute({ key: "value"}) I just get an error stack level too deep.
<phaul> RIP Jim
<phaul> idk, this code might not be compatible with more recent MRIs
<phaul> there was a talk he made on xmlbuilder.. btw. which is worth watching.. it's on youtube
<phaul> but I don't believe the code is maintained
<leftylink> interesting
<leftylink> I was about to say that order is only necessary in the world where hashes are unordered, but I guess the hash could also be ordered but in the wrong order that you don't want it
<lmat> I'm using rails with minitest. I'm writing an integration test for my controller. When I call nearly any action on my controller, it checks to see if the current user is logged in. How do I get my test logged in?
Inline has quit [Quit: Leaving]
<lmat> I'm hoping there's something super simple like login user; but this will have to get into the session state (?) which isn't available during unit tests (?)
<Pika> wait WHAT
<Pika> this guy is no longer with us?
<Pika> is this why people use the nekogiri builder?
<Pika> Does the nekogiri builder even have a way to add attributes after the fact?
<Pika> *nokogiri =X
davidw has joined #ruby
<Pika> My issue is also that I'm on ruby 2.33 and I think the nokogiri requires 2.4?
<havenwood> Pika: Yes, jimweirich passed away. Now you've made me cry. Stop that. He was incredibly giving, creative, smart and the best of Rubyists. See the tribute on his last commit in 2014. https://github.com/jimweirich/wyriki/commit/d28fac7f18aeacb00d8ad3460a0a5a901617c2d4
<phaul> We got so much briliant stuff from him. rake for instance
<havenwood> lmat: Consider writing a test helper for #logged_in? if you're doing your own auth.
<havenwood> lmat: Maybe something like: def logged_i?; if integration_test?; !!controller.current_user if controller.respond_to? :current_user; else; !session[:user_id].nil?; end; end
<Pika> damn... that's really sad :{
<adam12> We lost a lot of great Rubyists over the last 10 years :\ Ezra, Jim, James Golick, Prakash off the top of my head. Probably more.
<adam12> Pika: Jim was a great public speaker. You should watch some of his talks (and maybe the one where he sings Has Anybody Seen My Code?)
<Pika> I will look into it! Thank you very much for letting me know :D
davidw has quit [Ping timeout: 268 seconds]
impermanence has quit [Ping timeout: 260 seconds]
lineus has quit [Ping timeout: 240 seconds]
FernandoBasso has quit [Remote host closed the connection]
rainmanj_ has quit []
rainmanjam has joined #ruby
<adam12> gitter1234: Looks like you can't use `attach` in a callback. In the callback, try something like `self.avatar = StringIO.new(Identicon.blob_for(email))`
<adam12> Pika: Do you have an example of what you're working on? Something I could reproduce locally?
<Pika> I just switched to the nokogiri xml builder which seems to let me do what I wanted :{
<adam12> Pika: Great!
<Pika> :D
lineus has joined #ruby
jcalla has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
markopasha has quit [Quit: Leaving]
fphilipe_ has joined #ruby
wildtrees has quit [Quit: Leaving]
Pika has quit [Ping timeout: 260 seconds]
Swyper has quit [Remote host closed the connection]
ttoocs has joined #ruby
anveo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tpanarch1st_ has joined #ruby
tpanarch1st has quit [Ping timeout: 255 seconds]
pandakekok9 has joined #ruby
zdm has quit [Remote host closed the connection]
fphilipe_ has quit [Ping timeout: 272 seconds]
Bounga has joined #ruby
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 260 seconds]
Bounga has quit [Ping timeout: 272 seconds]
akemhp_ has joined #ruby
pandakekok9 has quit [Ping timeout: 240 seconds]
akem__ has quit [Ping timeout: 272 seconds]
pandakekok9 has joined #ruby
AJA4350 has joined #ruby
Swyper has joined #ruby
zdm has joined #ruby
Swyper has quit [Remote host closed the connection]
shirak_ has quit [Ping timeout: 265 seconds]
mossplix has quit [Remote host closed the connection]
Swyper has joined #ruby
akem__ has joined #ruby
akemhp has joined #ruby
akemhp_ has quit [Ping timeout: 258 seconds]
davidw has joined #ruby
davidw has quit [Changing host]
davidw has joined #ruby
akem__ has quit [Ping timeout: 272 seconds]
troulouliou_dev has quit [Quit: Leaving]
bruce_lee has quit [Ping timeout: 272 seconds]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
zdm has quit [Quit: zdm]
davidw has quit [Ping timeout: 272 seconds]
zdm has joined #ruby
troulouliou_dev has joined #ruby
zdm has quit [Client Quit]
zdm has joined #ruby
fphilipe_ has joined #ruby
jerme_ has quit [Ping timeout: 265 seconds]
matti has quit [Ping timeout: 265 seconds]
wbnns has quit [Read error: Connection reset by peer]
ryzokuken has quit [Read error: Connection reset by peer]
wbnns has joined #ruby
ryzokuken has joined #ruby
matti has joined #ruby
s3nd1v0g1us has quit [Quit: WeeChat 2.6]
jerme_ has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
ctp has quit [Ping timeout: 258 seconds]
mossplix has joined #ruby
ctp has joined #ruby
d0liver has quit [Ping timeout: 260 seconds]
d0liver has joined #ruby
duderonomy has joined #ruby
grilix has quit [Ping timeout: 245 seconds]
AJA4350 has quit [Quit: AJA4350]
grilix has joined #ruby
jenrzzz has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
jaequery has quit [Remote host closed the connection]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
mossplix has quit [Remote host closed the connection]
bambanx has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
s2013 has joined #ruby
<s2013> >> a = [1,2,3]; a.last;
<s2013> >> a = [1,2,3]; p a.last;
<havenwood> #=> 3
<s2013> #=> 3
<s2013> how do you do the ruby thin on irc?
<s2013> like run the code
pandakekok9 has quit [Remote host closed the connection]
bambanx has quit [Client Quit]
pandakekok9 has joined #ruby
<havenwood> s2013: &>>
<havenwood> s2013: Whatcha trying to show?
<s2013> &>> p "hi"
<rubydoc> # => "hi"... check link for more (https://carc.in/#/r/8fa5)
<s2013> ok cool
<s2013> &>> a = [1,2,3]; a.last = a.last + 1;
<rubydoc> stderr: -e:4:in `<main>': undefined method `last=' for [1, 2, 3]:Array (NoMethodError)... check link for more (https://carc.in/#/r/8fa6)
<s2013> &>> a = [1,2,3]; a[a.length - 1] = a[a.length - 1] + 1;
<havenwood> s2013: Please try in your local REPL first.
<rubydoc> # => 4 (https://carc.in/#/r/8fa7)
<s2013> no i know. thats what im trying to show
<s2013> why doesnt the .last work
<s2013> or is it that you cant set value to it
<havenwood> s2013: precedence
mossplix has joined #ruby
<s2013> so like a.first / .last etc will only return value but wont change it right?
<havenwood> s2013: a.last is: 3
<havenwood> s2013: what does it mean: 3 =
<s2013> but a[a.length-1] is also 3
<havenwood> s2013: you can't assign integers
<havenwood> s2013: #[]= is a method
<havenwood> s2013: the syntax is sugar
<s2013> oh ok
<s2013> yea i was trying to understand underneath the hood of why it happened, make sense now
<havenwood> s2013: yeah, the #[]= sugar is confusing
<s2013> gotcha
fphilipe_ has quit [Ping timeout: 272 seconds]
cthu| has quit [Ping timeout: 240 seconds]
mossplix has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 240 seconds]
hays has quit [Quit: No Ping reply in 180 seconds.]
hays has joined #ruby
Frobozz has joined #ruby
pikaChokeMe has joined #ruby
<pikaChokeMe> is there a way to check which version of ruby nokogiri supports?
<pikaChokeMe> I want like... the latest version that works with ruby 2.3
<havenwood> pikaChokeMe: Ruby 2.3 isn't maintained any longer, but Nokogiri CI does currently cover 2.3 on the latest version.
<pikaChokeMe> I know. I work for bad software company that refuse to update legacy product :{
Frobozz has quit [Client Quit]
<pikaChokeMe> I tried to run this and like... I didn't get any errors... but I also didn't get my puts "OUTPUT either....
<pikaChokeMe> so I thought maybe that was wrong... now I think maybe I'm just stupid or something
<pikaChokeMe> is there anything obviousish I've missed?
fphilipe_ has joined #ruby
s3nd1v0g1us has joined #ruby
gix has joined #ruby
gix- has quit [Ping timeout: 258 seconds]
impermanence has joined #ruby
s3nd1v0g1us has quit [Quit: WeeChat 2.6]
orbyt_ has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
_whitelogger has joined #ruby
polishdub has joined #ruby
bsdbandit-01 has joined #ruby
envex has joined #ruby
bsdband75 has joined #ruby
bsdband54 has joined #ruby
bsdbandit-01 has quit [Ping timeout: 260 seconds]
bsdband75 has quit [Ping timeout: 248 seconds]
alexherbo28 has joined #ruby
unreal has quit [Ping timeout: 240 seconds]
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo28 is now known as alexherbo2
alex`` has quit [Ping timeout: 268 seconds]
hays has quit [Quit: No Ping reply in 180 seconds.]
alex`` has joined #ruby
zdm has quit [Read error: Connection reset by peer]
hays has joined #ruby
unreal has joined #ruby
turbo_choo has joined #ruby
donofrio has quit [Remote host closed the connection]
davor has quit [Ping timeout: 268 seconds]
davor has joined #ruby
bsdband54 has quit [Quit: -a- IRC for Android 2.1.55]
bsdbandit-01 has joined #ruby
polishdub has quit [Quit: leaving]
turbo_choo has quit [Ping timeout: 268 seconds]
turbo_choo has joined #ruby
guardian has quit [Ping timeout: 258 seconds]
guardian has joined #ruby
Bounga has joined #ruby
guardian has quit [Ping timeout: 268 seconds]
Bounga has quit [Ping timeout: 272 seconds]
im0nde_ has quit [Ping timeout: 272 seconds]
im0nde has joined #ruby
guardian has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
guardian has quit [Ping timeout: 240 seconds]
guardian has joined #ruby
guardian has quit [Ping timeout: 260 seconds]
guardian has joined #ruby
noodle has quit [Quit: /quit]
weeirc8087 has joined #ruby
turbo_choo has quit [Ping timeout: 272 seconds]
turbo_choo has joined #ruby
noodle has joined #ruby
gix has quit [Ping timeout: 272 seconds]
guardian has quit [Ping timeout: 240 seconds]
<gitter1234> adam12: Hey! :-) I regret to inform: Could not find or build blob: expected attachable: https://gist.github.com/1234dev/94000c5202907e973949ae907bbac0c2
guardian has joined #ruby
subfj has joined #ruby
subfj has quit [Client Quit]
subfj has joined #ruby
Bounga has joined #ruby
subfj_ has joined #ruby
subfj has quit [Ping timeout: 272 seconds]
weeirc8087 has quit [Ping timeout: 272 seconds]
Bounga has quit [Ping timeout: 260 seconds]
guardian has quit [Ping timeout: 272 seconds]
sauvin has joined #ruby
sauvin has quit [Max SendQ exceeded]
Swyper has quit [Remote host closed the connection]
sauvin has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jintseng has joined #ruby
subfj_ is now known as subfj
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
subfj_ has joined #ruby
subfj has quit [Ping timeout: 268 seconds]
pandakekok9 has quit [Ping timeout: 240 seconds]
epistrephein has joined #ruby
guardian has joined #ruby
subfj_ is now known as subfj
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
epistrephein has quit [Client Quit]
bruce_lee has quit [Ping timeout: 240 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
tsujp has joined #ruby
Bounga has joined #ruby
Bounga has quit [Ping timeout: 245 seconds]
go|dfish has quit [Ping timeout: 265 seconds]
go|dfish has joined #ruby
cliluw has joined #ruby
suukim has joined #ruby
TCZ has joined #ruby
sergioro has quit [Quit: leaving]
nofxx has quit [Ping timeout: 240 seconds]
nofxx has joined #ruby
pandakekok9 has joined #ruby
tfreedman has joined #ruby
AJA4350 has joined #ruby
tf20 has joined #ruby
<tf20> so, I have a bit of a problem
<tf20> so I recently upgraded to Ruby 2.7 on an install of rails I have
<tf20> it works, unfortunately, rails is now kinda broken
<tf20> I need to run rails c and paste in a bunch of stuff, and it seems that IRB now has a bug where pasting lots of stuff basically doesn't work
<tf20> so now I'm trying to just downgrade IRB to 0.9.6, but that seems to be somewhat difficult to do
<tf20> Gem irb-1.2.1 cannot be uninstalled because it is a default gem
<tf20> and I can't just throw that in my gemfile with a pinned version, for the same reason
<tf20> so I guess the question is, what do I do
rubydoc has quit [Ping timeout: 265 seconds]
ursu has joined #ruby
TCZ has quit [Quit: Bye Bye]
jintseng has quit [Ping timeout: 268 seconds]
solars has quit []
solars has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
Inline has joined #ruby
SCHAPiE has quit [Quit: ZNC - https://znc.in]
schne1der has joined #ruby
SCHAPiE has joined #ruby
guardian has quit [Ping timeout: 268 seconds]
guardian has joined #ruby
tfreedman has left #ruby ["User left"]
pandakekok9 has quit [Ping timeout: 240 seconds]
pandakekok9 has joined #ruby
n1v has quit []
n1v has joined #ruby
weeirc8087 has joined #ruby
guardian has quit [Ping timeout: 268 seconds]
xco has joined #ruby
guardian has joined #ruby
subfj has quit [Quit: Textual IRC Client: www.textualapp.com]
schne1der has quit [Ping timeout: 260 seconds]
Ai9zO5AP has joined #ruby
guardian has quit [Ping timeout: 268 seconds]
tpanarch1st_ has quit [Ping timeout: 255 seconds]
alexherbo24 has joined #ruby
alex`` has quit [Ping timeout: 272 seconds]
alexherbo2 has quit [Ping timeout: 272 seconds]
alexherbo24 is now known as alexherbo2
Bounga has joined #ruby
guardian has joined #ruby
alex`` has joined #ruby
Bounga has quit [Remote host closed the connection]
Fernando-Basso has joined #ruby
guardian has quit [Ping timeout: 258 seconds]
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
guardian has joined #ruby
pandakekok9 has quit [Ping timeout: 240 seconds]
sameerynho has joined #ruby
sagax has quit [Ping timeout: 265 seconds]
rippa has joined #ruby
pandakekok9 has joined #ruby
guardian has quit [Ping timeout: 268 seconds]
guardian has joined #ruby
Rugo has joined #ruby
sagax has joined #ruby
guardian has quit [Ping timeout: 272 seconds]
markopasha has joined #ruby
markopasha has quit [Remote host closed the connection]
guardian has joined #ruby
SCHAPiE has quit [Quit: ZNC - https://znc.in]
markopasha has joined #ruby
rubydoc has joined #ruby
ursu has quit [Ping timeout: 272 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SCHAPiE has joined #ruby
tsujp has joined #ruby
guardian has quit [Ping timeout: 258 seconds]
guardian has joined #ruby
weeirc8087 has quit [Ping timeout: 265 seconds]
gix has joined #ruby
tfreedman has joined #ruby
guardian has quit [Ping timeout: 258 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pandakekok9 has quit [Ping timeout: 240 seconds]
guardian has joined #ruby
Fernando-Basso has quit [Quit: Leaving]
pandakekok9 has joined #ruby
guardian has quit [Ping timeout: 260 seconds]
<gitter1234> Trying to make it so that users must be approved by admin before they can post. Also trying to get it as RESTful as possible too: https://gist.github.com/1234dev/0f37e7935bf2efe85070bd1a7786d1a4 - any thoughts? Getting `No route matches {:action=>"update", :controller=>"approvals"}, missing required keys: [:id]`
guardian has joined #ruby
tsujp has joined #ruby
troulouliou_dev has joined #ruby
guardian has quit [Ping timeout: 260 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guardian has joined #ruby
alexherbo22 has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo22 is now known as alexherbo2
alex`` has quit [Ping timeout: 265 seconds]
alex`` has joined #ruby
lucasb has joined #ruby
TCZ has joined #ruby
fphilipe_ has quit [Ping timeout: 260 seconds]
<lmat> havenwood: Thanks!
<lmat> havenwood: Are you suggesting adding that helper into "production" code? And it has a special path for integration tests to get the test logged in?
<lmat> havenwood: The login function looks like this: session[:user_id] = user.id
<lmat> havenwood: Oh yeah, that's what you have. But what is "controller" in what you posted? (!!controller.current_user if controller.respond_to? :current_user)
Swyper has joined #ruby
<lmat> undefined method `integration_test?'
tsujp has joined #ruby
cd has joined #ruby
<lmat> Is this just common parlance!? def integration_test?; defined?(post_via_redirect); end;
fphilipe_ has joined #ruby
pandakekok9 has quit [Quit: Overthrow the fascist regime of Rodrigo Duterte! VIVA CPP-NPA-NDF!]
_phaul has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
ZAJDAN has joined #ruby
fratis has joined #ruby
<ZAJDAN> hi..created own class: https://termbin.com/sqsd ...and from controller I try call class method: https://termbin.com/v4yz
Ven`` has joined #ruby
<ZAJDAN> NoMethodError in WelcomeController#login
<ZAJDAN> I have to create some error exception?
<lmat> I'm super-duper new. (learned ruby *and* rails yesterday.) use pry?
fratis has quit [Read error: Connection reset by peer]
fratis has joined #ruby
Fernando-Basso has joined #ruby
Ven`` has quit [Read error: No route to host]
fratis has quit [Read error: Connection reset by peer]
Ven`` has joined #ruby
fratis has joined #ruby
TCZ has quit [Quit: Bye Bye]
grilix has quit [Ping timeout: 246 seconds]
kristian_on_linu has joined #ruby
weeirc8087 has joined #ruby
grilix has joined #ruby
_phaul is now known as phaul
<fratis> @ZAJDAN Can you paste the full NoMethodError?
<ZAJDAN> yes..moment
schne1der has joined #ruby
fphilipe_ has quit [Ping timeout: 272 seconds]
bvdw has quit [Read error: Connection reset by peer]
fphilipe_ has joined #ruby
bvdw has joined #ruby
<fratis> Couple things. First, it looks like your call should be to ServiceLayer.login, not ServiceLayer.new.login, since login is a class method, not an instance method.
<fratis> Second, your login method doesn't have any arguments defined, so when you pass @credentials to it, the method isn't actually able to do anything with them.
<ZAJDAN> thank YOu...a first I will fix the with the new
<lmat> I have a rails controller with a "new" action. The body of that new action is one line: @transaction = TransactionLog.new;
<lmat> When I call that action from a unit test, I see the following in the logs:
<lmat> Started GET "/transactions/new" Processing by TransactionsController#new as HTML
<lmat> Rendering users/new.html.erb within layouts/login
<lmat> Why would /transactions/new/ render users/new.html.erb ?
<ZAJDAN> fratis: how can I pass the params or variable from the controller to the class method?
<fratis> instead of def self.login, do def self.login credentials
<fratis> then in the method, you can use `credentials` as a local variable containing whatever you passed to it
<ZAJDAN> aha gonna try it..thank you
<lmat> I looked at rails routes | less; and it looks sane: https://paste.rs/Rlm
<ZAJDAN> fratis: and in the controller it should be as shared variable? @credentials
<fratis> @lmat I'm pretty sure that's just a rails convention
<fratis> @ZAJDAN Hard to know without more context, but that seems reasonable.
DaRock has quit [Ping timeout: 265 seconds]
<lmat> fratis: There is a convention that /transactions/new goes to users/new.html.erb? That's a bad convention ;-)
<fratis> Oh I missed that! :P
kristian_on_linu has quit [Remote host closed the connection]
guardian has quit [Ping timeout: 272 seconds]
<fratis> Looks like you might have some kind of authentication mechanism that's rendering the login screen bc the user doesn't have access to transactions/new?
<fratis> Wild guess.
<lmat> fratis: Excellent guess, I'll take a look.
<lmat> I have a log in helper function that appears to be succeeding...maybe I should assert that it succeeds.
gray_-_wolf has quit [Quit: WeeChat 2.7]
<lmat> Yeah, after post login_path params: {session:.....} I added assert_redirected_to "/"; This succeeds for my already-succeeding test (post transactions_path), but does not succeed for the new test: get new_transaction_path
<lmat> How do I verify that the "new" action is actually being called?
guardian has joined #ruby
<fratis> Add a puts in there and check your logs?
<lmat> fratis: What should I try to log? new_transaction_path ?
<lmat> That gives /transactions/new
<fratis> I mean in your `def new` method, put a line at the beginning that says something like `puts "THE NEW ACTION IS NOW RUNNING Y'ALL WOO HOO"`
<fratis> then watch your terminal to see if that shows up
<lmat> yeah, okay.
<lmat> I don't know if that works in unit tests... seems like anything I put there is eaten away...I don't know if I've tried puts though
<lmat> puts doesn't work on the working test...
weeirc8087 has quit [Ping timeout: 240 seconds]
<lmat> fratis: No sweat. I'm sure it'll be stupid when I get to the bottom of it!
anveo has joined #ruby
guardian has quit [Ping timeout: 268 seconds]
<havenwood> lmat: I don't consider anything in the test/ dir "production."
<havenwood> lmat: I'd only add the test helper there.
guardian has joined #ruby
weeirc8087 has joined #ruby
guardian has quit [Client Quit]
markopasha has quit [Remote host closed the connection]
<lmat> havenwood: cool, okay!
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<lmat> havenwood: you suggested doing session[:user_id] in that logged_in? function. Can you do that from an integration test?
<havenwood> lmat: Sorry, I should have mentioned to define it inside: class ActiveSupport::TestCase
<lmat> no sweat :-)
<havenwood> lmat: no, the session is for the other part of the if statement
<havenwood> lmat: sec, let me give you a better example
<havenwood> lmat: i left out multiple important things
weeirc8087 has quit [Ping timeout: 268 seconds]
<lmat> havenwood: I have these tests: https://imgur.com/SAVhisr.png The first one passes. The second one says https://imgur.com/8tM3xfm.png /transactions/new renders users/new.html.erb?
<lmat> havenwood: Thanks!
<havenwood> lmat: that's ^ one way to do it. i dunno if Rails 6 has any helpers along these lines.
<havenwood> I haven't had a Rails app since 5.2.
weeirc8087 has joined #ruby
<lmat> havenwood: defined?(post_via_redirect) is false even in my integration tests. I noticed that it's deprecated, and I figured it has been removed in my version?
<havenwood> lmat: yup, i'm dated it seems
<havenwood> lmat: looking at an old codebase of mine that's no longer maintained
<havenwood> lmat: maybe there's a helper now? if not, you could pick another thing only available in integration tests. it's not a pretty solution.
<havenwood> (or do separate helpers)
<lmat> havenwood: I have these tests: https://imgur.com/SAVhisr.png The first one passes. The second one says https://imgur.com/8tM3xfm.png /transactions/new renders users/new.html.erb?
<lmat> havenwood: Separate helpers makes a lot of sense. Another idea would be to use introspection on the currently-running test?
<havenwood> I've not been doing Rails for too long. (Just looked and last app I worked on was 5.0, not 5.2.)
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
jokester has joined #ruby
jokester has quit [Client Quit]
jokester has joined #ruby
<havenwood> lmat: From just the code you've shown, I don't see the issue.
<lmat> havenwood: :'( I'll keep digging
jokester has quit [Client Quit]
<havenwood> lmat: You might try the #rails channel or the Rails Slack. Can you just share the repo you're working on? Someone might be able to help you track it down with the code.
<havenwood> lmat: Just an assertion of a new_ and a ROLLBACK isn't anything to go on. (At least not that my pre-coffee brain can spot.)
<lmat> havenwood: Can't share the code.
<lmat> havenwood: I just learned ruby yesterday. I was hoping there would be something obvious ^_^
jokester has joined #ruby
<havenwood> lmat: Not in what you've shown. PS - It's better to share text rather than images, for a variety of reasons.
<lmat> havenwood: okay
jokester has quit [Client Quit]
<havenwood> lmat: If you could share the relevant part of your schema and model, someone can probably spot the issue.
<havenwood> lmat: Often, with Rails, folk will share a Gist with multiple files listed. Rails breaks things apart into different folders so you have to gather the relevant parts together for someone to get the picture.
<havenwood> ?gist lmat
<havenwood> lmat: https://gist.github.com/
<havenwood> Or for quick pastes: https://dpaste.de/
fratis has quit [Remote host closed the connection]
<lmat> havenwood: sweet
<havenwood> lmat: With gists, just add multiple files and make sure to name them like the actual file.
<havenwood> That way you give context and get proper syntax highlighting.
<havenwood> lmat: for example: ## error
<havenwood> ActiveRecord::AssociationTypeMismatch in Cp/usersController#update
<lmat> Okay, I think I follow.
<havenwood> lmat: For your case, I'd think the relevant parts would be the routes, controller, model, maybe schema, test, and fixtures?
<lmat> havenwood: Yeah, that makes sense.
howaboutyes has joined #ruby
Ven`` has joined #ruby
<lmat> havenwood: You know...there probably shouldn't be a handler for new transactions. They should only be created by the backend...
<lmat> I'll just delete the new action, and add only: [:create] in the routes.
reber has joined #ruby
bsdband10 has joined #ruby
factormystic has quit [Ping timeout: 260 seconds]
bsdbandit-01 has quit [Ping timeout: 265 seconds]
sergioro has joined #ruby
bsdband10 has quit [Ping timeout: 252 seconds]
impermanence has quit [Ping timeout: 272 seconds]
howaboutyes has quit [Quit: Leaving]
<adam12> gitter1234: Why'd you change from a link to a form for approving?
factormystic has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
<gitter1234> Oh hey there adam12! It was suggested to me by this guy in the slack channel. He insisted it was the right thing to do since I've disabled JS. I'll probably change it to a button_to later on and use CSS to disguise it as a link.
<adam12> gitter1234: You won't be able to use the update route that Rails creates for you if you're doing it like that. It expects an id in the URL (so you pass it to the route helper). If you want to continue using checkboxes like you are, you'll need a different style route that doesn't accept any params. If you want to go back to how it was, use link_to or button_to, and just force the method as `put`.
<adam12> gitter1234: Oh! You disabled JS.
reber_ has joined #ruby
<gitter1234> Yep. Part of the reason he wanted me to change was to make it more RESTful as well. I'm not yet sure how I feel about it though
<adam12> gitter1234: You could still use button_to I think. IIRC, it generates a form for you.
<gitter1234> I most likely will use button_to. Checkbox for this kinda stuff feels a bit odd :)
<adam12> button_to "Approve User", approval_path(your_user), method: :put
<adam12> My knowledge of Rails is ancient so it's challenging to remember.
reber has quit [Ping timeout: 268 seconds]
<gitter1234> :D
<adam12> Also, when using gist, can you break up your files into multiple files inside the gist? There's an Add File button. As havenwood mentioned above to someone else, it adds syntax highlighting which can be helpful when looking at strange code quickly.
<gitter1234> oh yeah! i was considering that
<gitter1234> i think it should be possible to do ```rb to enable syntax highlighting as well though
<adam12> gitter1234: That might work fine too. Either or, but syntax highlighting makes it a bit more enjoyable.
<gitter1234> a bit selfish of me perhaps. ill start enabling it from now on :)
Emmanuel_Chanel has joined #ruby
<havenwood> gitter1234: more folk help with syntax highlighting. i know i sometimes ignore questions without the pretty colors as a lure.
<gitter1234> i didnt know that was a thing
_phaul has joined #ruby
<adam12> Easy to look at issues definitely get more eyeball from me as well. And a reproducable example I'll usually try immediately.
<gitter1234> tbh im part color blind so it didnt really matter to me lol
Swyper has quit [Remote host closed the connection]
<gitter1234> nice
<gitter1234> reproducable example what do you mean?
<adam12> gitter1234: Hard with Rails because changes sprawl multiple files (so it would have to be a git repo) but the entire problem in something I can download and run.
<gitter1234> i remember runnable.com which used to let you run live rails apps, was pretty cool while it lasted
phaul has quit [Ping timeout: 260 seconds]
Swyper has joined #ruby
<gitter1234> ill start doing that from now on too. i always wanted to ask you and the others - do you want the full app?
<havenwood> Pry and pry-doc now work on master branches, if anyone is annoyed at 2.7 warnings. Grab latest commit with:
<havenwood> gem install specific_install && gem specific_install https://github.com/pry/pry.git && gem specific_install https://github.com/pry/pry-doc.git
<adam12> gitter1234: If you're working on an app that can be shared, it's easier to do it like that. Especially if you're using stock database connections like sqlite and files.
<adam12> havenwood: Ah nice. I saw that error a few days ago and was wondering if I should dig into it.
<adam12> havenwood: I did 2 weeks of Ruby tips for my current consulting gig and the last tip was Ruby documentation tooling / access.
<havenwood> adam12: Just need releases cut now.
<adam12> havenwood: And inevitably `? somemethod` was spewing warnings.
<havenwood> Hahah
<havenwood> Yeah
<adam12> gitter1234: If you share the full app we might be able to fix your avatar bits.
<gitter1234> working on it :D
bsdbandit-01 has joined #ruby
<lmat> Rails: I'm testing a controller action (index). Index is called using get transaction_path; after returning from my index function, the application hangs before returning control back to my test.
<lmat> It's hanging in middleware somewhere. The processor is pegging the whole time.
<lmat> Using pry and stepping, it looks like a deadlock? (but the processor is being used, so live lock?)
subfj has joined #ruby
impermanence has joined #ruby
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
bsdbandit-01 has joined #ruby
pikaChokeMe has quit [Ping timeout: 258 seconds]
<gitter1234> Here we go fellas - https://github.com/1234dev/myblog
<gitter1234> wait wait
sgen has joined #ruby
TCZ has joined #ruby
<gitter1234> adam12: OK
<gitter1234> had to add a missing commit. also the description says "Simple, secure" but im sure my controllers are full of vulnerabilities
subfj has quit [Ping timeout: 265 seconds]
subfj has joined #ruby
sergioro has quit [Quit: Lost terminal]
wildtrees has joined #ruby
wildtrees has quit [Max SendQ exceeded]
mossplix has joined #ruby
Guest7 has joined #ruby
schne1der has quit [Ping timeout: 260 seconds]
Swyper has quit [Remote host closed the connection]
_phaul has quit [Ping timeout: 240 seconds]
Guest7 is now known as umpah-pah
phaul has joined #ruby
jintseng has joined #ruby
Swyper has joined #ruby
wildtrees has joined #ruby
Swyper has quit [Remote host closed the connection]
orbyt_ has joined #ruby
wildtrees has quit [Max SendQ exceeded]
wildtrees has joined #ruby
wildtrees has quit [Max SendQ exceeded]
umpah-pah has quit [Quit: Textual IRC Client: www.textualapp.com]
wildtrees has joined #ruby
jintseng has quit [Quit: Leaving]
phaul has quit [Ping timeout: 260 seconds]
wildtrees has quit [Max SendQ exceeded]
wildtrees has joined #ruby
Guest7 has joined #ruby
wildtrees has quit [Max SendQ exceeded]
reber has joined #ruby
phaul has joined #ruby
wildtrees has joined #ruby
wildtrees has quit [Max SendQ exceeded]
reber_ has quit [Ping timeout: 258 seconds]
jintseng has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
GodFather has joined #ruby
Swyper has joined #ruby
Guest7 is now known as umpah-pah
kristofferR has joined #ruby
kristofferR has quit [Remote host closed the connection]
jintseng has quit [Ping timeout: 260 seconds]
xxdxxd has joined #ruby
kristofferR has joined #ruby
Swyper has quit [Remote host closed the connection]
xxdxxd has quit [Ping timeout: 258 seconds]
Ven`` has quit [Ping timeout: 258 seconds]
Ven`` has joined #ruby
sgen has quit [Ping timeout: 248 seconds]
SuperL4g has joined #ruby
phaul has quit [Remote host closed the connection]
weeirc8087 has quit [Ping timeout: 240 seconds]
SuperLag has quit [Ping timeout: 260 seconds]
SuperLag has joined #ruby
Ai9zO5AP has quit [Quit: WeeChat 2.5]
<gitter1234> removed some obsolete db fields that might cause trouble. might wanna pull latest..
phaul has joined #ruby
SuperL4g has quit [Ping timeout: 268 seconds]
oncall-pokemon has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wildtrees has joined #ruby
subfj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
wildtrees has quit [Remote host closed the connection]
Ai9zO5AP has joined #ruby
wildtrees has joined #ruby
wildtrees has quit [Max SendQ exceeded]
phaul has joined #ruby
ur5us has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
reber_ has joined #ruby
suukim has quit [Quit: Konversation terminated!]
reber has quit [Ping timeout: 240 seconds]
Ai9zO5AP has quit [Ping timeout: 268 seconds]
Ven`` has joined #ruby
jintseng has joined #ruby
jintseng has quit [Max SendQ exceeded]
jintseng has joined #ruby
reber_ has quit [Quit: Leaving]
reber has joined #ruby
mossplix has quit [Remote host closed the connection]
weeirc8087 has joined #ruby
mossplix has joined #ruby
ur5us has quit [Quit: Leaving]
freshmaker666 has joined #ruby
reber has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
subfj has joined #ruby
<adam12> gitter1234: what were you trying to fix? avatar and ?
<leftylink> huh, I wonder if it's just me or there have really been more rails questions in here lately
<leftylink> that would probably explain why I have felt like there are fewer questions I know how to answer in here anymore
<adam12> leftylink: Last few days there have been.
<lupine> if only there were a channelfor it
<gitter1234> adam: avatar and giving admin the ability to choose who gets to write posts - https://github.com/1234dev/myblog-with-approval
<gitter1234> * adam123
<gitter1234> * adam12
ur5us has quit [Read error: Connection reset by peer]
jintseng has quit [Ping timeout: 248 seconds]
mossplix has quit [Remote host closed the connection]
ZAJDAN1 has joined #ruby
Ai9zO5AP has joined #ruby
ZAJDAN has quit [Ping timeout: 272 seconds]
<adam12> Installing sassc 2.2.1 with native extensions zzzzzzzzz
<adam12> Forgot how slow compiling sassc was. Haven't touched sass since I started using Tailwind.
<gitter1234> cool
<gitter1234> ive actually completed the layout based on www.bulma.io which i'll merge once these other issues have been fixed.. not the biggest fan of css frameworks since they really mess up the semantics of the html but.. quick and easy if one has better things to do i guess
<adam12> gitter1234: You'd probably hate Tailwind then :)
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gitter1234> :D
<adam12> Tailwind, Unpoly, and AlpineJS have really changed the way I build apps.
subfj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ZAJDAN1> hi ..In controller I have: @credentials = params[:session].to_json ...how could I pass this variable into my class method which I have in /lib
AndroidKK is now known as AndroidKitKat
weeirc8087 has quit [Ping timeout: 240 seconds]
bvdw has quit [Read error: Connection reset by peer]
phaul_ has joined #ruby
bvdw has joined #ruby
wildtrees has joined #ruby
<gitter1234> adam12 :)
Ven`` has joined #ruby
renich has joined #ruby
ZAJDAN has joined #ruby
Ai9zO5AP has quit [Ping timeout: 240 seconds]
Ai9zO5AP has joined #ruby
ZAJDAN1 has quit [Ping timeout: 268 seconds]
mossplix has joined #ruby
DaRock has joined #ruby
bruce_lee has quit [Ping timeout: 258 seconds]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
shirak_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
sgen has joined #ruby
TCZ has quit [Quit: Bye Bye]
bitwinery has joined #ruby
troulouliou_dev has joined #ruby
bitwinery has quit [Max SendQ exceeded]
bitwinery has joined #ruby
schne1der has joined #ruby
poontangmessiah has joined #ruby
code_zombie has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #ruby
chalkmonster has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
umpah-pah has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
weeirc8087 has joined #ruby
genpaku has quit [Remote host closed the connection]
alexherbo20 has joined #ruby
genpaku has joined #ruby
alexherbo2 has quit [Ping timeout: 258 seconds]
alex`` has quit [Ping timeout: 258 seconds]
alexherbo20 is now known as alexherbo2
TCZ has joined #ruby
Fernando-Basso has quit [Remote host closed the connection]
Ven`` has quit [Read error: Connection reset by peer]
alex`` has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
subfj has joined #ruby
phaul_ has quit [Ping timeout: 258 seconds]
phaul has quit [Ping timeout: 258 seconds]
phaul_ has joined #ruby
phaul has joined #ruby
markopasha has joined #ruby
TCZ has quit [Quit: Bye Bye]
dionysus69 has joined #ruby
subfj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cliluw has quit [Read error: Connection reset by peer]