« Back to channel list

#RubyOnRails - 28 June 2017

« Back 1 day Forward 1 day »
[00:00:27] Maletor: you da best
[00:01:03] Maletor: i totally see where i went wrong now
[00:01:07] Rodya_: has joined #RubyOnRails
[00:01:22] Maletor: read the code more slowly. discover this module adds things to ad::req
[00:02:11] Radar: all good :)
[00:05:31] Maletor: props to answering a question with so very little context and knowing what the hell i'm talking about
[00:08:31] brent__: has joined #RubyOnRails
[00:08:40] arBmind: has joined #RubyOnRails
[00:17:19] mwlang: what in the world is “prepend Module.new { … }” :-o
[00:20:18] jphase: has joined #RubyOnRails
[00:22:18] mwlang: ah, found a good article on that. glad to know it’s new to Ruby 2.0 and not something I just didn’t know about for years and years… https://hashrocket.com/blog/posts/module-prepend-a-super-story
[00:24:04] hahuang65: has joined #RubyOnRails
[00:24:14] Jameser: has joined #RubyOnRails
[00:28:27] patarr: has joined #RubyOnRails
[00:30:19] quirkycoders: has joined #RubyOnRails
[00:35:53] zacts: has joined #RubyOnRails
[00:37:28] mostlybadfly: has joined #RubyOnRails
[00:41:49] jhfisc: has joined #RubyOnRails
[00:44:41] Rodya_: has joined #RubyOnRails
[00:52:09] SteenJobs: has joined #RubyOnRails
[00:55:42] jhfisc: has joined #RubyOnRails
[01:00:36] jhfisc: has joined #RubyOnRails
[01:02:01] patarr: has joined #RubyOnRails
[01:02:13] delgiudices: has joined #RubyOnRails
[01:10:00] umaaji: has joined #RubyOnRails
[01:10:23] sevenseacat: has joined #RubyOnRails
[01:11:38] PresidentBiscuit: has joined #RubyOnRails
[01:18:08] Jameser: has joined #RubyOnRails
[01:21:01] workmad3: has joined #RubyOnRails
[01:27:52] jhfisc: has joined #RubyOnRails
[01:33:47] jhfisc: has joined #RubyOnRails
[01:36:15] r3vDev: has joined #RubyOnRails
[01:37:54] irishfromua: has joined #RubyOnRails
[01:42:26] patarr: has joined #RubyOnRails
[01:42:40] cam27: has joined #RubyOnRails
[01:48:12] cam27: In this line of code, <% @articles.each do |article| %> I believe what I just read is that @articles takes in a collection of records so when i do <td><%= link_to 'Show', article_path(article) %></td> I am working with just the curent record, correct?
[01:49:15] cam27: I’m not coding along with the tutorial (to save time), but just want to make sure that (article) is the current record
[01:50:19] irishfromua: has joined #RubyOnRails
[01:50:37] sevenseacat: @articles is a variable you define to hold whatever you want it to contain, in this case it should be something enumerable or you'll get an error
[01:51:18] sevenseacat: the each block will iterate over the objects in the @articles variable, assigning each one to `article` in turn for you to do something with
[01:52:00] sevenseacat: these are ruby concepts - not specific to rails
[01:59:40] cam27: Ok, so the “article” in the article_path does what?
[02:00:12] cam27: passes the id of that record?
[02:01:04] sevenseacat: if you're following conventions, generates a URL to that article's show page. http://guides.rubyonrails.org/routing.html#path-and-url-helpers
[02:01:24] hahuang65: has joined #RubyOnRails
[02:10:32] Radar: cam27: fun thing: you could also do <%= link_to 'Show', article %> and it would do the same thing.
[02:10:44] Radar: I explain how that works here: http://ryanbigg.com/2012/03/polymorphic-routes
[02:11:07] sevenseacat: very fun thing, but I tend to avoid it unless necessary to save possible confusion :)
[02:11:58] quirkycoders: has joined #RubyOnRails
[02:12:24] irishfromua: has joined #RubyOnRails
[02:15:35] tanuki: has joined #RubyOnRails
[02:17:38] cam27: Cool, thanks for the link Radar
[02:18:20] xx00__: has joined #RubyOnRails
[02:18:56] cam27: I read the Rspec book in one week and the Well Grounded Rubyiist very recently, now I’m going through the Rails guides again. THis time knowing Ruby though. I’m just curious if people are putting that much emphasis on BDD with Cucumber?
[02:19:59] hahuang65: has joined #RubyOnRails
[02:20:01] cam27: Cauase I’ve only really seen RSpec in a lot of tutorials (which I believe is more like TDD)
[02:23:23] harfangk: has joined #RubyOnRails
[02:23:48] Radar: cam27: BDD with RSpec + Capybara is now my favourite.
[02:25:32] sevenseacat: rspec+capybara are awesome.
[02:25:45] cam27: Is Cucumber in the mix?
[02:26:00] sevenseacat: not for apps I work on, anymore
[02:26:05] cam27: And I read that Capybara has pretty much superceded Webrat
[02:26:15] jhfisc: has joined #RubyOnRails
[02:26:20] sevenseacat: it did, many moons ago
[02:26:46] cam27: And what about Jasmine and Teaspoon for JS?
[02:26:53] sevenseacat: that I don't know
[02:37:07] jhfisc: has joined #RubyOnRails
[02:38:09] biox: has joined #RubyOnRails
[02:39:31] D9: has joined #RubyOnRails
[02:40:33] jhfisc: has joined #RubyOnRails
[02:43:42] bazzy: has joined #RubyOnRails
[02:45:21] cam27: What is your development process?
[02:47:33] jhfisc: has joined #RubyOnRails
[02:52:07] jhfisc: has joined #RubyOnRails
[02:54:50] sevenseacat: how long've you got? :P
[02:59:23] cam27: hopefully another 50 years
[03:00:00] jfpoole: has joined #RubyOnRails
[03:03:14] Chernobuk: has joined #RubyOnRails
[03:05:56] jhfisc: has joined #RubyOnRails
[03:16:02] jhfisc: has joined #RubyOnRails
[03:24:39] Radar: cam27: !r4ia
[03:24:39] helpa: cam27: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[03:24:46] Radar: That's my development process :)
[03:25:05] BigDiesel75: has joined #RubyOnRails
[03:26:01] sevenseacat: disclaimer: we are two of the authors of that book
[03:27:31] sevenseacat: i wish we could just give electronic copies of it away - i wonder if thats something manning would do now that its pretty much out of date
[03:27:45] Radar: Over our dead bodies.
[03:27:57] jhfisc: has joined #RubyOnRails
[03:30:34] cam27: haha. Why not do a new edition
[03:30:38] hahuang65: has joined #RubyOnRails
[03:30:53] cam27: Was this a profitable ventrue on your parts?
[03:31:05] cam27: I mean highly profitable
[03:32:21] Radar: hahahahahahahahahahahahahahahahahahahahaha
[03:32:29] Radar: We are not stephen king.
[03:32:33] Radar: We do not make money off writing books.
[03:32:38] Radar: We do it because we want to teach people.
[03:33:50] sevenseacat: is why Radar went on to write lots of other books https://leanpub.com/u/ryanbigg
[03:34:42] sevenseacat: (some of which still need to be finished, cough)
[03:40:42] Coldblackice: has joined #RubyOnRails
[03:41:52] cam27: I’ll buy that book when I get caught up with my other reading
[03:44:51] irishfromua: has joined #RubyOnRails
[03:46:29] cam27: I bookmarked your page
[03:46:45] SteenJobs: has joined #RubyOnRails
[03:48:49] Radar: Thanks cam27!
[03:49:15] cam27: Yeah, those other books look interesting too
[03:52:01] cam27: So @articles would be like ICollection in c#?
[03:52:16] cam27: trying to link my C# experience to Ruby
[03:53:04] sevenseacat: I don't know c# at all so I can't really help with that kind of comparison
[03:53:22] sevenseacat: but you've likely defined @articles as an ActiveRecord relation - a collection of records from the database
[03:53:43] sevenseacat: by itself, `@articles` is just an instance variable that can hold anything
[03:55:18] cam27: SO it also holds routes too if placed in the config/routes file?
[03:56:02] sevenseacat: defining instane variables in routes is not something you would normally do
[03:56:05] jhfisc: has joined #RubyOnRails
[03:56:17] sevenseacat: in Rails they're typically used to pass data from a controller to a view
[04:00:23] cam27: Ok, yeah I just re read what I was reading and I interpreted it incorectly
[04:10:26] Radar: cam27: route -> controller (looks stuff up in model, stores it in instance variables) -> view
[04:11:36] Radar: cam27: Looking at the C# docs, it seems to behave similarly to collections
[04:11:54] cam27: Ok. And when I get through all of this stuff, my .NET job wasn’t using migrations, cause htye used service layers. SO what would I want to read for that sort of stuff
[04:12:02] Radar: cam27: Think of it in the controller like a query that's _about_ to run on the database. It only gets run when you do @articles.each in the view.
[04:14:45] cam27: Skiming through the tutorial I didn’t see much besides migrations and keeping controllers even skinnier
[04:15:05] SteenJobs: has joined #RubyOnRails
[04:23:34] quirkycoders: has joined #RubyOnRails
[04:26:07] gamblor3: has joined #RubyOnRails
[04:27:44] jhfisc: has joined #RubyOnRails
[04:33:02] rgr: has joined #RubyOnRails
[04:33:43] jhfisc: has joined #RubyOnRails
[04:35:24] irishfromua: has joined #RubyOnRails
[04:36:01] quirkycoders: has joined #RubyOnRails
[04:48:07] quirkycoders: has joined #RubyOnRails
[04:49:50] BigDiesel75: has joined #RubyOnRails
[04:55:04] r3vDev: has joined #RubyOnRails
[05:00:16] irishfromua: has joined #RubyOnRails
[05:01:23] Ropeney: has joined #RubyOnRails
[05:03:52] jfpoole: When running unit tests, should I have to manually specify the testing environment? (e.g., `RAILS_ENV=test bundle exec rake test` vs `bundle exec rake test`)
[05:05:18] jhfisc: has joined #RubyOnRails
[05:12:18] quirkycoders: has joined #RubyOnRails
[05:16:19] irishfromua: has joined #RubyOnRails
[05:17:41] jhfisc: has joined #RubyOnRails
[05:23:22] baweaver: https://twitter.com/railscasts/status/879742557470597121
[05:24:30] conta: has joined #RubyOnRails
[05:26:56] apofis: has joined #RubyOnRails
[05:27:20] quazimodo: has joined #RubyOnRails
[05:27:43] jhfisc: has joined #RubyOnRails
[05:29:48] alfiemax: has joined #RubyOnRails
[05:31:28] hahuang65: has joined #RubyOnRails
[05:36:33] quirkycoders: has joined #RubyOnRails
[05:39:48] jhfisc: has joined #RubyOnRails
[05:43:12] rgr_: has joined #RubyOnRails
[05:47:45] jhfisc: has joined #RubyOnRails
[05:54:10] jhfisc: has joined #RubyOnRails
[05:56:08] pwnd_nsfw: has joined #RubyOnRails
[05:56:19] pwnd_nsfw: https://gist.github.com/SirUncleCid/04c2a856f997d8841232efd65ca0fc5b
[05:56:25] pwnd_nsfw: Anyone mind taking a look for me please?
[05:56:35] pwnd_nsfw: Literally days spent on trying to remedy this
[05:59:28] dminuoso: pwnd_nsfw: Can you please produce a full stack trace?
[05:59:42] dminuoso: pwnd_nsfw: i.e. run rspec with -b
[06:00:13] sevenseacat: pwnd_nsfw: https://gist.github.com/SirUncleCid/04c2a856f997d8841232efd65ca0fc5b#file-admin__application_controller-rb-L4 no scoping here
[06:01:42] pwnd_nsfw: policy_scope(___)
[06:01:55] pwnd_nsfw: Going to quit briefly if this is the answer haha
[06:02:02] pwnd_nsfw: You mentioned something about it the other day
[06:02:07] pwnd_nsfw: but I didn't know where to go from there
[06:02:28] pwnd_nsfw: >>> Standby while all of your programs come out of paging
[06:02:30] sevenseacat: this is different than the other day, but similar
[06:02:47] sevenseacat: you've got code making sure you do policy checking in index actions, and you're not doing it
[06:03:03] pwnd_nsfw: It's not in that gist
[06:03:13] pwnd_nsfw: But I have skip_after_action :...
[06:03:42] sevenseacat: ...and the rest?
[06:03:57] jhfisc: has joined #RubyOnRails
[06:04:33] pwnd_nsfw: dminuoso, https://gist.github.com/SirUncleCid/04c2a856f997d8841232efd65ca0fc5b#file-_full_stack_trace
[06:04:53] pwnd_nsfw: sevenseacat, of course, I'm working on it. Had to wait for Atom to come back alive after being inactive
[06:05:22] roamingdog: has joined #RubyOnRails
[06:05:28] dminuoso: That is your problem.
[06:05:32] pwnd_nsfw: I like how it looks
[06:05:32] dminuoso: Switch to vim, your spec will pass.
[06:05:35] sevenseacat: what? i use atom
[06:05:35] pwnd_nsfw: I use sublime for
[06:05:41] pwnd_nsfw: LOL dminuoso
[06:05:52] pwnd_nsfw: Sublime is for like.. single file editting
[06:06:00] sevenseacat: i'm all for making fun of editors, but not with factual incorrectness.
[06:06:02] dminuoso: pwnd_nsfw: Save the environment and stop using electron apps!
[06:06:07] roamingdog: has joined #RubyOnRails
[06:06:14] dminuoso: That is losely based on facts too, sevenseacat!
[06:06:21] sevenseacat: dminuoso: no. stop it.
[06:06:29] pwnd_nsfw: It has a lot of addons that I do enjoy
[06:06:34] pwnd_nsfw: Sublime looked as if it had slowed down
[06:06:44] pwnd_nsfw: and my brain doesn't quite have the capacity to use vim
[06:06:58] roamingdog: has joined #RubyOnRails
[06:07:04] pwnd_nsfw: Anyways, we've strayed off of
[06:07:13] pwnd_nsfw: my inability to get this test to pass
[06:07:16] dminuoso: sevenseacat: https://github.com/Microsoft/vscode/issues/22900
[06:07:29] pwnd_nsfw: So, other relevant controllers don't even have index actions
[06:07:45] sevenseacat: dminuoso: i'm sorry, what does that have to do with 'use vim and your spec will pass'?
[06:07:46] Radar: https://www.thejach.com/imgs/vim_learning.jpg
[06:07:48] roamingdog: has joined #RubyOnRails
[06:08:03] Radar: Anyway, can we get back to the issue at hand?
[06:08:06] pwnd_nsfw: emacs lmfao
[06:08:07] dminuoso: sevenseacat: Oh sorry, the statement was actually referring to the "save the environment" part.
[06:08:10] dminuoso: My apologies for misleading you.
[06:08:10] Radar: pwnd_nsfw: is it possible to reproduce this issue in a new app?
[06:08:22] pwnd_nsfw: Radar, errrr
[06:08:27] pwnd_nsfw: Well, if it makes you feel any better
[06:08:31] pwnd_nsfw: I'm using the idea from R4IA
[06:08:33] roamingdog: has joined #RubyOnRails
[06:08:36] Radar: [16:04:53] <pwnd_nsfw> sevenseacat, of course, I'm working on it. Had to wait for Atom to come back alive after being inactive
[06:08:40] Radar: How long does Atom take?
[06:08:42] pwnd_nsfw: Basically was like ... Projects? BlogPost?
[06:08:53] pwnd_nsfw: It doesn't take long, it's my PC's fault for paging the application
[06:09:43] jhfisc: has joined #RubyOnRails
[06:09:59] Radar: It does make me feel better tbqh
[06:10:08] Radar: Good to know you're reading the book
[06:11:04] Radar: https://gist.github.com/SirUncleCid/04c2a856f997d8841232efd65ca0fc5b#file-application_controller-rb-L4
[06:11:22] Radar: I thought this was done automatically by Pundit?
[06:11:46] Radar: Haven't used Pundit in a while, so I could be misremembering
[06:11:59] pwnd_nsfw: Ok, so figured it out
[06:12:03] pwnd_nsfw: Because I'm a fucking idiot
[06:12:18] pwnd_nsfw: give me one moment to point it out
[06:12:33] Radar: yes please do so we can all discover it
[06:12:48] quirkycoders: has joined #RubyOnRails
[06:12:59] jhfisc: has joined #RubyOnRails
[06:13:39] pwnd_nsfw: https://gist.github.com/SirUncleCid/30020ef9a521a2d6d5e6ac5f21937849
[06:13:48] pwnd_nsfw: Lets all laugh in unison at how this took 3 fucking days
[06:14:04] pwnd_nsfw: only about 1-2 hours per day
[06:14:09] pwnd_nsfw: but days nonetheless
[06:15:40] sevenseacat: it does exist though
[06:15:46] pwnd_nsfw: Well, yeah technically
[06:15:50] sevenseacat: it's in Admin::ApplicationController like I pointed out
[06:15:52] pwnd_nsfw: No views though
[06:16:14] Radar: I think I could've found it in about 5 mins if I had an app which reproduced the issue.
[06:16:20] Radar: #notsohumblebrag
[06:16:29] pwnd_nsfw: Right, but BlogPostsController (not the Admin::Blog....) does not inherent from Admin::ApplicationController
[06:16:40] pwnd_nsfw: I'm also not a professional developer
[06:16:45] pwnd_nsfw: with big e-penis and books
[06:16:50] pwnd_nsfw: and small cult following lol
[06:17:03] pwnd_nsfw: I appreciate you and the work you do
[06:17:12] pwnd_nsfw: R4IA was an awesome book, thanks as well sevenseacat
[06:17:34] Radar: Radar kicked pwnd_nsfw: behavior is not conducive to the desired environment.
[06:17:41] sevenseacat: I'm confused because there's no reference to a BlogPostsController, but4 okay
[06:17:44] sevenseacat: as long as the problem is fixed :)
[06:17:55] pwnd_nsfw: has joined #RubyOnRails
[06:18:15] sevenseacat: also, e-penis? what are we, 12?
[06:18:18] Radar: pwnd_nsfw: welcome back
[06:18:24] pwnd_nsfw: I apologize
[06:18:35] pwnd_nsfw: I wasn't like.. being demeaning
[06:18:39] Radar: What I meant to say is that if you spent 15-20 mins two days ago putting this code somewhere that we could run we could've probably helped a lot sooner.
[06:18:39] pwnd_nsfw: that was supposed to be praise
[06:19:07] pwnd_nsfw: I wasn't calling you out on anything except that ... well, I figured "I appreciate you...." would've put it into a different context
[06:19:10] pwnd_nsfw: But now everyone is mad
[06:19:23] pwnd_nsfw: Where's mices when you need a diversion
[06:19:41] jhfisc: has joined #RubyOnRails
[06:19:46] Radar: [16:13:49] <pwnd_nsfw> Lets all laugh in unison at how this took 3 fucking days
[06:19:55] Radar: Like, you spent 3 days on this asking for help, but didn't spend any time building a small repro app?
[06:20:02] Radar: Help us help you
[06:20:11] pwnd_nsfw: No one asked for another app
[06:20:26] pwnd_nsfw: to reproduce the issue. I supplied ALMOST all relevant code. I totally looked past that controller
[06:20:44] pwnd_nsfw: You act like I'm brand new to this channel, and that I didn't actually supply you with anything to help you help me
[06:20:56] Radar: Sigh text is a shit medium for this discussion.
[06:21:05] Radar: You're not brand new.
[06:21:11] pwnd_nsfw: Quite, I feel like you're totally shitting on me
[06:21:14] Radar: I am suggesting that this is a course of action you should take in the future.
[06:21:28] Radar: If you are banging your head against a problem for > 1 day then try to reproduce it in a brand new app.
[06:21:33] pwnd_nsfw: However, ... we wait until now to say anything. I get it
[06:21:45] Radar: With the code you supplied, it's looking likely that it was missing the key component which was causing the breakage.
[06:21:50] pwnd_nsfw: To suggest that I know to do that automatically is a bit out of the way too
[06:21:55] pwnd_nsfw: But, yes, in the future I got you
[06:22:05] Radar: If you tried to reproduce this issue in a new app with the code from the Gist then it is likely that you wouldn't be able to do that, because the key component was missing.
[06:22:20] Jason: has left #RubyOnRails: ()
[06:22:20] Radar: You would've then realised that and then you would've been able to fix it.
[06:22:22] Jason: has joined #RubyOnRails
[06:22:32] pwnd_nsfw: I understand the purpose of reproducing it in another app.
[06:22:36] Radar: I mean no offence. It's the end of my day here.
[06:22:43] pwnd_nsfw: Same, it's 2am
[06:22:45] Radar: I'm probably a bit shorter than usual.
[06:22:49] pwnd_nsfw: Way beyond me end of the day
[06:22:55] Radar: <3 man I know you mean well :)
[06:23:09] pwnd_nsfw: And my habits have been pretty shit lately... I've probably had a total of 10 hrs of sleep the past week besides today
[06:23:13] Radar: Thank you for at least providing the code you thought was relevant. More than most do.
[06:23:15] pwnd_nsfw: Thanks for the help though
[06:23:20] pwnd_nsfw: Heh, I know that drill :p
[06:23:26] Radar: ok it's time for us to get a room or something
[06:23:28] pwnd_nsfw: I will dot hat next time though.
[06:23:31] Jason: this is the most active #rubyonrails has been in hours
[06:23:41] Radar: pwnd_nsfw: ;) ;) ;)
[06:23:46] Jason: no, let's get a room
[06:23:47] Radar: Jason: When it's active it's good active.
[06:23:50] Jason: #room, that is
[06:23:55] pwnd_nsfw: Even if it's mices
[06:24:04] pwnd_nsfw: or arup attempting to help
[06:24:09] Jason: Radar: so i'm liking sublime a lot
[06:24:14] pwnd_nsfw: I can't believe I overlooked that though
[06:24:21] pwnd_nsfw: I'm actually not very well versed with Pundit
[06:24:26] Jason: Radar: that's the good news - the bad news is i'm still not sure what the project naming scheme is for rails :P
[06:24:28] Radar: Jason: That's great news :D
[06:24:33] pwnd_nsfw: Because, well, my hobby hasn't had as much attention as I'd like to give it
[06:24:40] Jason: i'm THINKING todo_list
[06:24:41] Radar: Jason: Project naming scheme is pretty much fairgame. Just don't go naming it after Ruby/Rails constants.
[06:24:53] Jason: Radar: i currently have TodoList
[06:24:53] quirkycoders: has joined #RubyOnRails
[06:25:07] Jason: i mean this is such an insignificant project, silly for me to keep wondering
[06:25:08] pwnd_nsfw: Have you thought of Todon'tList?
[06:25:08] Radar: Jason: todo_list + TodoList will create an application called "TodoList", but "rails new todolist" will produce one called "Todolist". The name doesn't really matter too much.
[06:25:29] Jason: so it doesn't really matter!
[06:25:35] pwnd_nsfw: it won't break anything, anyways
[06:25:36] jhfisc: has joined #RubyOnRails
[06:25:50] Radar: Jason: nothing really matters, anyone can see. Nothing really matters.
[06:26:01] pwnd_nsfw: module TodoList looks better than module Todolist though
[06:26:27] pwnd_nsfw: Just started an appp
[06:26:37] pwnd_nsfw: that's all I got
[06:27:03] Jason: Radar: unfortunately, i think gitgutter is making sublime lag
[06:27:08] Radar: Jason: I can recommend the AdvancedNewFile, Babel, Git, GitSavvy and HTMLBeautify packages.
[06:29:57] dionysus69: has joined #RubyOnRails
[06:32:14] freedrull: has joined #RubyOnRails
[06:32:29] freedrull: anyone know why the where! etc methods are removed in rails 5?
[06:32:44] Jason: Radar: git AND gitsavvy?
[06:32:56] Radar: Jason: Yeah. I forget why I have both.
[06:33:54] Radar: freedrull: You ask good questions. Gold star for you.
[06:34:50] Radar: ACTION watches as civilisations rise and fall during the time it takes AU internet to.... oh it's done
[06:35:11] Jason: Radar: gitsavvy is really nice
[06:35:21] dionysus69: Still where I was yesterday. I am dealing with soap API with savon. I finally got client.operations to output possible operations but I am still unable to send any .call messages soap tells me "~not enough parameters". this is the action with all its parameters https://gist.github.com/91d33b7485490b35a018ca3e51ee5000
[06:35:22] dionysus69: how would I translate this to a savon call? so far I have this ... client.call(:get_currencies)
[06:35:23] Radar: freedrull: How are you calling the method btw?
[06:36:05] sevenseacat: I didn't know where! was a thing
[06:36:09] Radar: dionysus69: I believe you need to specify the ModeFull parameter.
[06:36:41] Radar: dionysus69: It shows how to supply parameters here: http://savonrb.com/version2/requests.html. "message" is a parameter.
[06:36:43] dionysus69: like this? parameter: {"ModeFull" => true?}
[06:37:02] Radar: client.call(:get_currencies, ModeFull: true) <- at a guess
[06:37:10] dionysus69: ok let me try :)
[06:37:13] Radar: I haven't touched Savon since about 2011 so I could be wrong.
[06:37:24] Radar: And I thank the Holy Matz for that.
[06:37:39] Radar: freedrull: why have you deserted me in my hour of need?
[06:37:57] alfiemax: has joined #RubyOnRails
[06:38:07] alfiemax: back again with the same issue
[06:38:13] dionysus69: haha I wouldnt touch it either. I just had this Soap api made at work, from which I need to parse some data :) hey Alfie :)
[06:38:30] alfiemax: but here are the updates from devise-jwt https://github.com/waiting-for-dev/devise-jwt/issues/22
[06:38:30] sevenseacat: still havent hired a consultant?
[06:38:48] alfiemax: sevenseacat: lol... :)
[06:39:04] alfiemax: dionysus69: hi :)
[06:39:22] jhfisc: has joined #RubyOnRails
[06:39:50] Radar: A way to ensure this works correctly regardless of the order of execution is to manually load the direct subclasses at the bottom of the file that defines each intermediate class:
[06:39:53] Radar: alfiemax: ^
[06:39:58] Radar: Please do not abandon me like that freedrull person.
[06:40:24] conta: has joined #RubyOnRails
[06:40:36] Radar: alfiemax: have you tried using require_dependency as it suggests there?
[06:40:45] dionysus69: Radar this syntax isn't legit: "ModeFull: true" I think camel case doesnt work with symbols
[06:40:49] Radar: FREEDRULL IS ALIVE
[06:41:00] alfiemax: yes, i placed `require_dependency` under User model and required trader and retailer
[06:41:02] Radar: dionysus69: Ok, since it's being picky: "ModeFull" => true
[06:41:09] alfiemax: but no luck, the classes are not reloaded
[06:41:18] freedrull: Radar: calling it on a relation. i am guessing the answer is something like "they weren't meant to be public"
[06:41:19] Radar: alfiemax: and did you do the same for trader (retailer + user) and user (retailer + trailer)?
[06:41:28] dionysus69: this worked btw thanks for the invaluable hint! client.call(:get_currencies, message: {"ModeFull" => true})
[06:41:31] alfiemax: all that's required?? i'll try
[06:41:32] Radar: freedrull: Do you have an example? Because I have an example :)
[06:41:46] Radar: dionysus69: oh does it need message there? Strange.
[06:41:47] sevenseacat: state machines are the bane of my existence
[06:41:53] Radar: sevenseacat: literally the worst
[06:41:56] alfiemax: but i was doubtful as the scenario mentioned in the doc was different from what i'm facing
[06:42:02] dionysus69: Radar: yep, it choked without a message :D
[06:42:04] Radar: * > mices > state machines
[06:42:19] Radar: Other way around but you get the gist.
[06:42:46] Radar: alfiemax: I don't know if it is actually required.
[06:42:59] jhfisc: has joined #RubyOnRails
[06:43:07] alfiemax: i'll try anyways... right now i'll try anything to make it work :D
[06:43:51] Jason: Radar: my google-foo is kind of failing me here: as you know i'm making a little todo list app
[06:44:13] Jason: Radar: what would be really cool is to have a checklist next to each todo, and when it's clicked, to update the todo as being done
[06:44:31] Jason: err, checkbox
[06:45:00] Jason: how would I get such a checkbox that would immediately send a request to rails to edit the todo?
[06:45:26] Radar: Jason: What you're after this is a good little bit of ajax :) Look into jQuery for doing that sort of thing.
[06:46:08] Jason: that's what i suspected
[06:46:12] Jason: no magic rails methods :P
[06:46:16] Jason: i will look, thanks!
[06:48:52] Jason: Radar: oh hey, look what i found
[06:48:54] Jason: https://stackoverflow.com/questions/15572371/rails-change-boolean-value-with-checkbox-and-jquery-ajax
[06:49:12] Jason: Radar: it looks like rails4+ actually *does* have some magic with remote: true
[06:49:23] Jason: pretty neat
[06:52:29] roshanavand: has joined #RubyOnRails
[06:59:59] arBmind: has joined #RubyOnRails
[07:00:06] jhfisc: has joined #RubyOnRails
[07:00:57] quirkycoders: has joined #RubyOnRails
[07:02:40] Jameser: has joined #RubyOnRails
[07:05:29] jhfisc: has joined #RubyOnRails
[07:07:09] ur5us: has joined #RubyOnRails
[07:09:58] roamingdog: has joined #RubyOnRails
[07:10:47] kies: has joined #RubyOnRails
[07:11:53] jhfisc: has joined #RubyOnRails
[07:13:07] Radar: Jason: oh yeah you could use that
[07:14:41] Jason: would be nice to have some visual feedback - "oh, it's updated, yay"
[07:14:48] Jason: this is fun
[07:15:32] alfiemax: has joined #RubyOnRails
[07:17:42] alfiemax: Radar: added, didn't work
[07:19:05] alfiemax: it's not that the class isn't reloaded after a file change, it does reload. But the reference to `self` is not reloaded
[07:19:35] Jason: night, thanks again Radar
[07:21:21] Jameser: has joined #RubyOnRails
[07:23:03] dionysus69: cannot get hold of m:return tag in here https://gist.github.com/anonymous/9b9d864d6d5efeda8e47e26f5b08ba99 this xml is returned by savon and trying to parse it with nokogiri
[07:23:27] dionysus69: do you guys think I should just stick with savon's to_hash capability so I dont deal with xpath and all thaT?
[07:24:38] quirkycoders: has joined #RubyOnRails
[07:25:57] Jameser: has joined #RubyOnRails
[07:27:28] universa1: dionysus69: what is the problem with finding the xpath?! i'm sure there are online xpath tools, where you can click the node and it returns you the xpath that selects the node...
[07:27:59] dionysus69: I found one but it returns one long ugly string
[07:28:04] dionysus69: iwant something more concise
[07:28:11] dionysus69: so far I am able to reach with this to body
[07:28:24] dionysus69: .xpath('//soap:Envelope/soap:Body/
[07:28:26] patarr: has joined #RubyOnRails
[07:28:56] dionysus69: but this already throws an undefined prefix error .xpath('//soap:Envelope/soap:Body/m:GetCurrenciesResponse')
[07:31:46] dionysus69: and online generator made same xpath
[07:32:03] ferr: has joined #RubyOnRails
[07:32:19] hahuang65: has joined #RubyOnRails
[07:33:10] dionysus69: ok apparently namespaces need to be registered. wonder why is that
[07:36:06] dminuoso: dionysus69: Namespaces.
[07:36:19] dminuoso: dionysus69: Either _use_ the namespace, or use css selectors.
[07:36:45] dionysus69: I was able to parse html with css selectors with nokogiri
[07:36:58] dionysus69: but when I tried xml xpath made more sense
[07:37:14] dminuoso: dionysus69: You can parse xml with css selectors too.
[07:37:30] dminuoso: dionysus69: XPath is more powerful, but the features are rarely needed in my experience.
[07:37:40] dionysus69: anyways, this answer shows to define namespace like this https://stackoverflow.com/questions/4690737/nokogiri-xpath-namespace-query but when I insert m instead of dc still same error. and I dont know where the URI came from
[07:37:52] DoubleMalt: has joined #RubyOnRails
[07:37:59] dionysus69: ok i ll try do the same with css maybe it's easier
[07:38:05] dminuoso: dionysus69: Show us the code you are using.
[07:38:08] dionysus69: hopefully it doesnt care about some voodoo xml namespaces
[07:38:17] dionysus69: pp Nokogiri::XML(xml_response.to_xml).xpath("//soap:Envelope/soap:Body/m:GetCurrenciesResponse", "m" => "URI")
[07:38:47] dionysus69: ERROR: Undefined namespace prefix:
[07:38:53] dionysus69: but I think i ll just try css? :S
[07:41:47] dminuoso: dionysus69: XPath is weird I never bothered to understand it well enough to answer your questions. But yeah, use CSS selectors (generally they suffice)
[07:42:16] dionysus69: or perhaps ditch all xml altogether and use hashes that savon prepares autogically ? :D
[07:42:28] dminuoso: dionysus69: But the input I see does not properly register namespaces/.
[07:42:54] dminuoso: dionysus69: That or css selectors.
[07:42:59] weiyang: has joined #RubyOnRails
[07:43:15] dminuoso: Or does it?
[07:43:46] dminuoso: Bah I have no idea.
[07:43:48] dminuoso: ACTION shrugs
[07:43:49] dionysus69: about savon converting to hash?
[07:44:16] dionysus69: so in the command above if I didn't do .to_xml, it actually defaults to returning hash
[07:44:37] dionysus69: maybe I am just overcomplicating all this by trying to make use of nokogiri because it sounds cool :D
[07:45:28] jhfisc: has joined #RubyOnRails
[07:45:52] universa1: savon most likely already parsed the xml response for you .
[07:46:55] dionysus69: that's how it converted to hash
[07:47:13] universa1: so? why don't you use that?
[07:47:21] arBmind: has joined #RubyOnRails
[07:47:25] dionysus69: but then I for some reason decided to convert back to xml and try access elements using xpath, and now css and I ll end up just using original hashes
[07:48:05] dionysus69: dunno it felt natural to use nokogiri :D dunno, this soap thing seems to stone agy compared to just good old rails json api
[07:48:18] weiyang: Hmm, I got one simple question. I am trying to embed some video player in my page. And I tried video-js, which works. While I want to hide the video link to users. Is this possible?
[07:49:11] quirkycoders: has joined #RubyOnRails
[07:50:39] jhfisc: has joined #RubyOnRails
[07:53:27] dminuoso: About anything.
[07:54:33] dminuoso: weiyang: What is possible?
[07:55:00] weiyang: dminuoso, you mean not possible?
[07:55:23] dminuoso: weiyang: Let me rephrase:
[07:56:53] weiyang: dminuoso, I am really new to the RoR and frontend programming.
[07:57:13] weiyang: dminuoso, I am trying to create a site which could play some video
[07:57:54] weiyang: While current code looks like this: <source src="http://olpgr8yz2.bkt.clouddn.com/WeChatSight8.mp4" type='video/mp4'>
[07:58:10] weiyang: Which means user could just download the mp4
[07:58:15] weiyang: Or access it.
[07:58:26] weiyang: So how could I hide the real link?
[07:58:53] sevenseacat: if your browser can access it, your user can access it.
[07:58:59] mikecmpbll: has joined #RubyOnRails
[07:59:25] jhfisc: has joined #RubyOnRails
[07:59:44] weiyang: sevenseacat, thanks
[08:00:15] weiyang: While I see some site maybe youtube, I couldn't get the real link to the video, right?
[08:00:27] dminuoso: weiyang: Even they have it.
[08:00:40] dminuoso: weiyang: It's just not as obvious.
[08:00:50] sevenseacat: you can manually download youtube videos, yes.
[08:01:43] weiyang: I mean some commercial video site, like Netflix, user could down load the video?
[08:02:01] dminuoso: weiyang: With netflix things get more complicated because they use HDCP
[08:02:13] dminuoso: For 4k at least.
[08:02:26] sevenseacat: i have no idea about netflix, ive never used it
[08:02:37] dminuoso: Or something similar anyway
[08:02:51] weiyang: so no way to let user see the video but not cat the content directly?
[08:03:05] dminuoso: weiyang: There is technically.
[08:03:18] weiyang: yep, I think so.
[08:03:37] weiyang: I have seen some site, which you just could watch the video on that site
[08:06:30] dminuoso: weiyang: Yes. It is called HDCP. Netflix does this for 4k movies, which requires special support by your hardware and graphics cards. So you need specially written software and licenses.
[08:06:38] dminuoso: weiyang: But for you, it is not possible.
[08:07:01] dminuoso: (And even the most recent HDCP versions have been broken, so it's not exactly secure either)
[08:08:30] dminuoso: weiyang: Which means your CPU needs to support SGX, and your graphics card needs special support too.
[08:09:30] dminuoso: (Well and AACS)
[08:09:54] weiyang: hmm... so if some user's cpu/g card doesn't support it, it can't work
[08:10:13] dminuoso: weiyang: Yup. In order to watch 4k netflix movies you need a top-off-the-line graphics card and CPU.
[08:10:18] dminuoso: Which is kind of annoying.
[08:11:05] Axsuul: has joined #RubyOnRails
[08:11:07] jhfisc: has joined #RubyOnRails
[08:11:12] weiyang: Not friendly to users
[08:12:19] dminuoso: weiyang: Especially since that architecture requires a new socket, which means an upgrades essentially requires you buying an entirely new PC.
[08:13:05] quirkycoders: has joined #RubyOnRails
[08:13:16] dminuoso: weiyang: But for a rails developer all of that is essentially inaccessible for a few reasons. You cant hide stuff from a user.
[08:13:36] weiyang: Ok, got it~
[08:21:29] tbuehlmann: dminuoso, speaking of annoying: can chrome play netflix videos in 1080p nowadays? last time I checked you had to use edge on windows for that to work
[08:22:07] dminuoso: tbuehlmann: Yes.
[08:23:35] dminuoso: tbuehlmann: That is interesting. I never even noticed!
[08:23:59] dminuoso: was sure that was always 1080p that I was watching
[08:24:02] jhfisc: has joined #RubyOnRails
[08:25:33] quirkycoders: has joined #RubyOnRails
[08:31:01] lxsameer: has joined #RubyOnRails
[08:36:03] jhfisc: has joined #RubyOnRails
[08:37:14] alfiemax: has joined #RubyOnRails
[08:37:39] quirkycoders: has joined #RubyOnRails
[08:37:51] alfiemax: using actioncable i understand that i need to specify `config.action_cable.allowed_request_origins` to allow only specific domains from connecting to the websocket
[08:38:36] alfiemax: but what would i do when the request is coming from a mobile app? what domain would i specify? (i'm not a mobile app dev, no i'm not sure if this is even a valid question)
[08:46:33] marr: has joined #RubyOnRails
[08:47:53] Jameser: has joined #RubyOnRails
[08:49:41] quirkycoders: has joined #RubyOnRails
[08:50:42] dminuoso: alfiemax: It has nothing to do with mobile vs non-mobile.
[08:51:05] dminuoso: alfiemax: The "origin" is basically the "hostname + port" of the website your user agent is on.
[08:51:16] alfiemax: ok, then what domain would i have to specify?
[08:51:40] dminuoso: alfiemax: Do you understand how CORS works?
[08:56:56] alfiemax: i wouldn't say i understand it fully
[08:58:57] dminuoso: alfiemax: It's a very simple concept. An "origin" is just defined to mean hostname+port. So when a user-agent is on a website from origin A, and some JavaScript tries to then access a resource from origin B (say through ajax), it first sends a preflight request to B, asking "hey, which origins are allowed to use you?"
[08:59:23] dminuoso: alfiemax: The server responds with a list of origins that are acceptable. The user agent then checks if origin A is among that list and refuses to do the network request if its not.
[08:59:32] dminuoso: alfiemax: ActionCable does a similar thing. :)
[08:59:45] dminuoso: Except it's done server-side.
[08:59:51] dminuoso: CORS is done user-agent side
[09:00:19] alfiemax: oh, this preflight request is something that's sent before the actual request right?
[09:00:39] dminuoso: Yes. With ActionCable that is skipped too, it happens on the actual request.
[09:02:21] dminuoso: So for CORS: Network request is intercepted by the browser, browser sends preflight, checks whether the server allows the current origin, and then resumes or cancels the network request.
[09:03:16] alfiemax: understood :), but my question remains :(
[09:03:17] alfiemax: ok, but again when a request is created from my web app, which runs on x.y.com then i can add x.y.com to the allowed_request_origins, but when it comes from a mobile device(iOS/android), which domain would i have to give?
[09:03:21] jhfisc: has joined #RubyOnRails
[09:03:33] dminuoso: alfiemax: Not domain but origin (this includes the port)
[09:03:43] dminuoso: alfiemax: And the origin should be wherever you are trying to use AC from.
[09:03:45] alfiemax: yes, sorry :)
[09:03:58] alfiemax: for example?
[09:04:23] dminuoso: 11:03:19 alfiemax | ok, but again when a request is created from my web app, which runs on x.y.com then i can add x.y.com to the allowed_request_origins, but when it comes from a mobile device(iOS/android), which domain would i have to give?
[09:04:32] dminuoso: alfiemax: Again, mobile has nothing to do with this.
[09:04:50] dminuoso: alfiemax: From a rails perspective there is no difference between a PC and a mobile device. Only the name of the user agent differs.
[09:05:00] alfiemax: yes, thats right
[09:05:48] dminuoso: alfiemax: You only need to add every origin you intend to connect to AC from.
[09:05:57] dminuoso: This is not a mobile-or-not question.
[09:07:08] alfiemax: so in simple words, `Origin` is where the request originates from, and as long as i specify that in my allowed list, i would be good
[09:07:54] dminuoso: alfiemax: Yeah.
[09:08:10] Coldblackice_: has joined #RubyOnRails
[09:08:35] dminuoso: alfiemax: It's just a simple hostname+port whitelist :)
[09:08:51] wopi: Hi, is anyone generating an XML sitemap for his Rails project ?
[09:09:07] Axsuul: has joined #RubyOnRails
[09:13:30] Coldblackice: has joined #RubyOnRails
[09:13:31] arBmind: has joined #RubyOnRails
[09:16:20] _Coldblackice: has joined #RubyOnRails
[09:16:30] jhfisc: has joined #RubyOnRails
[09:16:40] _Coldblackice: has joined #RubyOnRails
[09:17:26] _Coldblackice: has joined #RubyOnRails
[09:17:52] _Coldblackice: has joined #RubyOnRails
[09:18:37] _Coldblackice: has joined #RubyOnRails
[09:19:00] _Coldblackice: has joined #RubyOnRails
[09:20:12] srinidhi: has joined #RubyOnRails
[09:20:21] arBmind: has joined #RubyOnRails
[09:20:32] Coldblackice: has joined #RubyOnRails
[09:25:59] quirkycoders: has joined #RubyOnRails
[09:26:11] Coldblackice_: has joined #RubyOnRails
[09:26:19] alfiemax: has joined #RubyOnRails
[09:26:43] Coldblackice_: has joined #RubyOnRails
[09:27:04] Coldblackice_: has joined #RubyOnRails
[09:29:02] wethu: has joined #RubyOnRails
[09:29:13] patarr: has joined #RubyOnRails
[09:29:33] Fernando-Basso: has joined #RubyOnRails
[09:30:47] arup_r: has joined #RubyOnRails
[09:31:11] Coldblackice: has joined #RubyOnRails
[09:32:08] _Coldblackice: has joined #RubyOnRails
[09:32:39] _Coldblackice: has joined #RubyOnRails
[09:33:07] hahuang65: has joined #RubyOnRails
[09:34:40] dionysus69: I need just one bit of more help with savon :D before now I had to request data without any params. meaning I just had to supply ModeFull => true in a message hash. but now I need to supply param called CreateDate. here's the action description in savon. https://gist.github.com/anonymous/85d9cc43687f04eb372e462e64982bf3
[09:35:19] dionysus69: I wonder how I would pass it a parameter CreateDate and how do I figure out which date format does it expect exactly?
[09:35:39] dionysus69: do I have to know in advance or does this snippet hint on anything?
[09:38:00] universa1: dionysus69: "CreateDate"=>{:type=>"xs:string", :nillable=>"true"}
[09:38:28] dionysus69: yes i noticed that :D but what is xs string?
[09:38:30] universa1: so they didn't specify a custom type or some dateformat, so ask the webservice you are using?
[09:38:46] dionysus69: I tried supplying it inside the message: {} hash and it complained about unknown param or something
[09:39:01] universa1: dionysus69: well, somewhere in the xml document the xs namespace is introduced
[09:39:11] universa1: and inside that namespace there is a definition for string
[09:39:22] dionysus69: ok i guess I ll have to ask for the format, they didn't specify anything pretty much, very vague documentation and I am dealing with soap for the first time :S
[09:49:42] jhfisc: has joined #RubyOnRails
[09:54:04] wethu: has joined #RubyOnRails
[09:55:34] AzaToth: has joined #RubyOnRails
[09:55:55] jhfisc: has joined #RubyOnRails
[09:59:25] dionysus69: universa1: :) one second please
[09:59:37] dionysus69: savon.call(:get_client_debt_data_view_model, message: { "CreateDate" => "01012017" }) returns uknown paramter error
[10:00:06] dionysus69: let's assume the date string is correct. I am still at the stage of figuring out on how to supply param :\
[10:01:00] dionysus69: previous requests required no param but I still had to supply message: { "ModeFull" => true }
[10:01:36] dionysus69: but I have no idea what to do in this case. docs say get_client_debt_data_view_model operation requires CreateDate parameter
[10:02:16] quirkycoders: has joined #RubyOnRails
[10:05:34] jhfisc: has joined #RubyOnRails
[10:08:28] universa1: dionysus69: well, it probably wants it nested, or whatever... look at the wsdl ?!
[10:11:17] r3vDev: has joined #RubyOnRails
[10:11:42] jhfisc: has joined #RubyOnRails
[10:12:02] dionysus69: how? what do I check?
[10:12:42] universa1: the wdsl should be an xml document, specifying the available "messages" and their format.
[10:12:50] universa1: iirc... xml is so long ago.
[10:13:17] universa1: there are also probably wsdl explorers, which would show you sample messages etc...
[10:13:40] dionysus69: ye I can gist the whole wsdl doc
[10:13:47] dionysus69: it is very large and I dont know what to look at
[10:13:54] dionysus69: the snippet I posted before is from there
[10:14:32] dionysus69: but all it says is https://gist.github.com/anonymous/85d9cc43687f04eb372e462e64982bf3 so far I could find this as the most relevant info about CreateDate param
[10:15:54] universa1: dionysus69: try for example: https://www.wsdl-analyzer.com/
[10:16:05] dionysus69: ok will do :D
[10:22:00] rainy_mood2002: has joined #RubyOnRails
[10:22:14] rainy_mood2002: Anybody there? :)
[10:23:09] rainy_mood2002: I've got a problem with active model serializers gem
[10:23:24] rainy_mood2002: how do I include root node?
[10:24:22] dminuoso: rainy_mood2002: What do you mean by root node/
[10:25:41] jhfisc: has joined #RubyOnRails
[10:30:14] r3vDev: has joined #RubyOnRails
[10:31:05] srinidhi: has joined #RubyOnRails
[10:32:45] jhfisc: has joined #RubyOnRails
[10:38:25] rainy_mood2002: @dminuoso I have an action in my controller and i want to render response as JSON
[10:38:35] quirkycoders: has joined #RubyOnRails
[10:38:38] rainy_mood2002: I have a serializer class where i include desired attributes
[10:38:47] rainy_mood2002: but it renders only data
[10:38:56] dionysus69: universa1: how do I get xml wsdl from savon ? :(
[10:39:00] rainy_mood2002: i want something like { ticket : {attributes} }
[10:39:08] rainy_mood2002: not only { attributes }
[10:39:46] rainy_mood2002: I see in old railscasts about AMS that root was used to be included by default
[10:39:49] rainy_mood2002: but now is gone
[10:39:52] dionysus69: I am getting some @wsdl=#<Wasabi: code
[10:45:03] jhfisc: has joined #RubyOnRails
[10:45:25] dminuoso: rainy_mood2002: !gist
[10:45:25] helpa: rainy_mood2002: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[10:45:58] ur5us: has joined #RubyOnRails
[10:49:54] shotbug: has joined #RubyOnRails
[10:50:07] roamingdog: has joined #RubyOnRails
[10:51:57] rainy_mood2002: dminuoso: https://gist.github.com/cloudtemplar/9b9bbe60628f67750ff180c961141fcb
[10:54:28] dminuoso: rainy_mood2002: Use the "JSON" adapter, not the "Attributes" adapter.
[10:54:36] dionysus69: ok this is the command from wsdl, but I still don't understand how would I build a call xml out of this. https://gist.github.com/anonymous/e1001c195a75637b32c846ccd90668a0 any hints appreciated!
[10:55:39] dminuoso: rainy_mood2002: You can either configure this globally through ActiveModelSerializers.config.adapter or per-render call by passing adapter: :json
[10:55:56] jhfisc: has joined #RubyOnRails
[10:56:04] dminuoso: rainy_mood2002: If you can however, you should strongly consider using the JSON:API adapter in fact.
[10:56:58] dminuoso: dionysus69: Any particular reason why savon wont suffice?
[10:57:09] dionysus69: dunno, cant send call properly
[10:57:29] dminuoso: What does that mean?
[10:57:32] dionysus69: param name is CreateDate
[10:57:42] rainy_mood2002: dminuoso: I tried to set JSON:API as an adapter, but it gives me even more crazy output. I'm actually trying to write an API for the first time
[10:57:50] rainy_mood2002: trying to follow Rails 4 in Action book
[10:57:59] dionysus69: savon.operations[5], message: { "CreateDate" => "10.10.2017"}
[10:58:04] dionysus69: returns uknown param error
[10:58:07] dminuoso: rainy_mood2002: It may look a bit crazy at first, but it is highly normalized and far more usable if you wrap your head around it. :)
[10:58:28] dminuoso: dionysus69: https://xkcd.com/1179/
[10:58:39] dminuoso: dionysus69: Are you sure the API doesn't require ISO-8601?
[10:58:57] dionysus69: it may but it's not mentioned anywhere
[10:59:07] dminuoso: dionysus69: That is not a savon problem.
[10:59:07] dionysus69: I am sure that date format is correct
[10:59:10] dminuoso: It is not a WSDL problem.
[10:59:11] dionysus69: that is what they told me
[10:59:31] dionysus69: yep the guy told me to use dots, day.month.year
[10:59:35] dminuoso: dionysus69: !rule3.3
[10:59:35] helpa: dionysus69: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[10:59:42] dminuoso: dionysus69: !rule3.2
[10:59:42] helpa: dionysus69: A "Full Trace" as opposed to the default "Application Trace" is preferred.
[10:59:48] dminuoso: dionysus69: !rule3
[10:59:48] helpa: dionysus69: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[10:59:49] dionysus69: if value format were to be different it would provide different error, not uknown parameter
[11:00:09] rainy_mood2002: dminuoso: Okay, i found decent tutorial about using json api with AMS, if this is the preferred way I'll do it :) Your advice of using adapter: :json also worked, BTW :)
[11:00:10] MrCrackPotBuilde: has joined #RubyOnRails
[11:00:37] dminuoso: rainy_mood2002: It is just a mild recommendation. If it's easier to wrap your head around the JSON adapter, then stick with it.
[11:00:47] dminuoso: (There's no value in just confusing yourself for the sake of using ideal technologies)
[11:01:21] dminuoso: rainy_mood2002: The brilliant thing is, you can just change the adapter later or like me, let the user choose which format he wants.
[11:01:29] stamina: has joined #RubyOnRails
[11:02:20] rainy_mood2002: dminuoso: thanks again :) back to coding
[11:03:41] jhfisc: has joined #RubyOnRails
[11:05:01] dionysus69: this is the full wsdl document https://www.wsdl-analyzer.com/fileContent/wsdl/1093697646?version=1 and as for the code I am trying to execute is this: https://gist.github.com/anonymous/ba8a84b7a67db9ab2308ff612d37a0b8 the error is uknown parameter
[11:05:47] dminuoso: dionysus69: Please copy paste the exact error message
[11:05:50] DoubleMalt: has joined #RubyOnRails
[11:06:19] dionysus69: it is in georgian :D
[11:06:47] dminuoso: dionysus69: Change your locale, run it again, and paste the error message.
[11:07:13] dionysus69: its not up to the locale
[11:07:23] dionysus69: this soap api has hardcoded georgian messages
[11:08:37] dionysus69: `raise_soap_and_http_errors!': (soap:Client) შეცდომა SOAP შეტყობინების გარჩევისას: უცნობი პარამეტრი. (Savon::SOAPFault) ---- so the georgian text says error while parsing request, uknown parameter
[11:09:37] dminuoso: That looks funny.
[11:09:41] jhfisc: has joined #RubyOnRails
[11:10:21] dminuoso: dionysus69: Look at the WSDL.
[11:10:30] dminuoso: dionysus69: I want you to pay me for the time.
[11:10:39] dionysus69: I will someday
[11:10:44] dionysus69: when I have some proper income
[11:11:22] dminuoso: dionysus69: What makes you think that operation accepts that parameter?
[11:11:24] dionysus69: I am looking at wsdl and obviously I see everything, but I can't translate all this into the xml OR savon request
[11:11:32] dionysus69: I dont know :D
[11:11:42] dionysus69: I just know that this soap request requires this parameter
[11:11:44] dminuoso: dionysus69: That much is evident.
[11:11:49] dionysus69: i dont know how else to pass it
[11:11:50] dminuoso: dionysus69: What makes you say that?
[11:11:54] dminuoso: Why do you think you know that?
[11:12:14] dionysus69: the documentation, i should supply a date and it returns week worth of some data
[11:12:24] dminuoso: dionysus69: Either the documentation is wrong or you lied.
[11:12:28] dminuoso: Or the API is wrong.
[11:12:39] dminuoso: dionysus69: Either way. GetClientDebtDataViewModel has no parameters.
[11:12:58] zacts: has joined #RubyOnRails
[11:13:54] dionysus69: I dont know xml so I cant really double check that, but it should have params :D at least what I call it param, maybe it is called some other name and I call it param
[11:14:48] dionysus69: what about GetClientDebtDataViewModelResponse saying create date and answer and return?
[11:14:52] quirkycoders: has joined #RubyOnRails
[11:15:20] dminuoso: dionysus69: Please read what you just typed.
[11:15:42] jhfisc: has joined #RubyOnRails
[11:15:55] dionysus69: in context it is clear, I agree I wouldnt know what it says if I read it in a week :D
[11:16:12] dminuoso: dionysus69: GetClientDebtDataViewModel accepts no parameters, period.
[11:16:17] dminuoso: dionysus69: What you are talking about is the RESPONSE.
[11:16:22] dminuoso: You *get* a CreateDate.
[11:16:30] dminuoso: Or rather a sequence of objects containing a CreateDate
[11:16:41] dionysus69: I dont know maybe those programmers who wrote it made a mistake... they had to then
[11:16:48] wethu: has joined #RubyOnRails
[11:16:53] dionysus69: I will call figure it out thanks dminuoso :D
[11:26:34] tbuehlmann: dminuoso: does this look like a good way to include bootstrap into a rails app to you? http://nithinbekal.com/posts/yarn-rails/
[11:27:02] arBmind: has joined #RubyOnRails
[11:27:26] dminuoso: tbuehlmann: Personally, no.
[11:27:53] dminuoso: tbuehlmann: Oh well. That is under the assumption of lacking webpack.
[11:28:34] dminuoso: tbuehlmann: Absolutely. Until 5.1 that should be the way to do it. :)
[11:29:56] patarr: has joined #RubyOnRails
[11:33:56] tbuehlmann: great, giving it a shot then. I'm still not comfortable with webpack at all
[11:34:13] hahuang65: has joined #RubyOnRails
[11:37:09] delgiudices: has joined #RubyOnRails
[11:40:24] jarr0dsz: has joined #RubyOnRails
[11:40:35] jarr0dsz: hello everyone im trying to build a AR collection from a single User object
[11:40:57] jarr0dsz: but cannot find any reference on how to approach this.. how would I do this? @users << single_user_object does not work
[11:41:10] jarr0dsz: would i have to init the @users before? I tried @users = User.new which also fails
[11:41:52] jarr0dsz: i can add them to an array with .push but thats unhandy in rendering like regular collection so then @users would be an array and not a AR collection anyone could please help me with this? really lost on a solution
[11:42:24] MrCrackPotBuilde: has joined #RubyOnRails
[11:42:59] jarr0dsz: the reason for this is im loading single objects from multiple databases like so https://gist.github.com/anonymous/9f48c6c18aa4a14811a7148fa6a3d08d
[11:43:29] jarr0dsz: last line should be @requests << requests
[11:44:28] jarr0dsz: so i found this on stack; @group.users << User.find(user_id) # Add an existing user to the association which fails
[11:44:35] tbuehlmann: jarr0dsz: isn't this exactly the same thing you asked just recently?
[11:44:52] jarr0dsz: i fixed all the problems with multitennant, yes sortoff not exactly the same
[11:45:03] jhfisc: has joined #RubyOnRails
[11:45:28] jarr0dsz: tbuehlmann i could not get your example to work it generates a array I do some things to the @requests object after it is generated.. so I need it to be AR collection for that reason
[11:45:57] jarr0dsz: tbuehlmann first i create a @requests from all db's. then on this i do where statements, this saves multiple lines of code.. an array fails for that
[11:46:16] tbuehlmann: if I remember correctly, you don't want a relation but a simple array
[11:46:42] jarr0dsz: tbuehlmann im doing like if @requests then. @requests_data = @requests.where('request_type' => 'data')
[11:46:47] jarr0dsz: for that reason the array does not work
[11:49:02] tbuehlmann: your gist doesn't make sense, I don't know what you're trying to do
[11:50:40] jarr0dsz: basically its very simple.. i have a Request.find(1) and a Request.find(2) and I both want to add them to @requests as a AR collection
[11:50:45] jarr0dsz: thats all I try to do
[11:50:58] jarr0dsz: I thought this would be simple but AR does not let me do it
[11:51:00] tbuehlmann: and they come from different databases, right?
[11:51:08] quirkycoders: has joined #RubyOnRails
[11:51:50] jarr0dsz: tbuehlmann like so https://gist.github.com/anonymous/29952d1d1d52eff34300373ef4ecc38a
[11:51:53] jarr0dsz: yes correctly
[11:52:05] jarr0dsz: but i loop them so thats not a problem i have the single object retrieved
[11:52:12] jarr0dsz: just need a way to add them to the collection..
[11:52:45] krmela: has joined #RubyOnRails
[11:53:48] krmela: good day there
[11:53:59] tbuehlmann: if you have the single objects from different databases, you don't want a relation including them, because that's silly. you want an array including all the single objects
[11:54:35] jarr0dsz: tbuehlmann yes but then i have the problem i cannot do a .where on the collection because its an array...
[11:54:55] jarr0dsz: i want to collect them in @requests then do some Ar queries on them to generate different collections
[11:55:12] tbuehlmann: it doesn't make sense to call .where on a collection of objects coming from different databases
[11:55:26] Jameser: has joined #RubyOnRails
[11:55:50] jarr0dsz: they are combined in 1 single collection, it does not matter if they come from different databases
[11:56:02] tbuehlmann: you can use .where to filter data coming from one database, not a different databases, and also not an array
[11:56:08] jarr0dsz: i just want to have a regular collection and use it as is
[11:56:12] tbuehlmann: it does matter, because .where talks to the database
[11:56:29] jarr0dsz: i understand that.. but if i have an AR collection the .where is used on that collection right?
[11:57:23] dionysus69: dminuoso: finally fixed it :D they fixed something obviously + they required date object instead of date string, which they didnt specify :)
[11:57:56] jarr0dsz: tbuehlmann if i go the Array route,, i have changed it back now, then im stuck at @requests_data = @requests.where('request_type' => 'data')
[11:58:19] jarr0dsz: since @requests would be an array, is there a way to get the correct data from the array then? filter/select from the array instead of using a where?
[11:58:28] krmela: i have question how to get fastly number of working day between two dates excluding dates in model LockedDay.date_locked my last try is on https://gist.github.com/netmoleCBA/682b7b31de2070484019d32a6320f4ed but i think there must be better way
[11:59:50] krmela: it is used for food orders in our canteen
[12:00:13] jarr0dsz: some find/query method for arrays... select from array where type='x'
[12:00:18] jhfisc: has joined #RubyOnRails
[12:01:15] Sigyn: has joined #RubyOnRails
[12:04:38] tbuehlmann: that's just ruby then: array.select { |object| object.type == 'x' }
[12:06:53] jhfisc: has joined #RubyOnRails
[12:10:00] chimkan: has joined #RubyOnRails
[12:10:34] Jameser: has joined #RubyOnRails
[12:13:07] chimkan: has joined #RubyOnRails
[12:15:37] mr-spoon: has joined #RubyOnRails
[12:18:54] chimkan: has joined #RubyOnRails
[12:22:08] chimkan: has joined #RubyOnRails
[12:37:53] jarr0dsz: is it possible somehow to convert an array to an AR collection?
[12:37:55] jarr0dsz: anyone knows that?
[12:38:07] jarr0dsz: tbuehlmann thank you figured that out in the meantime
[12:43:03] Jameser: has joined #RubyOnRails
[12:48:54] r3vDev: has joined #RubyOnRails
[12:49:39] jphase: has joined #RubyOnRails
[12:52:31] Rodya_: has joined #RubyOnRails
[12:55:56] jhfisc: has joined #RubyOnRails
[13:01:48] shotbug: has joined #RubyOnRails
[13:03:51] patarr: has joined #RubyOnRails
[13:13:44] Jameser: has joined #RubyOnRails
[13:16:40] rainy_mood2002: has joined #RubyOnRails
[13:18:08] rainy_mood2002: hello, anyone know how to configure serializer adapter in test environment?
[13:18:57] rainy_mood2002: I configured my app to use adapter = :json, but in my tests my app expects old regular adapter
[13:19:08] joeyk: has joined #RubyOnRails
[13:23:06] gamblor3: has joined #RubyOnRails
[13:26:28] Jameser: has joined #RubyOnRails
[13:27:43] jhfisc: has joined #RubyOnRails
[13:29:02] phikes: has joined #RubyOnRails
[13:29:15] josefrichter: hey, can I post jobs here, or is there a separate channel, please?
[13:29:26] mikecmpbll: josefrichter : you may.
[13:30:47] josefrichter: mikecmpbll: thanks
[13:34:59] jhfisc: has joined #RubyOnRails
[13:35:02] hahuang65: has joined #RubyOnRails
[13:38:45] gregf_: has joined #RubyOnRails
[13:42:16] r3vDev: has joined #RubyOnRails
[13:42:36] centrx: has joined #RubyOnRails
[13:43:36] Jameser: has joined #RubyOnRails
[13:45:56] roamingdog: has joined #RubyOnRails
[13:47:30] gheegh: has joined #RubyOnRails
[13:48:05] jhfisc: has joined #RubyOnRails
[13:48:15] someish: has joined #RubyOnRails
[13:52:30] jhfisc: has joined #RubyOnRails
[13:58:30] josefrichter: [remote developer neeeded] any footbal fans & TDD fans here? :-) Need help with with football stats app please, some details here https://gist.github.com/josefrichter/743bb09095bdcdf3a919a37010b41a3a
[14:00:27] Technodrome: has joined #RubyOnRails
[14:02:47] jhfisc: has joined #RubyOnRails
[14:04:39] troys: has joined #RubyOnRails
[14:06:11] chimkan: has joined #RubyOnRails
[14:06:34] jhfisc: has joined #RubyOnRails
[14:10:07] chimkan: has joined #RubyOnRails
[14:11:17] dangerousdave: has joined #RubyOnRails
[14:11:42] jhfisc: has joined #RubyOnRails
[14:16:48] jhfisc: has joined #RubyOnRails
[14:22:17] Ropeney: has joined #RubyOnRails
[14:22:26] chimkan: has joined #RubyOnRails
[14:25:22] xiljin: has joined #RubyOnRails
[14:25:49] Yzguy: has joined #RubyOnRails
[14:29:37] jhfisc: has joined #RubyOnRails
[14:35:45] jhfisc: has joined #RubyOnRails
[14:36:19] theunraveler: has joined #RubyOnRails
[14:42:16] v|sh: has joined #RubyOnRails
[14:43:37] conta: has joined #RubyOnRails
[14:47:35] workmad3: has joined #RubyOnRails
[14:51:44] jhfisc: has joined #RubyOnRails
[14:56:28] dionysus70: has joined #RubyOnRails
[15:02:06] cam27: has joined #RubyOnRails
[15:03:06] workmad3: has joined #RubyOnRails
[15:04:42] arBmind: has joined #RubyOnRails
[15:05:21] patarr: has joined #RubyOnRails
[15:06:11] dminuoso: dionysus69: Very well.
[15:12:26] shotbug: has joined #RubyOnRails
[15:12:27] Rodya_: has joined #RubyOnRails
[15:19:40] jhfisc: has joined #RubyOnRails
[15:21:58] pLaTo0n: has joined #RubyOnRails
[15:22:42] JDeen: has joined #RubyOnRails
[15:22:49] dminuoso: josefrichter: People still do TDD?
[15:27:55] JDeen: Hi.. I am starting with doorkeeper and am new to oauth stuff. Planning to use oauth on an api. I see how a oauth-client server would handle the oauth process. Can a mobile app use to auth with the api? What I am asking is, how much of a pain will it be for a mobile app dev to get a token through oauth?
[15:29:56] dminuoso: jdeen: You dont get a token *through* oauth.
[15:30:09] dminuoso: jdeen: At any rate, once you wrap your head around the terminology and the concept its actually very easy to use.
[15:30:54] dminuoso: jdeen: Clientside you don't really need a library at all (though they can simplify refresh tokens - depending on your chosen grant type - can be a bit helpful)
[15:31:33] dminuoso: jdeen: So. APIs can be aware of OAuth, but they dont have to be.
[15:31:53] dminuoso: jdeen: OAuth makes no assumptions about how your API works, or how the tokens work or even what they look like.
[15:32:23] dminuoso: OAuth covers _how_ tokens are handed out. :-)
[15:32:37] quirkycoders: has joined #RubyOnRails
[15:34:07] jaegerca: has joined #RubyOnRails
[15:34:43] jaegerca: Is is possible to do @user.items.joins(:price) or do I always have to do my joins on User?
[15:34:47] jhfisc: has joined #RubyOnRails
[15:35:05] dminuoso: jaegerca: !tias
[15:35:05] helpa: jaegerca: Try It And See.
[15:35:15] jaegerca: I have tried it
[15:35:38] jaegerca: I know it doesn't work - the underlying question is if there is a way to add a joins after the query chain has started.
[15:35:54] hahuang65: has joined #RubyOnRails
[15:36:51] kitsuneyo: has joined #RubyOnRails
[15:37:26] brent__: has joined #RubyOnRails
[15:38:12] kitsuneyo: i'm suddenly getiing a PG::ConnectionBad error on my development and test servers. it was working fine last night and i haven't really changed anything apart from having restarted my computer.
[15:38:35] tycoon177: kitsuneyo: have you tried connecting to it with a sql client?
[15:38:36] dminuoso: kitsuneyo: Your database is probably down.
[15:38:49] jhfisc: has joined #RubyOnRails
[15:38:55] dminuoso: kitsuneyo: What error message are you getting?
[15:39:05] kitsuneyo: why would my db be down? it's local and it's never happened before
[15:39:18] kitsuneyo: .rvm/gems/ruby-2.4.1/gems/pg-0.21.0/lib/pg.rb:56:in `initialize': could not connect to server: No such file or directory (PG::ConnectionBad)
[15:39:18] kitsuneyo: Is the server running locally and accepting
[15:39:19] dminuoso: kitsuneyo: You restarted your computer?
[15:39:19] kitsuneyo: connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
[15:39:26] dminuoso: kitsuneyo: Well.
[15:39:31] dminuoso: kitsuneyo: How could this be any confusing.
[15:39:46] dminuoso: kitsuneyo: What part of that top notch error message escaped you?
[15:40:11] workmad3: has joined #RubyOnRails
[15:40:33] dminuoso: kitsuneyo: Okay so locally you rarely use TCP sockets anymore if you can avoid it.
[15:40:49] dminuoso: kitsuneyo: Instead a mechanism called unix domain sockets is used, which is kind of like a TCP connection, except it happens through a file.
[15:41:04] dminuoso: kitsuneyo: So instead of "listening at a port" - "a file (a unix domain socket) is created"
[15:41:25] dminuoso: kitsuneyo: If that file does not exist, it's the equivalent of "nobody is listening at that port"
[15:41:33] kitsuneyo: Ok, so something happened to my file. Weird.
[15:41:44] dminuoso: kitsuneyo: Right. That file disappears when postgresql stops usually.
[15:41:49] dminuoso: kitsuneyo: (or whatever application you have)
[15:42:00] kitsuneyo: It's postgresql, yeah
[15:42:07] dminuoso: kitsuneyo: So if its not there, its an indicator that postgresql is no longer running (and accepting conncetions through that UDS)
[15:42:22] kitsuneyo: Hmm, I wonder what happened
[15:42:36] dminuoso: kitsuneyo: check your postgres logs.
[15:42:51] pwnd_nsfw: Damn, with railscasts being made completely free
[15:43:03] pwnd_nsfw: that's all I got lol. Even though most of the material is old
[15:47:25] roshanavand: has joined #RubyOnRails
[15:47:35] Rodya_: has joined #RubyOnRails
[15:48:42] kitsuneyo: dminuoso, my log has a message for you
[15:48:43] Yzguy: has joined #RubyOnRails
[15:48:49] kitsuneyo: LOG: received smart shutdown request
[15:48:49] kitsuneyo: LOG: autovacuum launcher shutting down
[15:48:49] kitsuneyo: LOG: shutting down
[15:48:49] kitsuneyo: LOG: database system is shut down
[15:49:01] dminuoso: kitsuneyo: It shut down.
[15:49:04] dminuoso: And never shut up again.
[15:49:15] [Butch]: has joined #RubyOnRails
[15:49:37] kitsuneyo: i can't think why this has happened
[15:49:47] jhfisc: has joined #RubyOnRails
[15:50:18] dminuoso: kitsuneyo: You rebooted your computer.
[15:50:35] kitsuneyo: I reboot my computer a few times a month
[15:50:49] dminuoso: 17:38:13 kitsuneyo | i'm suddenly getiing a PG::ConnectionBad error on my development and test servers. it was working fine last night and i haven't really changed anything apart from having restarted my computer.
[15:50:53] dminuoso: What can I sai.
[15:51:05] dminuoso: kitsuneyo: What mechanism is supposed to restart postgresql automatically?
[15:51:09] kitsuneyo: Yeah but I didn't actually think that was a reason
[15:51:30] dminuoso: kitsuneyo: when your computer shuts down, shit stops running.
[15:51:31] kitsuneyo: The same one that usually does it, whatever that might be
[15:51:41] dminuoso: kitsuneyo: Figure it out.
[15:52:39] Rodya_: has joined #RubyOnRails
[15:52:57] lbrewington: has joined #RubyOnRails
[15:52:59] kitsuneyo: dminuoso, i will. thanks for your help as usual. i never would've known about the unix socket thing otherwise
[15:54:30] lbrewington: quick question. I am having problem with activerecord .pluck. I have a chained geocode Store.near([lat, long], 50]). I need to return only the column name, but if I chain .pluck() onto the end of the statement the query will not work because the sql only selects name. Is there a way to either add those columns to the query or just return the column from the object after the query?
[15:57:12] gusrub: has joined #RubyOnRails
[15:58:26] r3vDev: has joined #RubyOnRails
[15:58:48] centrx: lbrewington: Where does #near come from?
[15:59:11] lbrewington: centrx: it's the ruby geocode gem
[15:59:23] workmad3: has joined #RubyOnRails
[15:59:27] lbrewington: centrx: from the docs: A lot of debugging time can be saved by understanding how Geocoder works with ActiveRecord. When you use the near scope or the nearbys method of a geocoded object, Geocoder creates an ActiveModel::Relation object which adds some attributes (eg: distance, bearing) to the SELECT clause. It also adds a condition to the WHERE clause to check that distance is within the given radiu
[15:59:27] lbrewington: s. Because the SELECT clause is modified, anything else that modifies the SELECT clause may produce strange results, for example:
[15:59:52] lbrewington: centrx: so using pluck makes the query add a single column to select, which blows up the geocoding query
[16:00:02] gusrub: has joined #RubyOnRails
[16:00:06] lbrewington: centrx: i am writing some mapping code right now, but itseems like there would be a better way
[16:00:19] lbrewington: centrx: that is object.map()
[16:00:36] centrx: lbrewington: You don't need to use pluck. pluck is an optimization
[16:01:19] lbrewington: centrx: so what would be the best practice for returning just name for "render json: stores" if you follow me
[16:01:31] jhfisc: has joined #RubyOnRails
[16:02:16] lbrewington: centrx: stores.map{|store| store.name}
[16:02:34] lbrewington: centrx: or is there a less verbose activerecord method i can use?
[16:03:03] centrx: lbrewington: stores.map(&:name)
[16:03:15] lbrewington: centrx: lol okay, thanks!
[16:07:51] Rodya_: has joined #RubyOnRails
[16:09:00] jhfisc: has joined #RubyOnRails
[16:10:28] delgiudices: has joined #RubyOnRails
[16:11:23] delgiudices: has joined #RubyOnRails
[16:12:13] delgiudices: has joined #RubyOnRails
[16:18:06] gamblor3: has joined #RubyOnRails
[16:19:40] gusrub: has joined #RubyOnRails
[16:20:22] DrYockel: has joined #RubyOnRails
[16:24:10] jhfisc: has joined #RubyOnRails
[16:24:27] conta: has joined #RubyOnRails
[16:26:20] cnk: has joined #RubyOnRails
[16:30:14] jhfisc: has joined #RubyOnRails
[16:34:58] rubylegend2092: has joined #RubyOnRails
[16:38:28] rubylegend2092: I have a question that regards to ActiveRecord. I have 3 models. BusinessUser / BusinessReview / User. I would like to allow the UserModel to create BusinessReviews for the BusinessUser. How would you set this relationship up between the objects w/ActiveRecord?
[16:38:47] jhfisc: has joined #RubyOnRails
[16:39:54] tbuehlmann: rubylegend2092: what are your thoughts and what have you tried?
[16:41:27] rubylegend2092: I figured that the businessuser has many reviews. But, the reviews belong to the user.
[16:42:22] tbuehlmann: sounds right
[16:42:50] rubylegend2092: I wanted to make sure that I had the best approach.
[16:43:40] tbuehlmann: with these requirements, I'd do the same
[16:43:49] baweaver: rubylegend2092: Ah, but what's the review of?
[16:44:03] rubylegend2092: the business itself.
[16:44:09] baweaver: A review is probably the combination of a user, a product, and a rating
[16:44:19] baweaver: so business instead of product
[16:44:22] baweaver: but same general idea
[16:47:42] jhfisc: has joined #RubyOnRails
[16:51:30] cnk: has joined #RubyOnRails
[16:52:21] jhfisc: has joined #RubyOnRails
[16:52:32] TvL2386: has joined #RubyOnRails
[16:57:35] dionysus69: has joined #RubyOnRails
[17:00:55] jhfisc: has joined #RubyOnRails
[17:01:47] gusrub: has joined #RubyOnRails
[17:03:36] delgiudices: has joined #RubyOnRails
[17:05:39] someish: has joined #RubyOnRails
[17:07:36] cgfbee: has joined #RubyOnRails
[17:08:40] iamdevnul: hey all, what is the recommended gem for checking your Gemfile.lock for security updates?
[17:08:56] iamdevnul: i came across bundler-audit, not sure if that's the recommended one to use or not
[17:14:31] hahuang65: has joined #RubyOnRails
[17:14:41] kies: has joined #RubyOnRails
[17:17:44] jhfisc: has joined #RubyOnRails
[17:18:37] gusrub: has joined #RubyOnRails
[17:20:14] workmad3: has joined #RubyOnRails
[17:27:40] josefrichter: dminuoso wait, why wouldn’t people do TDD? am I a dinasaur?
[17:28:16] cnk: has joined #RubyOnRails
[17:32:55] runescape07rsps: has joined #RubyOnRails
[17:34:12] jhfisc: has joined #RubyOnRails
[17:46:24] Chernobuk: has joined #RubyOnRails
[17:56:33] jottr: has joined #RubyOnRails
[18:05:17] jhfisc: has joined #RubyOnRails
[18:06:26] lxsameer: has joined #RubyOnRails
[18:10:01] AnotherOne: has joined #RubyOnRails
[18:11:41] jhfisc: has joined #RubyOnRails
[18:13:47] TvL2386: hey guys, I'm trying to setup a rails-5.1 project and run into issues with `bundle exec rake db:migrate`
[18:14:49] TvL2386: Mysql2::Error: Specified key was too long; max key length is 767 bytes: CREATE UNIQUE INDEX `uniq_some_field` ON `users` (`some_field`)
[18:15:12] conta: has joined #RubyOnRails
[18:15:30] uks: has joined #RubyOnRails
[18:15:47] TvL2386: I just did a `bundle exec rails g scaffold user some_field:string:uniq
[18:15:56] TvL2386: and then `bundle exec rake db:migrate`
[18:16:15] theunraveler: has joined #RubyOnRails
[18:16:24] AnotherOne: seams like you have a key in the uniq_some_field column which is longer than the new type which will be changed trough migration
[18:17:35] cnk: has joined #RubyOnRails
[18:17:42] jhfisc: has joined #RubyOnRails
[18:19:39] tercenya: has joined #RubyOnRails
[18:20:39] agent_white: has joined #RubyOnRails
[18:22:47] jhfisc: has joined #RubyOnRails
[18:24:01] conta: is there an option to not use coffee-script when creating new rails app via rails new?
[18:25:54] jphase: has joined #RubyOnRails
[18:26:01] mrbubbles: has joined #RubyOnRails
[18:26:50] jhfisc: has joined #RubyOnRails
[18:29:28] TvL2386: mkay... is there a way to find out what the resulting SQL is?
[18:32:02] jhfisc: has joined #RubyOnRails
[18:34:00] cam27: has joined #RubyOnRails
[18:43:40] TvL2386: maybe I should switch mariadb out in favor of postgress
[18:44:29] conta: TvL2386: you can see resulting sql in console
[18:44:38] conta: in Development enb
[18:46:29] jottr: has joined #RubyOnRails
[18:47:37] TvL2386: ActiveRecord::StatementInvalid: Mysql2::Error: Specified key was too long; max key length is 767 bytes: CREATE UNIQUE INDEX `uniq_aaa_id` ON `my_table` (`aaa_id`)
[18:50:01] roamingdog: has joined #RubyOnRails
[18:50:52] TvL2386: anyway: never tried postgres, so I'm curious to find out about it
[18:51:05] patarr: Is there a way to take a query like MyModel.some_scope and take all of its output data and write it into a separate table? (With the same schema as MyModel of course)
[18:55:38] jaegerca: has joined #RubyOnRails
[18:56:47] dionysus70: has joined #RubyOnRails
[18:59:25] patarr: Or create temp tables for models?
[19:00:39] patarr: OR manually specify a target table for an AREL?
[19:00:40] ahrs: has joined #RubyOnRails
[19:00:42] patarr: Anything?
[19:01:44] dionysus69: Net::OpenTimeout (execution expired): after 60 seconds and dev server still hanging. i did it on purpose. do i put these statements in begin rescue blocks?
[19:03:32] jottr: has joined #RubyOnRails
[19:06:28] jaegerca: I am doing something like: school.employees.merge(Employee.teacher) - but when I merge Employee.teacher in it seems to be kicking my school_id out so I am just getting all employees that are teachers in any school. Anyone have any ideas?
[19:13:12] netzfisch: has joined #RubyOnRails
[19:20:57] gusrub: has joined #RubyOnRails
[19:22:59] patarr: What is the alternative to `all` when I don't want an AREL, but an array of all the objects?
[19:27:27] Rodya_: has joined #RubyOnRails
[19:35:03] HoierM: has joined #RubyOnRails
[19:43:21] patarr: I found .to_ary which fit the bill but now I'm stuck on how to create an activerecord object and specify it's ID. Tried pretty much every solution on SO without success...
[19:43:28] quirkycoders: has joined #RubyOnRails
[19:46:18] tbuehlmann: patarr: why would you create a record and specify its id?
[19:46:58] srinidhi: has joined #RubyOnRails
[19:51:05] tercenya: has joined #RubyOnRails
[19:51:50] BigDiesel75: has joined #RubyOnRails
[20:02:43] patarr1: has joined #RubyOnRails
[20:03:13] jphase: has joined #RubyOnRails
[20:04:31] sunya7a: When loading a particular view in my system I see a lot of messages prepended with CACHE in my logs. Is this a serious issue or is this something I can ignore? I often look for n+1 query problems and resolve them when I see them but this CACHE is something I"m not sure about
[20:10:56] lbrewington: ruby golf! https://pastebin.com/8Gf2BZMD
[20:14:10] baweaver: that's not golf
[20:14:13] baweaver: def as_json;super(only:%i[school tags],method: :distance).tap{|j|j[:distance]=j[:distance].round};end
[20:14:16] baweaver: that's golf
[20:15:36] jaegerca: sunya7a: No, that's an indication that your queries are not n+1
[20:16:12] lbrewington: so here is the problem
[20:16:16] lbrewington: i am using the ruby geocode gem
[20:16:18] jaegerca: sunya7a: Cache is saying "already have that info (because you loaded it with the query) - unless it's the second time you are calling it - in which case you might have an issue
[20:16:36] lbrewington: and this is from the website :A lot of debugging time can be saved by understanding how Geocoder works with ActiveRecord. When you use the near scope or the nearbys method of a geocoded object, Geocoder creates an ActiveModel::Relation object which adds some attributes (eg: distance, bearing) to the SELECT clause. It also adds a condition to the WHERE clause to check that distance is within the give
[20:16:36] lbrewington: n radius. Because the SELECT clause is modified, anything else that modifies the SELECT clause may produce strange results, for example:
[20:16:42] lbrewington: i just want to .round the damn value
[20:16:53] lbrewington: but if i try to override with a def distance super.round end
[20:17:02] lbrewington: it tells me there is no super for distance
[20:17:11] lbrewington: how do i access the value of distance and return it rounded ?
[20:17:27] baweaver: Is distance an attribute?
[20:17:38] lbrewington: i have no idea what it is, i can inspect is and tell
[20:17:48] lbrewington: i am pretty sure it is a method?
[20:17:56] lbrewington: wait, i'm not pretty sure
[20:17:57] jaegerca: I would sure hope so
[20:17:59] lbrewington: but maybe it is a method
[20:18:14] jaegerca: What else could it be?
[20:18:15] sunya7a: jaegerca: okay...so safe to ignore...i think it's being called several times because I have a piece of code in the view that draws from a table to come up with a list of choices
[20:18:17] baweaver: Is it a field on the DB object?
[20:18:34] lbrewington: it adds a select statement with distance
[20:18:35] jaegerca: round is a field?
[20:18:38] benlieb: has joined #RubyOnRails
[20:18:49] lbrewington: no, round is a ruby framework thing
[20:19:03] lbrewington: like i =39.23412 ; i.round
[20:19:06] lbrewington: and it outputs 39
[20:19:07] baweaver: def distance; read_attribute(:distance).round end
[20:19:14] sunya7a: jaegerca: i guess i should cache the list as an instance variable in the controller instead...or would you say that seeingn CACHe multiple times has no performance issues
[20:20:00] lbrewington: baweaver: how the hell do you know that lol
[20:20:04] lbrewington: baweaver: cause it totaly worked
[20:20:13] baweaver: Slightly long story
[20:20:24] baweaver: short version is field overwriting for migrating data models
[20:20:53] jaegerca: sunya7a: I am not sure I understand what you mean. Why would you want to do that in the controller? You shouldn't have performance issues with it
[20:20:54] baweaver: which is no fun to do on a live API system
[20:21:05] jaegerca: If you do you can adjust the messages being logged on production
[20:22:28] sunya7a: jaegerca: thank you
[20:23:09] baweaver: Remember kids, get your data model right the first time, because migrating large chunks of it is no fun :D
[20:23:56] lbrewington: baweaver: you are king of the ruby channel
[20:24:14] lbrewington: baweaver: where do you live?
[20:25:08] lbrewington: baweaver: ever wanted to move the south, haha
[20:25:30] baweaver: Na, bought a house and just got a new job I'm starting in a few weeks.
[20:25:50] baweaver: but I'll be around IRC still :)
[20:26:21] lbrewington: baweaver: i hope they are paying you well, they must if you are buying a house in the bay area
[20:26:45] jaegerca: baweaver: I don't think I have ever had my model right
[20:26:51] baweaver: Oh they are. I also compulsively save
[20:27:15] baweaver: jaegerca: Yeah, but in my case we had to take a huge part of it and rewrite it which was core to the entire app workflow in one go
[20:27:26] jaegerca: baweaver: never fun!!
[20:27:26] baweaver: If you can avoid that one at least :P
[20:27:59] baweaver: We had a core page making 2000 queries that was being loaded normally a 100 times a minute
[20:28:18] baweaver: After we finally killed that danged thing it went down to 3.
[20:28:46] baweaver: Someone thought it was clever to patch the data model by making psuedo-relationships in the front end to compensate for lack of them on the backend.
[20:29:28] jaegerca: baweaver: Oh wow - those are the kinds of things that make me really wonder how talented some people are
[20:29:48] baweaver: Took me two months to finally migrate it fully.
[20:29:56] jaegerca: I feel like an okay programmer, but those are things I would never do. It amazes me how much people get away with in this field.
[20:30:00] jhfisc: has joined #RubyOnRails
[20:30:11] baweaver: It starts small, then more data needs to be on the page
[20:30:27] baweaver: then it balloons from maybe 20 to thousands.
[20:33:30] baweaver: Nothing ever really starts out as a monster, it grows through weeks and months of neglect and patches.
[20:33:39] jaegerca: Yeah. One broken window - the whole neighbourhood goes down.
[20:34:18] jaegerca: Slowly but surely!
[20:34:39] baweaver: Indeed. Which is why code reviews are important and tech debt needs to be killed quickly.
[20:36:35] jhfisc: has joined #RubyOnRails
[20:37:44] baweaver: well, coffee time for me, be back in a bit.
[20:43:56] patarr: has joined #RubyOnRails
[20:47:03] theunraveler: has joined #RubyOnRails
[20:49:26] mikecmpbll: has joined #RubyOnRails
[20:52:30] quirkycoders: has joined #RubyOnRails
[20:52:33] jhfisc: has joined #RubyOnRails
[20:53:02] workmad3: has joined #RubyOnRails
[20:55:55] jhfisc: has joined #RubyOnRails
[21:00:49] jhfisc: has joined #RubyOnRails
[21:04:38] patarr: has joined #RubyOnRails
[21:11:50] drale2k_: has joined #RubyOnRails
[21:15:32] jhfisc: has joined #RubyOnRails
[21:16:21] patarr: has joined #RubyOnRails
[21:26:35] jhfisc: has joined #RubyOnRails
[21:29:17] mostlybadfly: has joined #RubyOnRails
[21:31:52] jhfisc: has joined #RubyOnRails
[21:38:28] jhfisc: has joined #RubyOnRails
[21:41:10] agent_white: has joined #RubyOnRails
[21:43:00] jhfisc: has joined #RubyOnRails
[21:47:03] dionysus69: has joined #RubyOnRails
[21:48:56] jhfisc: has joined #RubyOnRails
[21:49:00] cam27: has joined #RubyOnRails
[21:49:30] jak: has joined #RubyOnRails
[21:59:17] swrh: has joined #RubyOnRails
[22:07:40] ThatsNotJack: has joined #RubyOnRails
[22:13:43] mr-spoon: has joined #RubyOnRails
[22:13:50] jak: has joined #RubyOnRails
[22:14:31] jak: has left #RubyOnRails: ()
[22:21:44] jhfisc: has joined #RubyOnRails
[22:28:05] workmad3: has joined #RubyOnRails
[22:31:21] cam27: has joined #RubyOnRails
[22:32:41] NoGodDamnIdea: has joined #RubyOnRails
[22:34:44] knight33: has joined #RubyOnRails
[22:43:39] aperkins81: has joined #RubyOnRails
[22:45:15] ahrs: has joined #RubyOnRails
[22:47:15] agent_white: has joined #RubyOnRails
[22:51:29] hahuang65: has joined #RubyOnRails
[22:54:00] ur5us: has joined #RubyOnRails
[23:11:10] zacts: has joined #RubyOnRails
[23:13:32] delgiudices: has joined #RubyOnRails
[23:14:31] delgiudices: has joined #RubyOnRails
[23:15:21] delgiudices: has joined #RubyOnRails
[23:16:32] eljimmy: has joined #RubyOnRails
[23:18:44] Jameser: has joined #RubyOnRails
[23:21:46] eljimmy: heyall, anyone who's used rails webpacker, is there a way to use that without having to switch all my javascript_include_tag and stylesheet_link_tag to javascript_pack stylesheet_pack? i assumed just overriding assettaghelper
[23:24:05] wethu: has joined #RubyOnRails
[23:24:48] jhfisc: has joined #RubyOnRails
[23:28:00] jottr: has joined #RubyOnRails
[23:40:35] eljimmy: *crickets*
[23:43:14] s00pcan: not sure what I'm trying to do. There's a join table, and I want to know when it only has one row with a certain value for use with a scope
[23:44:10] chimkan: has joined #RubyOnRails