« Back to channel list

#RubyOnRails - 21 March 2016

« Back 1 day Forward 1 day »
[00:02:06] Ropeney: has joined #RubyOnRails
[00:03:35] uglybandersnatch: has joined #RubyOnRails
[00:08:40] jaequery_: has joined #RubyOnRails
[00:08:42] |PiP|: has joined #RubyOnRails
[00:09:40] lessless: has joined #RubyOnRails
[00:21:39] uglybandersnatch: has joined #RubyOnRails
[00:26:18] dandaman: has joined #RubyOnRails
[00:29:20] dalbuschat: has joined #RubyOnRails
[00:31:48] Darmani: Radar: Bromigo
[00:31:55] Radar: Darmani: Got specific questions now?
[00:33:07] Darmani: Ehh. Not really...
[00:33:22] Radar: > 'm just confused on a few things.
[00:33:27] Darmani: Is there a book you would recommend? Or perhaps a project that would be good to start?
[00:33:30] Radar: Typically when someone says this, they know what specifically they're confused on
[00:33:35] Radar: People aren't just generally in a confused state?
[00:33:39] helpa: 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
[00:33:59] Radar: https://gist.github.com/radar/3037d4c5f8d3240afd43 Here's an app you could work toward building
[00:34:03] chouhoulis: has joined #RubyOnRails
[00:34:47] Darmani: Radar: Oh awesome. Thanks Radar (:
[00:35:30] Darmani: I'm using c9 to practice so maybe later I can send you a link and you could take a look at it for me.
[00:36:07] Radar: I'd prefer a GitHub repo if you have one
[00:36:10] Radar: That way I can do PRs to it
[00:37:05] Darmani: I think I can manage that.
[00:37:38] SteenJobs: has joined #RubyOnRails
[00:37:55] Radar: That'd be good :)
[00:45:17] awasum: has joined #RubyOnRails
[00:47:29] Oliphaunte: has joined #RubyOnRails
[00:49:31] Darmani: Radar: Version control on Git seems so complicated.. o.o
[00:55:32] htmldrum_: has joined #RubyOnRails
[00:57:05] sneakerhax: has joined #RubyOnRails
[00:59:02] baweaver: has joined #RubyOnRails
[01:04:39] qejk: has joined #RubyOnRails
[01:04:54] baweaver: has joined #RubyOnRails
[01:07:27] ekinmur: has joined #RubyOnRails
[01:08:39] speakingcode: has joined #RubyOnRails
[01:09:59] arBmind1: has joined #RubyOnRails
[01:11:07] axilaris: has joined #RubyOnRails
[01:11:37] JoshGlzB_: has joined #RubyOnRails
[01:11:37] Radar: Darmani: Most of the time you'll be using 1) git add . 2) git commit 3) git push 4) git pull
[01:11:52] Radar: This book helped solidify what Git does: https://git-scm.com/book/en/v2
[01:12:13] Darmani: jesus you know all the books don't ya lol
[01:12:28] Radar: Well I wrote Rails 4 in Action :P
[01:12:47] Radar: brb, need to run some errands
[01:15:18] bricker: has joined #RubyOnRails
[01:17:42] humbledaisy: has joined #RubyOnRails
[01:22:45] jstransky: has joined #RubyOnRails
[01:29:27] sevenseacat: has joined #RubyOnRails
[01:30:54] timdotrb: I’ve used constraints in routes with subdomains, but is there a way to use constraints with something like a referer?
[01:33:08] _Tariq: has joined #RubyOnRails
[01:33:31] Radar: timdotrb: yes
[01:33:52] kdough: has joined #RubyOnRails
[01:34:31] chouhoulis: has joined #RubyOnRails
[01:34:49] Thomas-0725: has joined #RubyOnRails
[01:35:27] Radar: timdotrb: If you define a class for your constraint, you have access to the request obj in your matches? method. Just check request.referer there
[01:35:31] Radar: brb agani
[01:36:53] tomatoes: has joined #RubyOnRails
[01:36:55] _bogus_: how can I create a virtual column for 'confirmation' in User (using devise) that's gettable and settable like a column? Like, @user.confirm = true, or @user.confirm = false, or @user.confirm can return true/false depending on confirmation status
[01:37:22] timdotrb: Radar: where would I define the class in the folder structure?
[01:37:46] timdotrb: _bogus_: have you looked at attr_accessor ?
[01:38:53] _bogus_: timdotrb, not yet, ill give it a look, thanks
[01:39:03] timdotrb: _bogus_: np
[01:39:14] Radar: timdotrb: lib/constraints is my fav place
[01:45:11] chipotle: has joined #RubyOnRails
[01:46:08] Guest34101: has joined #RubyOnRails
[01:46:39] stannard: has joined #RubyOnRails
[01:47:23] dandaman: has joined #RubyOnRails
[01:49:06] Spami: has joined #RubyOnRails
[01:53:14] timdotrb: Radar: http://guides.rubyonrails.org/routing.html#advanced-constraints shows BlacklistConstraint.new as the constraint. Will that execute the matches? method?
[01:57:05] halfamind: has joined #RubyOnRails
[01:57:26] the_last9: has left #RubyOnRails: ()
[02:00:23] Oliphaunte: has joined #RubyOnRails
[02:01:54] sevenseacat: i was always partial to 6 myself.
[02:03:29] timdotrb: Radar: getting an unitialized constant error on the constraint
[02:03:46] timdotrb: Radar: do I need to do something to include or init the class in the routes?
[02:03:56] Radar: timdotrb: did you require the file that defines the class?
[02:04:13] timdotrb: Radar: nope
[02:04:25] Radar: timdotrb: You'll need to do that before referencing the class.
[02:04:34] timdotrb: Radar: do I need to add the path to the file in the require?
[02:04:48] Radar: timdotrb: !try
[02:04:48] helpa: timdotrb: Why don't you try it and find out for yourself?
[02:05:01] Radar: require 'constraints/my_constraint' should be enough
[02:05:32] timdotrb: Radar: cool, thanks. It’s a pain to test this code :X
[02:06:20] timdotrb: I have to push it to the server before I can test, I’ve had a lot of issues attempting to get it running locally
[02:07:21] sevenseacat: that sounds really bad
[02:08:13] _bogus_: hey, I'm trying to use attr_accessor to create a virtual method for devise confirmation in my model, but it doesn't gets updated via activeadmin (which I presume uses update_attributes).. only using @user.confirmation = true in console... https://gist.github.com/andreycwb/86a86906cdf8ab4046dd what am I doing wrong?
[02:08:24] Radar: ACTION got up to activeadmin
[02:09:24] mrgreenfur: has joined #RubyOnRails
[02:09:40] sevenseacat: _bogus_: possibly a strong params issue, but there isnt anything there to hint at any problem
[02:09:58] sevenseacat: logs are always useful when looking at problems
[02:10:05] _bogus_: sevenseacat, i thought of that too but the param is declared on permit_params
[02:10:21] sevenseacat: ACTION is not psychic and cannot see that anywere
[02:11:04] _bogus_: checkout gist again pls
[02:12:02] sevenseacat: so can we see the logs of what happens when trying to update the attribute?
[02:12:29] gabr13l: has joined #RubyOnRails
[02:12:31] _bogus_: no error, it just doesnt gets set
[02:12:49] _bogus_: but i dont think it is a problem with active admin. probably im doing something wrong in my code
[02:12:50] sevenseacat: thats not what i asked
[02:14:05] Ericx2x_: has joined #RubyOnRails
[02:14:16] _bogus_: just added a log to gist
[02:14:35] Radar: https://gist.github.com/andreycwb/86a86906cdf8ab4046dd#file-usuario-rb-L40
[02:14:42] Radar: This could just be "if val"
[02:14:46] uglybandersnatch: has joined #RubyOnRails
[02:14:47] sysodaff: has joined #RubyOnRails
[02:14:51] Radar: _bogus_: Are you certain that the value arriving there is `true`?
[02:15:05] Radar: Because in your logs it sure looks like "confirmacao"=>"1"
[02:15:22] _bogus_: humm.. you're right..
[02:15:35] _bogus_: forgot to check on this..
[02:17:14] LuisC: has joined #RubyOnRails
[02:18:17] awasum_: has joined #RubyOnRails
[02:20:58] diegoviola: has joined #RubyOnRails
[02:23:01] _bogus_: Radar, that was it , its working now , thanks !
[02:23:29] LuisC: are you alive??
[02:23:52] LuisC: i need help
[02:24:32] Inside: anyone have experience designing websites for resistive touch screens?
[02:24:38] Inside: ie: no swipe.
[02:24:49] Inside: reason why it has to be resistive is because people with gloves need to be able to operate it
[02:24:50] LuisC: anyone can help me in a rails problem?
[02:25:02] Inside: luis_: ask and be.. uhh answered?
[02:25:05] gabr13l: has joined #RubyOnRails
[02:25:19] LuisC: i'm getting this error : undefined method `comments' for nil:NilClass
[02:25:21] gabr13l: has left #RubyOnRails: ()
[02:25:34] Inside: you're going to need to paste some code
[02:25:41] Inside: you're doing something like
[02:25:47] Inside: foo = some_function()
[02:25:50] Inside: foo.comments()
[02:25:52] LuisC: can I paste my CommentsController here ?
[02:26:06] Inside: use a pastbin
[02:26:15] Inside: like... pastebin.com
[02:26:25] smathy: Read the /TOPIC
[02:26:27] Inside: use whatever smathy tells you to
[02:26:30] sevenseacat: does no-one read the channel rules anymore?
[02:26:34] fedexo: has joined #RubyOnRails
[02:26:45] Inside: there's too much info, man
[02:26:54] smathy: luis_, !gist your code
[02:26:54] helpa: luis_: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[02:26:58] Inside: there, gist
[02:27:17] Inside: I've like
[02:27:38] sevenseacat: too much info for a man? thats a shame
[02:27:45] Inside: yes indeed
[02:27:52] Inside: that's the answer to how many infos is too many infos for a man
[02:28:02] Inside: but yeah, back to myyy question
[02:28:03] sevenseacat: Inside: let's tone down the silly.
[02:28:15] Inside: resistive touch screen, no scroll or swipe
[02:28:17] LuisC: like this?? https://gist.github.com/luisamaro0/6143d1841821236a91d1
[02:28:45] Inside: yes exactly!
[02:29:02] Inside: so now it would help if you would tell us which action you were in that it was dying on you
[02:29:02] LuisC: my name is there tho ...
[02:29:11] smathy: luis_, next time use a filename with the right extension and gist will color the syntax for us.
[02:29:15] sevenseacat: luis_: so whats the full error you're getting?
[02:29:29] smathy: luis_, you also want to actually tell us ... that ^
[02:29:46] LuisC: i'm getting this: undefined method `comments' for nil:NilClass
[02:29:55] sevenseacat: willing to bet it's on line 19 because @improvement_action is nil
[02:29:56] joshhbk: has joined #RubyOnRails
[02:30:02] flashpoint9: has joined #RubyOnRails
[02:30:06] sevenseacat: thats not the full error - it doesnt tell us where its coming from
[02:30:21] stannard: has joined #RubyOnRails
[02:30:23] LuisC: im new to rails btw ^^
[02:30:24] Radar: sevenseacat: even though it's set here? https://gist.github.com/luisamaro0/6143d1841821236a91d1#file-gistfile1-txt-L76-L78
[02:30:26] Radar: luis_: Gist the full stacktrace please.
[02:30:36] sevenseacat: yeah I misread the before_actions :)
[02:30:40] sevenseacat: trying to be too clever
[02:31:20] smathy: luis_, add the full error you're getting to your gist.
[02:32:13] LuisC: where can I get the full error? :|
[02:32:32] Radar: luis_: What's underneath "undefined method `comments`?
[02:32:54] LuisC: i installed better erros gem and this is differente now
[02:33:07] Radar: ok, give us a screenshot of that page then please
[02:34:11] baweaver: has joined #RubyOnRails
[02:35:15] LuisC: http://tinypic.com/r/25iolef/9
[02:35:27] chouhoulis: has joined #RubyOnRails
[02:36:16] gormandy: has joined #RubyOnRails
[02:37:54] Technodrome: has joined #RubyOnRails
[02:38:06] chagel: has joined #RubyOnRails
[02:38:43] Radar: luis_: What is this PerformanceIndicatorsController?
[02:38:47] Radar: That's new.
[02:38:50] Radar: Hello Technodrome
[02:39:06] Technodrome: how are you Radar
[02:39:07] LuisC: its like a "post"
[02:39:15] timdotrb: Radar: my constraints don’t seem to be working :/ no matter where the request comes from, I hit the root route. https://gist.github.com/willc0de4food/1c27c5748d07cc68d647
[02:39:18] Technodrome: i got my project done, working on another now
[02:39:19] Radar: luis_: No, I mean the controller itself. Gist it please.
[02:39:31] Technodrome: quite amazing what 9 hours of actual development gets you in the rails world
[02:39:51] LuisC: the structure its like: performance indicator -> improvement actions -> comments
[02:40:18] halfamind: has joined #RubyOnRails
[02:40:18] Radar: luis_: Can you gist the controller please?
[02:40:22] LuisC: https://gist.github.com/luisamaro0/6143d1841821236a91d1
[02:40:27] LuisC: yes, i updated
[02:40:34] Radar: That's the CommentsController.
[02:40:40] Radar: luis_: !gist-usage
[02:40:40] helpa: luis_: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[02:40:47] Radar: Split the two controllers out into their own files within the gist please.
[02:41:04] bronson: has joined #RubyOnRails
[02:42:55] LuisC: https://gist.github.com/luisamaro0/6143d1841821236a91d1
[02:43:08] Radar: Much better, thanks.
[02:43:09] smathy: The comments form is being used from PerformanceController and neither @comment nor @improvement_action are set in it.
[02:43:25] Radar: Yeah, that.
[02:43:56] LuisC: right know I can submit improvement actions for each performance
[02:44:27] smathy: luis_, it seems right now you can't ;)
[02:44:46] LuisC: yes thats true
[02:44:48] smathy: luis_, the fact that you gisted the CommentsController suggests to me that you don't understand.
[02:45:57] blackmesa: has joined #RubyOnRails
[02:46:07] LuisC: what i dont understand ?
[02:46:26] smathy: Thanks for confirming ;)
[02:46:41] uglybandersnatch: has joined #RubyOnRails
[02:46:49] Radar: luis_: You don't understand that the instance variable that you're calling .comments on in your form isn't available in the PerformanceController
[02:46:58] Radar: And you'll need to iniitalise it there if you want it to be set.
[02:47:42] smathy: luis_, just because you're rendering the comments/_form doesn't mean the CommentsController has anything to do with this.
[02:47:44] Oliphaunte: has joined #RubyOnRails
[02:48:59] tjbiddle: has joined #RubyOnRails
[02:49:20] LuisC: I tried to do the same as I did in submitting improvement actions
[02:49:28] smathy: luis_, a URL maps to a route, the route maps to a controller action, and that controller is (ahem) in *control* of creating the response back to the browser. The controller in control of this response is your PerformanceController. It can use whatever views it wants, but to use them it must provide the instance variables those views expect.
[02:50:16] tjbiddle: Opinion question: Designing an api - if I have GET /someobject and GET someobjec/details - Should I have the object at the root when calling details, or just show the details (And make it two separate requests)
[02:52:01] smathy: tjbiddle, I'd expect something more like /someobject?with=details to be the object including the details. /someobject/details should be just the details.
[02:52:29] LuisC: what should I put in performanceController?
[02:54:38] Radar: luis_: You'll need to setup an improvement action in that controller
[02:54:40] smathy: luis_, well, what does the comments/_form expect?
[02:55:58] LuisC: it needs the performance ID and improvement ID
[02:58:39] JoshGlzBrk: has joined #RubyOnRails
[03:00:56] Thomas-0725: has joined #RubyOnRails
[03:01:14] smathy: luis_, every instance variable needed by every view/template/partial that your controller uses to construct the response needs to be set in the controller handling the request.
[03:01:33] smathy: luis_, well, in either the controller or in the view itself.
[03:01:41] smathy: (but generally, in the controller)
[03:05:35] baweaver: has joined #RubyOnRails
[03:06:26] marcdel_: has joined #RubyOnRails
[03:08:12] adavia: has left #RubyOnRails: ()
[03:08:28] Thomas-0725: has joined #RubyOnRails
[03:08:44] adavia: has joined #RubyOnRails
[03:09:17] adavia: if i have two models posts and users and both have many images then Polymorphic association is the way to go even if the images for users has a couple more of attributes?
[03:09:28] LuisC: what should I do then ? :X
[03:10:45] tjbiddle: has joined #RubyOnRails
[03:10:53] rogue_koder: has joined #RubyOnRails
[03:11:24] jfelchner: has joined #RubyOnRails
[03:16:19] clorisu: has joined #RubyOnRails
[03:16:40] Radar: luis_: We told you the answer already?
[03:16:43] Radar: [13:54:37] <Radar> luis_: You'll need to setup an improvement action in that controller
[03:16:55] LuisC: and the comment ?
[03:17:10] uglybandersnatch: has joined #RubyOnRails
[03:17:12] Radar: Yup, one of those too.
[03:17:19] LuisC: and after that ?
[03:17:30] contradictioned: has joined #RubyOnRails
[03:18:02] Radar: It's a bit unfair to expect us to walk you through the process step by step, I think.
[03:19:08] Radar: I'd prefer it if you tried to solve it yourself and then let us know when things didn't work correctly.
[03:20:38] differentreality: has joined #RubyOnRails
[03:21:05] LuisC: so you're saying I have to set a instance variable of improvement_action and comment in performanceController ?
[03:21:36] Radar: luis_: !try
[03:21:36] helpa: luis_: Why don't you try it and find out for yourself?
[03:21:42] Radar: We aren't going to lead you by the nose.
[03:22:22] jstransky: has joined #RubyOnRails
[03:24:21] tjbiddle: has joined #RubyOnRails
[03:24:47] JoshGlzB_: has joined #RubyOnRails
[03:25:52] djbkd: has joined #RubyOnRails
[03:26:22] johnflux: has joined #RubyOnRails
[03:26:22] johnflux: has joined #RubyOnRails
[03:27:18] yfeldblum: has joined #RubyOnRails
[03:27:27] sypheren: has joined #RubyOnRails
[03:31:23] zzach: has joined #RubyOnRails
[03:31:37] LuisC: im getting this: ActiveRecord::RecordNotFound at /performance_indicators/1 Couldn't find ImprovementAction with 'id'=1
[03:31:56] Radar: Perhaps you're using the wrong ID?
[03:32:07] tjbiddle: luis_: Then the record doesn't exist :)
[03:32:16] Radar: if the request is for /performance_indicators/1, then how is the app going to know what ImprovementAction to load?
[03:32:25] Radar: luis_: Where in that URL are you telling it what ImprovementAction to load?
[03:34:38] bronson: has joined #RubyOnRails
[03:36:01] anjen: has joined #RubyOnRails
[03:36:05] chouhoulis: has joined #RubyOnRails
[03:36:28] krz: has joined #RubyOnRails
[03:37:15] LuisC: but i only get the improvement URL in edit for example
[03:39:04] differentreality: has joined #RubyOnRails
[03:39:14] chagel: has joined #RubyOnRails
[03:40:38] brendan-: has joined #RubyOnRails
[03:41:06] uglybandersnatch: has joined #RubyOnRails
[03:41:34] LuisC: I try tomorrow
[03:41:39] Radar: Ok, see you tomorrow.
[03:41:45] LuisC: just on question
[03:42:01] Radar: Tomorrow you can put your whole app on GitHub and we can poke through it rather than getting you to show us 1 file at a time?
[03:42:06] sevenseacat: lulz... just bypassed entering CC details on my stripe form by disabling javascript
[03:42:30] LuisC: what do you mean
[03:42:46] jstransky: has joined #RubyOnRails
[03:43:20] LuisC: i just asked for some help
[03:43:35] Radar: luis_: I meant exactly what I said.
[03:43:44] Radar: If you want fine-grained help, we'll need to see allll of the code.
[03:44:00] Radar: It also looks like you're trying to write Rails without having read + understood the Getting Started guide.
[03:44:02] Radar: !gettingstarted
[03:44:02] helpa: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[03:44:09] sevenseacat: luis_: what was a very simple error that should have taken a couple of minutes to fix, has been going on for a long time now
[03:44:12] Radar: Like, you are not understanding the concept of nested routes.
[03:44:44] LuisC: you asked for performanceController
[03:45:22] LuisC: i could have put more
[03:45:33] Radar: luis_: Yes, but I still don't understand how improvement_actions, performances, comments, etc. all link together. Seeing the whole application would help with that.
[03:45:43] Radar: You taking 1000 words to explain it is going to take a long time. Showing me the code is going to take a very short time.
[03:46:05] Radar: Since it's one of your very first Rails applications (I assume) then it shouldn't be a problem to share the code.
[03:46:30] LuisC: no its not a problem
[03:46:46] Radar: Ok, see you tomorrow same bat time and bat place with your code :)
[03:47:12] LuisC: i can show it now
[03:49:46] bauruine: has joined #RubyOnRails
[03:50:27] LuisC: should i put on gist or i paste my github ?
[03:50:55] LuisC: https://github.com/luisamaro0/WebProcessPAIR
[03:51:37] Radar: Ok, please read through the getting started guide and I'll see you tomorrow.
[03:52:08] LuisC: why did i paste my git ?
[03:52:31] phrozen77: has joined #RubyOnRails
[03:52:35] Radar: So I could see for certain if you had or hadn't gone through the getting started guide.
[03:53:25] LuisC: and how did you saw it
[03:53:44] Radar: I'm just that damn good.
[03:54:15] Radar: Tomorrow's homework: read getting started guide top to bottom.
[03:54:21] Radar: Then apply what you learn there to this application.
[03:55:34] LuisC: could you just see if its possible to do that way, in my routes ?
[03:56:13] Radar: luis_: Please stop asking questions. Read the Getting Started guide. Build that app.
[03:56:25] Radar: Learn how you're supposed to initialise variables in your controllers. Then come back.
[03:57:34] LuisC: bye, thanks
[04:00:48] tjbiddle: has joined #RubyOnRails
[04:01:34] clorisu: has joined #RubyOnRails
[04:04:30] sfr^: has joined #RubyOnRails
[04:04:57] icedp: has joined #RubyOnRails
[04:05:22] strass|away: has joined #RubyOnRails
[04:05:40] phrozen77: has joined #RubyOnRails
[04:05:45] bauruine: has joined #RubyOnRails
[04:07:40] marcdel: has joined #RubyOnRails
[04:09:58] braincrash: has joined #RubyOnRails
[04:10:11] configged-: has joined #RubyOnRails
[04:13:37] JoshGlzBrk: has joined #RubyOnRails
[04:16:28] blackmesa: has joined #RubyOnRails
[04:21:18] i8igmac: has joined #RubyOnRails
[04:21:28] chagel: has joined #RubyOnRails
[04:21:31] MaxHoffman: has joined #RubyOnRails
[04:22:47] Dreamer3_: has joined #RubyOnRails
[04:24:26] treaki_: has joined #RubyOnRails
[04:24:49] patrick_star: has joined #RubyOnRails
[04:28:35] Diabolik: if im validating an address form, so a city for example with a custom validation
[04:28:35] Radar: Hi Diabolik.
[04:28:37] Diabolik: how do i refer to it
[04:28:38] Diabolik: https://gist.github.com/askl56/80feb60326e326630e45
[04:28:53] Diabolik: attributes['city'] is nil even though its being filled in
[04:28:58] Diabolik: i've binding.pry'd into the spec
[04:29:04] Diabolik: hi Radar how are you doing
[04:29:24] dandaman: has joined #RubyOnRails
[04:29:27] Radar: I am currently winning at today but there's still two hours left.
[04:29:34] Diabolik: glad to hear it
[04:29:37] chouhoulis: has joined #RubyOnRails
[04:29:39] sevenseacat: plenty of time to go south.
[04:30:54] Radar: Diabolik: where is it being filled in?
[04:31:00] Diabolik: on the checkout form
[04:31:03] Radar: Diabolik: Logs for that action please.
[04:31:04] Diabolik: i can provide that to the gist
[04:32:22] Diabolik: the capybara function is added to the gist
[04:32:43] Radar: Diabolik: Logs for that action please.
[04:33:13] Radar: Diabolik: logs/test.log
[04:36:40] clorisu: has joined #RubyOnRails
[04:37:55] Diabolik: Radar added the logs from running the spec
[04:38:03] Diabolik: searching for the aciton now
[04:38:13] Radar: That's quite a lot
[04:38:15] Radar: Why as a comment?
[04:38:42] Radar: There's no checkout in those logs.
[04:38:50] Radar: You can edit your Gist.
[04:40:17] Radar: There is very close to 1,000 lines of logs there.
[04:40:32] Radar: Show me the line where the "city" parameter is arriving at a controller action, please.
[04:40:41] Radar: Because I'm not seeing it.
[04:40:47] JoshGlzBrk: has joined #RubyOnRails
[04:41:37] Radar: https://gist.github.com/askl56/80feb60326e326630e45#file-checkout-log-L64
[04:41:58] Radar: click on the line number then link me to that.
[04:42:01] bronson: has joined #RubyOnRails
[04:42:32] Diabolik: https://gist.github.com/askl56/80feb60326e326630e45#file-checkout-log-L89
[04:43:06] Radar: No, that's a preference.
[04:43:19] Radar: And an avatax_origin setting, at that.
[04:43:27] Diabolik: https://gist.github.com/askl56/80feb60326e326630e45#file-checkout-log-L434
[04:43:27] Radar: https://gist.github.com/askl56/80feb60326e326630e45#file-checkout-log-L458-L459
[04:43:39] Radar: I am looking for a line like this which has a list of params, which contains "city"
[04:43:50] Radar: 434 is a stock location.
[04:44:04] Radar: it's likely that the action in "Processing
[04:44:08] Radar: would be an "update" action.
[04:44:34] Radar: Are you hitting submit after calling fill_in_apo_address?
[04:44:46] deeprave: any activeadmin gurus about? i have a scope defined on a model and want to use that scope instead of the default when doing an csv export from activeadmin. any easy way to do that?
[04:44:58] Diabolik: I'll add the spec to the gist
[04:45:24] Radar: deeprave: Please file an issue about that on the activeadmin project.
[04:45:40] Diabolik: im then clicking continue
[04:45:49] pawnbox: has joined #RubyOnRails
[04:46:11] Radar: Diabolik: on this line https://gist.github.com/askl56/80feb60326e326630e45#file-address_spec-rb-L41 put: Rails.logger.info("Look here Radar")
[04:46:17] Radar: Then run the test again, and update checkout.log with the new logs.
[04:46:24] deeprave: thanks Radar, but dont know if it an issue at all, just assuming it is a lack in my understanding right now. I *think* it should be possible just can't see it.
[04:46:56] Radar: deeprave: The activeadmin maintainers will let you know how to do it for sure :)
[04:47:32] oliver__: has joined #RubyOnRails
[04:47:39] chouhoulis: has joined #RubyOnRails
[04:48:02] Diabolik: so its not in the logs
[04:48:13] Diabolik: the plot thickens
[04:48:15] Radar: Diabolik: Well that would indicate that it's not getting to that point.
[04:49:01] tjbiddle: has joined #RubyOnRails
[04:53:36] Diabolik: Radar i have a chicken and an egg scenario
[04:53:51] Diabolik: the reason its not reaching that point is beause of the bad syntax in the validations
[04:54:04] uglybandersnatch: has joined #RubyOnRails
[04:54:14] Radar: There's bad syntax in the validations?
[04:54:35] Diabolik: added the error
[04:54:42] Diabolik: yeah that was my initial problem
[04:54:50] Diabolik: how to refer to the city in the new custom validation
[04:55:20] Radar: You would want to check that attributes['city'] is set as well.
[04:55:26] Radar: Rather than just going straight for the .include?
[04:55:28] Diabolik: it is when i go into console
[04:55:36] Diabolik: but its being filled in?
[04:55:54] Diabolik: and i believe its a presence validation on the spree side
[04:56:09] sp1rs: has joined #RubyOnRails
[04:56:57] SteenJobs: has joined #RubyOnRails
[04:57:33] Miron: has joined #RubyOnRails
[05:01:51] tildes: has joined #RubyOnRails
[05:04:21] Radar: is it though
[05:07:29] _fortis: has joined #RubyOnRails
[05:08:20] djbkd: has joined #RubyOnRails
[05:09:24] Helheim: has joined #RubyOnRails
[05:10:50] chouhoul_: has joined #RubyOnRails
[05:12:14] greengriminal: has joined #RubyOnRails
[05:13:19] drale2k: Radar: since you are here :) What approach would you take to deliver chat messages to a chat which is using ActionCable, for missed messages? So when you have been offline and come back online. Would you do an ajax call and return a HTML partial and put it into the DOM or would you use ActionCable for that as well? Or something else?
[05:13:29] Radar: drale2k: I don't use ActionCable.
[05:13:29] matthewd: has joined #RubyOnRails
[05:13:33] gambl0re: has joined #RubyOnRails
[05:14:21] targaf: has joined #RubyOnRails
[05:14:26] sp1rs: has joined #RubyOnRails
[05:14:31] redondos: has joined #RubyOnRails
[05:14:43] sunya7a_: has joined #RubyOnRails
[05:15:05] drale2k: Radar: hm ok but you will some day i guess. So you would do it the "return html with new messages" approach and append it to the DOM
[05:15:20] Radar: drale2k: You're putting words into my mouth (or words on my fingers, I guess)
[05:15:40] Radar: Probably an AJAX call to fetch the messages.
[05:16:03] drale2k: alrighty thanks
[05:16:23] drale2k: too many ways to do stuff
[05:16:59] wldcordeiro: has joined #RubyOnRails
[05:17:16] sypheren: has joined #RubyOnRails
[05:19:02] merida_: has joined #RubyOnRails
[05:19:03] merida__: has joined #RubyOnRails
[05:21:03] duncannz: has joined #RubyOnRails
[05:21:05] dandaman: has joined #RubyOnRails
[05:22:56] Arcaire: Weird how Radar basically said the same thing as me almost four hours ago.
[05:23:06] Arcaire: Almost like there's general consensus on the best way to do things in the industry.
[05:26:15] |PiP|: has joined #RubyOnRails
[05:30:40] Trynemjoel: has joined #RubyOnRails
[05:33:37] ryanwinchester: has joined #RubyOnRails
[05:33:44] baweaver: has joined #RubyOnRails
[05:35:16] yatish27: has joined #RubyOnRails
[05:36:13] Trynemjoel: has joined #RubyOnRails
[05:42:54] ryanwinchester: what's the fastest way to get a rails dev environment up an running? vagrant?
[05:43:32] Arcaire: `rails new`
[05:44:07] yatish27: There are pre setup vagrant images for Rails
[05:44:53] htmldrum: has joined #RubyOnRails
[05:44:55] htmldrum_: has joined #RubyOnRails
[05:45:25] ryanwinchester: any recommended ones? is this considered a good start? https://gorails.com/guides/using-vagrant-for-rails-development
[05:46:29] blackmesa: has joined #RubyOnRails
[05:47:05] ryanwinchester: i'm coming from php-land where 99% of the stuff you can find on google is bad advice. being completely new to rails i don't know what is bad and what is good
[05:47:42] ryanwinchester: 99% might be bit of an exageration
[05:50:03] drale2k: ryanwinchester: on a mac?
[05:50:50] chagel: has joined #RubyOnRails
[05:52:10] drale2k: what's the thing called Yehuda Katz had a kickstarter for
[05:52:35] drale2k: Tokaido https://github.com/tokaido/tokaidoapp
[05:53:06] drale2k: last update over a year ago hm
[05:53:29] drale2k: well not over but almost a year
[05:54:59] ryanwinchester: yeah doesn't seem very active
[05:55:25] Arcaire: ryanbigg.com/2015/06/mac-os-x-ruby-ruby-install-chruby-and-you/
[05:55:28] Arcaire: do once, run forever
[05:55:43] Arcaire: I'd update Taikado but I don't have XCode here.
[05:55:49] Arcaire: Tokaido even
[05:58:18] jenrzzz: has joined #RubyOnRails
[05:58:26] ryanwinchester: Arcaire thanks. Bookmarked :)
[05:58:31] dionysus69: has joined #RubyOnRails
[06:05:03] merida: has joined #RubyOnRails
[06:05:06] merida_: has joined #RubyOnRails
[06:06:13] RegulationD: has joined #RubyOnRails
[06:06:17] chagel: has joined #RubyOnRails
[06:07:26] merida__: has joined #RubyOnRails
[06:07:27] merida___: has joined #RubyOnRails
[06:09:05] braincra-: has joined #RubyOnRails
[06:21:09] delgiudices: has joined #RubyOnRails
[06:22:01] Macaveli: has joined #RubyOnRails
[06:23:11] yogeshrt: has joined #RubyOnRails
[06:30:23] kp666: has joined #RubyOnRails
[06:32:18] njero: has joined #RubyOnRails
[06:33:38] Diabolik: Radar you still around?
[06:37:58] nibbo_: has joined #RubyOnRails
[06:38:54] Cohedrin: has joined #RubyOnRails
[06:39:11] tildes: has joined #RubyOnRails
[06:39:49] arup_r: has joined #RubyOnRails
[06:40:09] uglybandersnatch: has joined #RubyOnRails
[06:41:15] awasum: has joined #RubyOnRails
[06:46:03] bronson: has joined #RubyOnRails
[06:46:53] Bloomer: has joined #RubyOnRails
[06:48:09] krz: has joined #RubyOnRails
[06:48:58] acosonic: has joined #RubyOnRails
[06:49:13] acosonic: hi all, how do I debug rails on osx? Any best practices?
[06:49:28] chagel: has joined #RubyOnRails
[06:49:29] rodfersou: has joined #RubyOnRails
[06:49:56] kgutteridge: has joined #RubyOnRails
[06:50:09] acosonic: rails app, I’m trying to send email, by following some tutorials
[06:50:24] sevenseacat: and what problem are you having?
[06:50:48] acosonic: everything seems OK (no problem in code) but mail is not being/send/delivered…
[06:51:05] sevenseacat: do your server logs show mail being sent?
[06:51:14] acosonic: and there is nothing in /var/log/mail.log
[06:52:10] acosonic: I followed this tutorial https://sendgrid.com/docs/Integrate/Frameworks/rubyonrails.html but used my smtp server and sendmail instead of sendgrid
[06:54:11] arup_r: in development mode, rails does show the email sending log by default, and ofcourse there is a setting to switch it on or off
[06:56:49] arup_r: acosonic: nothing you are seeing in the development.log regarding mail dispatch?
[06:57:15] triptec: has joined #RubyOnRails
[06:57:22] acosonic: let me check once again
[06:57:48] htmldrum: has joined #RubyOnRails
[06:59:12] acosonic: arup_r: well it says sent mail… so I guess its my sendmail on osx then...
[06:59:47] timdotrb: has joined #RubyOnRails
[07:00:15] sevenseacat: have you tried turning on delivery failures in your config/environments/development.rb and seeing if it still errors
[07:01:07] htmldrum_: has joined #RubyOnRails
[07:01:35] acosonic: sevenseacat: no I will try that now
[07:02:39] arup_r: acosonic: config.action_mailer. raise_delivery_errors = true like that
[07:05:59] sp1rs: has joined #RubyOnRails
[07:07:36] neanderslob_: has joined #RubyOnRails
[07:08:03] neanderslob_: has joined #RubyOnRails
[07:08:57] chagel: has joined #RubyOnRails
[07:11:42] acosonic: arup_r: /Users/acosonic/rails/test1/config/environment.rb:16:in `<top (required)>': undefined local variable or method `config' for main:Ob
[07:12:01] arup_r: show development.rb file
[07:12:07] arup_r: in a gist
[07:12:21] arup_r: it should go development.rb file..
[07:12:22] acosonic: I used environment.rb
[07:12:41] arup_r: no write it in development.rb
[07:12:55] solars: has joined #RubyOnRails
[07:13:04] sevenseacat: it's already in the file, you just need to turn it on
[07:13:17] edwinvdgraaf: has joined #RubyOnRails
[07:13:57] chagel: has joined #RubyOnRails
[07:14:07] acosonic: perhaps I misconfigured Action mailer maybe I should have put there smtp server settings in development.rb
[07:14:37] acosonic: btw, is there, realistically some tool like debugger where I can run step-into ?
[07:14:48] sp1rs: has joined #RubyOnRails
[07:14:57] sevenseacat: there is, but if you cant change a boolean value in a config file, I don't think a debugger will help you
[07:15:44] acosonic: sevenseacat: I debugged C++ files while you were playing with toy trucks in sand ;)
[07:15:56] sevenseacat: good to know. have you turned delivery errors on yet?
[07:16:05] acosonic: yup, testing now
[07:16:32] blackmesa: has joined #RubyOnRails
[07:17:01] sevenseacat: fantastic. let us know what errors get raised when you try sending an email.
[07:17:31] rvanlieshout: has joined #RubyOnRails
[07:17:47] acosonic: looks like now all emails went through…
[07:17:52] acosonic: thnx for the tip!
[07:18:15] tjbiddle: has joined #RubyOnRails
[07:18:18] rvanlieshout: has joined #RubyOnRails
[07:18:33] scepticulous: has joined #RubyOnRails
[07:20:46] acosonic: I’ll test this now rails s --debugger
[07:22:09] Ropeney: ACTION misses playing with toy trucks
[07:22:30] rvanlieshout: Ropeney: what stops you from playing?
[07:22:38] Ropeney: the lack of
[07:23:58] sevenseacat: I never played with toy trucks, but it's great that stupid stereotypes get used :D
[07:25:42] chagel: has joined #RubyOnRails
[07:28:17] acosonic: sure and stupid stereotypes about n00bs that debugger won’t help them, btw, niceley documented! http://edgeguides.rubyonrails.org/debugging_rails_applications.html
[07:29:00] acosonic: if you won’t help how would I stop being n00b ;) thanks anyway! sevenseacat highly appreciated!
[07:29:47] merida: has joined #RubyOnRails
[07:31:30] comrad: has joined #RubyOnRails
[07:31:34] sevenseacat: of course, I never help anyone, let's not forget that.
[07:32:53] KnownSyntax: has joined #RubyOnRails
[07:32:55] KnownSyntax: has joined #RubyOnRails
[07:35:05] mark3: has joined #RubyOnRails
[07:35:14] chagel: has joined #RubyOnRails
[07:35:20] acosonic: sevenseacat: nah, now you won’t help me anymore I didn’t want that, sorry for toy trucks :) I’ll buy you some :)
[07:35:36] Ropeney: can i have some?
[07:36:01] |PiP|: has joined #RubyOnRails
[07:36:15] AIwork: has joined #RubyOnRails
[07:37:07] roshanavand: has joined #RubyOnRails
[07:40:33] i8igmac: has joined #RubyOnRails
[07:41:00] matthewd: has joined #RubyOnRails
[07:43:20] Pazician: has joined #RubyOnRails
[07:43:26] akshat: has joined #RubyOnRails
[07:44:28] JohnBat26: has joined #RubyOnRails
[07:48:43] yogeshrt: has joined #RubyOnRails
[07:53:16] aganov: has joined #RubyOnRails
[07:54:27] djellemah_: has joined #RubyOnRails
[07:55:00] tjbiddle_: has joined #RubyOnRails
[07:56:48] mib_mib: has joined #RubyOnRails
[07:59:21] mib_mib: hi - with devise, i want to disallow banned users from logging in - in user.rb i overrode active_for_authentication? to check if the user has a banned role - however, where does devise recommend I redirect to logout with error message?
[08:00:52] sevenseacat: err, can you clarify the question? where does it recommend it?
[08:02:13] yatish27: has joined #RubyOnRails
[08:02:46] mib_mib: https://github.com/plataformatec/devise/blob/master/lib/devise/models/authenticatable.rb#L43 - mostly i'm wondering if I should just create a before filter on application_controller to check the user status, or if there is a better way... i.e. more built in way
[08:03:05] akshat: has joined #RubyOnRails
[08:03:48] sevenseacat: yes, what you have with active_for_authentication is fine
[08:03:49] mib_mib: or override authenticate_user! method
[08:03:49] krz: has joined #RubyOnRails
[08:04:06] mib_mib: right, but it still lets banned users log in
[08:04:24] mib_mib: it lets them authenticate and log in, and then shows an error message while logged in
[08:04:32] mib_mib: i'd prefer to not even authenticate them
[08:04:39] mib_mib: instead just returning an error message
[08:04:57] sevenseacat: not if you do it correctly - you may have to show your code
[08:05:47] srinidhi: has joined #RubyOnRails
[08:06:30] sevenseacat: i repeat, you may have to show your code, because that's how its supposed to work.
[08:07:10] rogue_koder: has joined #RubyOnRails
[08:07:20] mib_mib: well it shows its false, but i still log in properly =/
[08:07:20] RegulationD: has joined #RubyOnRails
[08:07:28] kgutteridge: has joined #RubyOnRails
[08:07:30] mib_mib: but then it just shows an error message
[08:07:35] mib_mib: i.e. 'you are not authorized'
[08:08:08] sevenseacat: i won't say it a third time, if you don't want any help, that's fine.
[08:10:48] mib_mib: ah it seems to work now....odd....
[08:11:48] mib_mib: maybe a server restart was all it took....
[08:15:29] dobri: has joined #RubyOnRails
[08:17:57] darutoko: has joined #RubyOnRails
[08:20:33] gingray: has joined #RubyOnRails
[08:22:52] timdotrb: Radar: you’re not still around, are you?
[08:23:17] tvw: has joined #RubyOnRails
[08:25:59] renegadeandy: has joined #RubyOnRails
[08:27:50] clorisu: has joined #RubyOnRails
[08:28:02] Palsson: has joined #RubyOnRails
[08:32:44] startupality: has joined #RubyOnRails
[08:33:00] clorisu: has joined #RubyOnRails
[08:34:17] shinnya: has joined #RubyOnRails
[08:34:42] solars: quick question: I've got an initializer like this: https://gist.github.com/solars/14bc103df5da4d7dae7e can/should I move this into config/environments/env? if so, I think this needs config.after_initialize or so, is this right?
[08:44:18] Ropeney: has joined #RubyOnRails
[08:46:39] delgiudices: has joined #RubyOnRails
[08:46:39] delgiudices: How can i update my rails app for version 5.0
[08:47:04] blackmesa: has joined #RubyOnRails
[08:47:51] rvanlieshout: delgiudices: http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html
[08:47:52] sevenseacat: given rails 5.0 is not out yet, you don't
[08:47:56] rvanlieshout: note that 5 hasn't been released
[08:48:12] delgiudices: Well but the beta is out
[08:48:22] sevenseacat: if you have to ask, the answer is generally "don't"
[08:48:23] DoubleMalt: has joined #RubyOnRails
[08:48:40] delgiudices: I saw that post rvanlieshout but it doesn't actually cover how to do the update of the gem
[08:48:50] delgiudices: why not sevenseacat ?
[08:48:56] rvanlieshout: delgiudices: you know what beta means, right?
[08:48:57] sevenseacat: because its a beta, and things will break
[08:49:02] rvanlieshout: delgiudices: and that's no different than any other gem
[08:49:02] sevenseacat: things are unstable
[08:49:14] sevenseacat: the api is still in flux
[08:49:21] delgiudices: sevenseacat well but i'm building a new project
[08:49:25] delgiudices: So by the time i'm done with this
[08:49:27] sevenseacat: even more reason not to
[08:49:30] delgiudices: The 5.0 stable release wil be out
[08:49:40] sevenseacat: then you can upgrade, when its out.
[08:49:50] rvanlieshout: delgiudices: and what would happen if the upgrade path from the final version is different?
[08:49:53] Abhijit: has joined #RubyOnRails
[08:50:17] delgiudices: Something other than updating
[08:50:18] tvw: has joined #RubyOnRails
[08:50:28] Abhijit: due to some deletetion in hurry, sequuence of my migrations files is damaged. is there any automated way to correct it? or i have to manually execute each and every file?
[08:50:36] delgiudices: Is it worth it building Rails API + JS Client Side MVC App
[08:50:44] delgiudices: Instead of just using the power of turbolinks
[08:50:52] sevenseacat: delgiudices: depends on your use case.
[08:51:06] delgiudices: sevenseacat could you give some examples?
[08:51:15] sevenseacat: Abhijit: you got yourself into the mess, now you get to manually extricate yourself from it
[08:51:22] sevenseacat: delgiudices: uh, you were the one who asked the question
[08:51:30] sevenseacat: you give the example of what you're going to build
[08:51:49] delgiudices: well yeah i know it depends
[08:51:55] delgiudices: But kind of on what depends
[08:52:13] netzfisch: has joined #RubyOnRails
[08:55:11] ferr: has joined #RubyOnRails
[08:55:43] nerium: has joined #RubyOnRails
[08:57:30] silverdust: My jasmine spec can't find my constructors but it can find regular functions
[08:57:51] silverdust: Anyone else using jasmine for js testing in their rails app?
[08:58:10] quazimodo: has joined #RubyOnRails
[08:59:24] arup_r: has joined #RubyOnRails
[08:59:25] Abhijit: what are the files, i have to check for passwords, hashes etc before sharing the code?
[08:59:30] Abhijit: one is database.yml
[08:59:37] mhoungbo: has joined #RubyOnRails
[08:59:54] sevenseacat: Abhijit: every file, because you could have written them anywhere
[09:00:07] Abhijit: not like that.
[09:00:19] Abhijit: the standard rails settings which contain passwords/ hashes etc
[09:01:51] delgiudices: Abhijit config/secrets.yml contains some private information
[09:02:11] chagel: has joined #RubyOnRails
[09:02:50] htmldrum: has joined #RubyOnRails
[09:02:51] htmldrum_: has joined #RubyOnRails
[09:05:09] snowy: has joined #RubyOnRails
[09:07:06] marr: has joined #RubyOnRails
[09:07:39] Chagel_: has joined #RubyOnRails
[09:08:22] clorisu: has joined #RubyOnRails
[09:08:29] RegulationD: has joined #RubyOnRails
[09:11:11] mrbubbles: has joined #RubyOnRails
[09:14:48] drptbl: has joined #RubyOnRails
[09:17:25] SebastianThorn: has joined #RubyOnRails
[09:17:33] SebastianThorn: has left #RubyOnRails: ()
[09:17:39] tjbiddle_: has joined #RubyOnRails
[09:17:54] TheCubeLord: has joined #RubyOnRails
[09:18:37] nettoweb: has joined #RubyOnRails
[09:18:59] siaW: has joined #RubyOnRails
[09:21:50] n008f4g_: has joined #RubyOnRails
[09:25:48] Spami: has joined #RubyOnRails
[09:28:21] kgutteridge: has joined #RubyOnRails
[09:30:51] Ergo: has joined #RubyOnRails
[09:31:44] sp1rs: has joined #RubyOnRails
[09:32:39] roshanavand: has joined #RubyOnRails
[09:33:56] defsdoor: has joined #RubyOnRails
[09:34:14] |PiP|: has joined #RubyOnRails
[09:37:12] blackmesa: has joined #RubyOnRails
[09:40:46] arBmind: has joined #RubyOnRails
[09:41:33] jsrn: has joined #RubyOnRails
[09:47:52] chagel: has joined #RubyOnRails
[09:47:54] uglybandersnatch: has joined #RubyOnRails
[09:54:05] chagel: has joined #RubyOnRails
[09:54:23] raunicolae: has joined #RubyOnRails
[09:56:44] matthias_: has joined #RubyOnRails
[10:01:52] roshanavand: has joined #RubyOnRails
[10:03:37] htmldrum: has joined #RubyOnRails
[10:03:41] htmldrum_: has joined #RubyOnRails
[10:04:02] dgncn: has joined #RubyOnRails
[10:08:50] baweaver: has joined #RubyOnRails
[10:09:17] RegulationD: has joined #RubyOnRails
[10:15:35] chagel: has joined #RubyOnRails
[10:16:25] workmad3: has joined #RubyOnRails
[10:17:26] franzip: has joined #RubyOnRails
[10:20:25] fexilal: has joined #RubyOnRails
[10:20:27] djellemah_: has joined #RubyOnRails
[10:21:50] scepticulous: what is the best way to test a rails json api including routing. capybara seems to be a bad fit. however to test nested routes I need something higher level than a controller test.
[10:23:15] chagel: has joined #RubyOnRails
[10:24:56] universa1: scepticulous: there are route specs.
[10:25:12] kgutteridge: has joined #RubyOnRails
[10:25:45] universa1: scepticulous: request / feature specs seem ok, you don't have to use capybare for them.
[10:25:55] scepticulous: yes I know, but I was looking for something that integrates these parts. I would not have the same level of confidence just by having a controller and a route test
[10:26:36] scepticulous: universa1: hmm ok, then maybe I got confused by rspec complaining that it needs the capybara gem. I should have a look at what rspec requires
[10:27:04] universa1: error message? do you have a require "capybara" somewhere in your rails helper?
[10:27:08] tjvc: has joined #RubyOnRails
[10:28:29] configged-: has joined #RubyOnRails
[10:29:14] scepticulous: Feature specs require the Capybara (http://github.com/jnicklas/capybara) gem, version 2.2.0 or later. We recommend version 2.4.0 or later to avoid some deprecation warnings and have support for `config.expose_dsl_globally = false`
[10:29:54] universa1: scepticulous: then use request specs ;)
[10:30:06] scepticulous: universa1: I will try that. thanks
[10:30:14] universa1: http://matthewlehner.net/rails-api-testing-guidelines/
[10:31:08] arup_r: has joined #RubyOnRails
[10:31:16] scepticulous: I read the linked article about rack-test. maybe I should adhere to this advise
[10:32:15] yatish27: has joined #RubyOnRails
[10:34:29] bachmann: has joined #RubyOnRails
[10:34:51] tjvc: has joined #RubyOnRails
[10:36:20] FLeiXiuS: has joined #RubyOnRails
[10:39:02] chagel: has joined #RubyOnRails
[10:39:58] FooMunki: has joined #RubyOnRails
[10:43:46] hashtd: has joined #RubyOnRails
[10:48:18] bronson: has joined #RubyOnRails
[10:51:05] renanoronfle: has joined #RubyOnRails
[10:55:24] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[10:56:33] djellemah__: has joined #RubyOnRails
[10:58:18] franzip: has joined #RubyOnRails
[11:00:09] djellemah: has joined #RubyOnRails
[11:03:32] dgncn: has joined #RubyOnRails
[11:05:06] awasum_: has joined #RubyOnRails
[11:05:54] trinaldi: has joined #RubyOnRails
[11:08:51] awasum: has joined #RubyOnRails
[11:11:30] PedramT: has joined #RubyOnRails
[11:23:09] yogeshrt: has joined #RubyOnRails
[11:24:45] FooMunki: has joined #RubyOnRails
[11:26:18] dionysus69: has joined #RubyOnRails
[11:30:12] AimlessRAven: has joined #RubyOnRails
[11:30:58] johnflux: has joined #RubyOnRails
[11:30:59] AimlessRAven: hello all, i use gem meta-tags, i create my meta helper and when i initialize meta in view like - meta meta_product, rails tell me undefined method `meta' for #<#<Class:0x007f0110092168>:0x007f0111dcaa28>
[11:35:20] mtneug: has joined #RubyOnRails
[11:35:59] sevenseacat: how should we know, we're not psychic
[11:36:13] merida: has joined #RubyOnRails
[11:37:32] ldnunes: has joined #RubyOnRails
[11:39:37] elaptics`away: has left #RubyOnRails: ()
[11:40:04] elaptics: has joined #RubyOnRails
[11:40:57] pawnbox: has joined #RubyOnRails
[11:41:56] pwnd_nsfw`: has joined #RubyOnRails
[11:41:58] sp1rs: has joined #RubyOnRails
[11:42:20] Megamos: has joined #RubyOnRails
[11:43:09] smoitra: has joined #RubyOnRails
[11:43:47] Cohedrin: is it possible to use includes on anything other than a association?
[11:44:02] Cohedrin: for example if I had a method where I define a query, is it possible to use includes based on that?
[11:44:18] Cohedrin: Having a bad time turning my method into a relation since its a bit of a weird query
[11:45:27] Cohedrin: query in question: https://gist.github.com/Cohedrin/fc839987b11a600970ca
[11:47:15] catphish_: has joined #RubyOnRails
[11:47:43] configged-: has joined #RubyOnRails
[11:49:26] arup_r: Cohedrin: what is the actual thing you are trying to achieve?
[11:49:47] catphish_: is there any obvious reason why actionmailer would be replacing non-ascii characters in my emails with �? both the database, and the emails are utf8 encoded, but non-ascii characters don't seem to get passed through
[11:49:53] Cohedrin: arup_r trying to get all the records where the user is the sender or recipient
[11:50:03] Cohedrin: I'm almost certian I've made this too convoluted
[11:50:04] beauby: has joined #RubyOnRails
[11:50:34] arup_r: has_many trades points to which model? and in which modelyou have the declaration ?
[11:50:57] Cohedrin: has_many :trades points to the Trades model
[11:51:10] Cohedrin: I'm not sure I understand the second part of the question
[11:51:32] Cohedrin: are you asking in what model have I made the belongs to association?
[11:51:39] Cohedrin: if so thats also in the trades model
[11:51:55] arup_r: trads has_many trade?
[11:52:00] arup_r: trads has_many trades?
[11:52:15] Cohedrin: No I'm sorry
[11:52:24] Cohedrin: a user has_many trades
[11:52:32] Cohedrin: a trade belongs_to a user
[11:52:32] arup_r: can you show the 2 models involved in this assoc with relevant part?
[11:52:47] Cohedrin: They're quite large models, what would you like to see from it?
[11:52:49] arup_r: SteamTrade is a subclass of Trade model?
[11:53:11] Cohedrin: no, if you'll refresh I've removed the steam trade bit
[11:53:18] arup_r: relevant part, not the full model. But now not needed.. I'll ask when again you will confusing me :)
[11:53:25] Cohedrin: steamtrade should have never been included
[11:55:11] arup_r: Cohedrin: what is the base class name?
[11:55:45] pawnbox: has joined #RubyOnRails
[11:56:53] Cohedrin: just needed to add foreign_key: :sender_id
[11:57:02] Cohedrin: so that it wasn't looking for user_id
[11:58:45] arup_r: hmm, with that.. you can have split that into 2 has_mant
[11:59:14] PedramT: has joined #RubyOnRails
[11:59:39] arup_r: one as a F-key sender_id and other as fkey as recipient_id..
[12:00:10] Cohedrin: yeah, but this query needs to have them all included
[12:00:16] Cohedrin: I have others which do split them up
[12:01:04] arup_r: Cohedrin: current one is a good fit into scope .. not as association
[12:01:18] arup_r: in user model define a scope..
[12:01:49] Cohedrin: arup_r, Yep, I know there are other ways, however I need to be able to do an :includes on it
[12:02:02] Cohedrin: as far as I know scopes don't work with includes
[12:02:10] Cohedrin: lmk if I'm wrong though
[12:02:20] arup_r: seems you are wrong..
[12:02:32] Cohedrin: thats quite possibl
[12:02:38] arup_r: you can chain scopes with any Relation methods AFAIK
[12:03:30] arup_r: has_many is wrong, because it pulls data based on only 1 F-key, what ever you will have on the declaration..
[12:03:55] arup_r: but your trades has 2 foreign keys.. hope your are getting me
[12:04:09] roshanavand: has joined #RubyOnRails
[12:05:09] Cohedrin: yeah I see your point, I may have overlooked that because of my test data
[12:05:13] Cohedrin: I'm checking it out now
[12:05:35] htmldrum: has joined #RubyOnRails
[12:05:36] htmldrum_: has joined #RubyOnRails
[12:07:48] Cohedrin: yep, you're right about that one
[12:08:07] Cohedrin: however, I _need_ to be able to do some sort of includes on the association
[12:08:09] Cohedrin: in order for this work
[12:08:20] Cohedrin: I'm not sure how I can do that without an association
[12:09:29] Mattx: has joined #RubyOnRails
[12:09:33] Mattx: Hey guys, mornings!
[12:09:40] Mattx: I'm getting this error "TypeError: is not an Array"
[12:09:56] arup_r: Cohedrin: What you want to include there?
[12:10:00] rvanlieshout: Mattx: on what?
[12:10:02] Cohedrin: sounds like you don't have an array ;)
[12:10:03] arup_r: Mattx: gist please
[12:10:08] Mattx: sure, one sec, I'm writing :P
[12:10:17] djellemah_: has joined #RubyOnRails
[12:10:20] Cohedrin: arup_r what I need to be able to do is
[12:10:28] _Tariq: has joined #RubyOnRails
[12:10:32] Cohedrin: Users.includes(:trades).where(conditions_here)
[12:10:52] Mattx: I've tried debugging the code right where I put the .save!, and object is not valid (.valid?) but the .errors are empty
[12:10:53] Cohedrin: err User.includes(:trades)
[12:11:21] baweaver: has joined #RubyOnRails
[12:11:21] Mattx: the problem should be in the way I use a column I defined in migrations with array: true, I'm gisting now
[12:11:49] n008f4g_: has joined #RubyOnRails
[12:12:48] arup_r: Cohedrin: and where should be .. logically what? I meant what is your filtering criterion?
[12:13:02] Cohedrin: I mean it can be whatever it wants to be
[12:13:04] Cohedrin: that shouldn't matter
[12:13:14] Cohedrin: whats important is that its not hitting the database twice
[12:13:14] catphish_: has left #RubyOnRails: ("Leaving")
[12:13:32] Cohedrin: I'm loading this for ~1mil rows
[12:13:42] Cohedrin: not all at once of course
[12:13:46] snowy: has joined #RubyOnRails
[12:13:51] Cohedrin: but I don't want to be doing two queries on a table that large
[12:14:11] AimlessRAven: can someone explane me how to use gem meta-tags..
[12:14:22] AimlessRAven: in documentation .. i feel confused ..
[12:14:32] AimlessRAven: how to set title, description in my helper then initialize in view
[12:14:59] Mattx: Here it is: https://gist.github.com/2c1092ff27ce782b196e
[12:15:08] arup_r: Cohedrin: filtering criterion should be static.. not it changes everytimes.. Anyway .. UNION, JOINS and INCLUDES you have 3 options
[12:15:12] Mattx: is it the way you use arrays in your models?
[12:15:22] arup_r: that is why I asked
[12:15:33] rvanlieshout: Mattx: += won't mark something as dirty
[12:15:43] arup_r: UNION is 2 query of course
[12:15:58] rvanlieshout: although that's not really relevant it's something you'll bump in to
[12:16:12] Mattx: I forgot to put "property.tasks ||= []" on the gist, just before the line you mentioned rvanlieshout
[12:16:14] rvanlieshout: what's the value of property.tasks after that error, Mattx?
[12:16:29] rvanlieshout: Mattx: that doesn't change how rails handles attribute dirty state
[12:16:30] Mattx: > property.tasks
[12:16:30] Mattx: => ["deals"]
[12:16:47] rvanlieshout: and what's the full error trace?
[12:16:52] rvanlieshout: also include the property model code
[12:17:53] Mattx: refresh the gist, the full stack is a comment
[12:18:19] rvanlieshout: and the full model?
[12:19:25] rvanlieshout: and where is ActiveModel::Validations::ArrayValidator defined?
[12:20:44] Detch: has joined #RubyOnRails
[12:21:46] Ergo^: has joined #RubyOnRails
[12:21:47] Mattx: Added a comment
[12:22:03] Mattx: I'll remove the validates_array_values and check again
[12:22:05] roshanavand: has joined #RubyOnRails
[12:23:16] delgiudices: has joined #RubyOnRails
[12:23:23] Mattx: well, the problem is with validates_array_values, it works well if I remove that line
[12:25:45] AIwork: has left #RubyOnRails: ()
[12:25:58] Mattx: I'm using that gem because I was serializing the values with "serialize :tasks", but then I realized I could use in the migration "array: true" so values are stored in native Postgresql arrays, and I can query them
[12:25:59] blackmesa: has joined #RubyOnRails
[12:28:15] tknz: has joined #RubyOnRails
[12:28:23] bitkiller: has joined #RubyOnRails
[12:32:51] delgiudices: has joined #RubyOnRails
[12:33:27] startupality: has joined #RubyOnRails
[12:34:49] _Tariq: has joined #RubyOnRails
[12:36:18] Fernando-Basso: I do PersonMailer.send_info(some, args).deliver. How to check if the mail was at least sent?
[12:36:48] rvanlieshout: Mattx: you don't have to serialize
[12:37:12] Mattx: rvanlieshout, what's the way to go in this cases?
[12:37:28] rvanlieshout: remove the serialize?
[12:37:29] arup_r: Fernando-Basso: in your rails server log
[12:37:49] Mattx: rvanlieshout, ??? I need to save more than one value
[12:38:05] rvanlieshout: but it's a db array column
[12:38:08] rvanlieshout: it doesn't have to be serialized
[12:38:10] AimlessRAven: has joined #RubyOnRails
[12:38:24] arup_r: if you still don't see, share the development.rb file as a gist,, i'll see the settings there..
[12:38:25] Mattx: I'm not serializing anymore btw, it's not in the model anymore
[12:38:27] AimlessRAven: hi all how to se meta-tags gem meta only in specific view head.. not in all project
[12:38:36] delgiudices: Fernando-Basso http://stackoverflow.com/questions/2063438/rails-how-do-you-test-actionmailer-sent-a-specific-email-in-tests
[12:38:47] rvanlieshout: AimlessRaven: content_for
[12:38:56] delgiudices: There's also the docs for deliveries here http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
[12:39:47] arup_r: Fernando-Basso: also, I personally use http://mailcatcher.me/ to check emails in browser in dev machine
[12:40:08] Fernando-Basso: delgiudices, arup_r: Thanks. I'll check those.
[12:40:49] AimlessRAven: rvanlieshout: .. dont understand, for example i have this = display_meta_tags(product_meta_tags(@product))
[12:41:03] arup_r: why.. we are absent ? http://stackoverflow.com/research/developer-survey-2016#most-popular-technologies-per-occupation :D
[12:41:04] AimlessRAven: but when i put it in my view.. this content is appear in body, not in head
[12:41:10] Fernando-Basso: I coudln't find any directions about this in the docs about ActionMailer (or I overlooked it), which was a bit of a shock :p
[12:41:15] FooMunki: has joined #RubyOnRails
[12:41:35] rvanlieshout: AimlessRaven: read some documentation about content_for and some uses cases
[12:41:41] Mattx: rvanlieshout, I think the problem is the gem I'm using to validate the arrays. How do I validate the values in a non-serialized db array column if not like that?
[12:42:04] delgiudices: Fernando-Basso look for this string in the action mailer docs Keeps an array of all the emails sent out through the Action Mailer with delivery_method :test. Most useful for unit and functional testing.
[12:42:07] rvanlieshout: Mattx: what do you want to validate?
[12:42:15] rvanlieshout: back in a few
[12:42:19] roshanavand: has joined #RubyOnRails
[12:43:10] jottr: has joined #RubyOnRails
[12:44:12] Mattx: All elements in tasks (db array column) should be in included in ["deals", "foo", "bar"], for instance
[12:44:27] Fernando-Basso: delgiudices: I'm not sure that is useful for what I need. I want to see if email was sent (not delivered to the other end) and if not, render the form again, isntead of redirecting.
[12:44:58] SeanLazer: has joined #RubyOnRails
[12:45:01] kdough: has joined #RubyOnRails
[12:45:25] Fernando-Basso: The example in “2.1.4 Calling the Mailer” seems to blindly assume the email was sent.
[12:45:32] Fernando-Basso: Perhaps I am missing something basic, idk.
[12:45:47] Moeh: has joined #RubyOnRails
[12:47:04] Moeh: I am currently going through my code with rubocop and try to fix all the styling issues. Now rubocop suggested a guard clause for some code, could someone have a look at https://gist.github.com/Maarius/2f358dabeebf948f1c64 and tell me if the bottom part is correct as guard clause for the top part?
[12:47:19] |PiP|: has joined #RubyOnRails
[12:47:48] universa1: Moeh: why is one decision to return a boolean value, and the other to render something.
[12:47:56] Mattx: rvanlieshout, All elements in tasks (db array column) should be in included in ["deals", "foo", "bar"], for instance
[12:48:46] universa1: Moeh: more context would most likely help.
[12:48:48] halfamind: has joined #RubyOnRails
[12:48:48] Mattx: also, allow_blank true (empty array or nil I guess)
[12:49:37] Moeh: universa1: This method is used in a before_action in a controller. I guess the author would like the controller to proceed and therefore returns true (it is not my code).
[12:49:44] fmcgeough: has joined #RubyOnRails
[12:50:30] universa1: Moeh: your rewrite is wrong anyways, because you replaced render with return.
[12:50:41] universa1: Moeh: but there might be an even better alternative there.
[12:50:46] universa1: but without context...
[12:51:03] AimlessRAven: rvanlieshout: well, i use - content_for :head do and inside i put = display_meta_tags(product_meta_tags(@product))
[12:51:15] AimlessRAven: but again i see my tags in body ..
[12:51:33] Cervajz_: has joined #RubyOnRails
[12:51:40] Moeh: universa1: I added a comment. Would that code then have the same behavior as the if / else condition?
[12:52:05] universa1: Moeh: you can edit gists.
[12:52:22] universa1: Moeh: add the controller to the gist.
[12:52:42] halfamind: has joined #RubyOnRails
[12:52:42] universa1: !token.blank? => token.present?
[12:53:18] Palsson: has joined #RubyOnRails
[12:53:51] Moeh: universa1: Updated the gist
[12:54:07] JakFrist: has joined #RubyOnRails
[12:55:26] IFrank00: has joined #RubyOnRails
[12:56:03] Cervajz: has joined #RubyOnRails
[12:56:08] universa1: Moeh: https://gist.github.com/universal/4c985543c7b46158397b this should be functionally equvivalent if i'm not mistaken, your tests should check that ;)
[12:56:34] _Tariq: has joined #RubyOnRails
[12:57:08] Moeh: universa1: Thanks a lot!
[12:57:20] Ergo: has joined #RubyOnRails
[12:57:31] dandaman: has joined #RubyOnRails
[12:57:59] moeabdol2: has joined #RubyOnRails
[12:58:29] Utku__: has joined #RubyOnRails
[13:00:03] universa1: Fernando-Basso: there is a config setting to enable delivery errors
[13:00:42] universa1: Fernando-Basso: raise_delivery_errors or alike, which is false by default in dev mode
[13:01:36] AimlessRAven: i create meta helper and use meta-tags gem, how to initialize in head view the meta tags.. in gem they tell me = display_meta_tags(product_meta_tags(@product)) but this initialize in body
[13:01:45] AimlessRAven: i use - content_for :head do
[13:01:46] bricker: has joined #RubyOnRails
[13:01:55] AimlessRAven: but again i see meta in my body, not in my head
[13:02:34] merida: has joined #RubyOnRails
[13:03:51] crystal77: has joined #RubyOnRails
[13:04:49] mag42c: has joined #RubyOnRails
[13:06:04] silverdust: Is there an inflector method to singluarlize or pluralize names based on the number it receives
[13:07:18] Palsson: has joined #RubyOnRails
[13:07:53] dandaman: has joined #RubyOnRails
[13:07:59] silverdust: like (1,'puppy').stuff #=> '1 puppy', (2, 'puppy').stuff #=> '2 puppies'
[13:08:13] mja: has joined #RubyOnRails
[13:11:33] RegulationD: has joined #RubyOnRails
[13:13:50] franzip: has joined #RubyOnRails
[13:16:04] akshat: has joined #RubyOnRails
[13:16:42] delgiudices: has joined #RubyOnRails
[13:21:17] _Tariq: has joined #RubyOnRails
[13:23:41] epochwolf: silverdust: http://apidock.com/rails/ActionView/Helpers/TextHelper/pluralize
[13:24:20] Mattx: rvanlieshout, just in case, I checked and += makes .changed? return true
[13:25:04] rvanlieshout: Mattx: ah awesome
[13:25:19] silverdust: Thanks epochwolf
[13:27:07] Mattx: tasks = (tasks || []) | ["deals"] # :P
[13:27:41] Palsson: has joined #RubyOnRails
[13:29:21] delgiudices: has joined #RubyOnRails
[13:32:29] Ergo: has joined #RubyOnRails
[13:32:36] AimlessRAven: how to set meta tag in rails show view for example
[13:32:47] AimlessRAven: i want to set it only for this view, not in all application
[13:33:50] rvanlieshout: AimlessRaven: read some documentation about content_for and some uses cases
[13:34:23] AimlessRAven: rvanlieshout: yea i read some, - content_for :product do for example
[13:34:28] AimlessRAven: but again rend my meta in body
[13:34:41] rvanlieshout: then you're not using yield(:product) anywhere
[13:34:52] flashpoint9: has joined #RubyOnRails
[13:34:57] mrgreenfur: has joined #RubyOnRails
[13:36:54] AimlessRAven: rvanlieshout: i use.. i have products show view
[13:37:39] Palsson_: has joined #RubyOnRails
[13:38:00] rvanlieshout: AimlessRaven: http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html
[13:38:06] rvanlieshout: there is an exmple with a script tag
[13:39:33] stannard: has joined #RubyOnRails
[13:40:29] stannard: has joined #RubyOnRails
[13:41:00] mostlybadfly: has joined #RubyOnRails
[13:41:19] rvanlieshout: AimlessRaven: so you didn't read that before?
[13:42:05] alho: has joined #RubyOnRails
[13:42:38] AimlessRAven: i dont understand nothing
[13:42:48] rvanlieshout: that's because you don't take time to read it
[13:43:11] uysalut: has joined #RubyOnRails
[13:45:03] AimlessRAven: rvanlieshout: yea but my metas comes from meta_helper
[13:46:13] uysalut: Hi guys appreciated if you can share your recommendations to accomplish following:
[13:46:30] uysalut: I`m trying to build a personalized calender for each user showing available hours in the current week and upcoming weeks
[13:46:53] uysalut: https://www.verbling.com/teachers/gia
[13:47:04] uysalut: something similar to the calender in the link
[13:47:36] uysalut: the available hours may differ between current week and next week
[13:47:55] uysalut: Or if someone books an appointment, the available hours will be updated
[13:48:08] uysalut: any recommendations to model this?
[13:48:35] uysalut: I have User, Listing and Appointment models
[13:48:55] uysalut: and I can create an appointment with starttime and endtime
[13:49:04] JakFrist: has joined #RubyOnRails
[13:50:17] hashtd: has joined #RubyOnRails
[13:50:21] uysalut: Currently user can create a listing and book for someone else`s listing
[13:50:41] uysalut: I just need to model the available hours feature
[13:50:45] bronson: has joined #RubyOnRails
[13:53:12] rvanlieshout: you need what where?
[13:56:01] uysalut: could you take a look at the link?
[13:56:18] uysalut: I need to show available hours for each user for each upcoming week
[13:56:31] uysalut: it is a little bit complicated I guess
[13:56:41] uysalut: I searched for calender and scheduling gems
[13:56:46] agit0: has joined #RubyOnRails
[13:56:50] rvanlieshout: and you already have those hours in your db?
[13:57:10] uysalut: I can store booked appointments now
[13:57:13] artto: has joined #RubyOnRails
[13:57:18] uysalut: but not he available hours
[13:58:02] rvanlieshout: that's anything where you don't have an appointment?
[13:58:25] uysalut: user should select the available hours in a week
[13:58:37] uysalut: and then other users can book only that hours
[13:58:58] rvanlieshout: so they enter a start and and date per weekday?
[13:59:22] rvanlieshout: how else would you know what hours are available?
[13:59:36] uysalut: for example I can be available between 10 and 12 pm and 2 and 5 am
[13:59:54] rvanlieshout: and how does the system know that?
[13:59:59] chouhoulis: has joined #RubyOnRails
[14:00:09] uysalut: but it can differ between this week and next week
[14:00:15] intrigueD: has joined #RubyOnRails
[14:00:29] uysalut: I think the best way is to create Day and Slot models
[14:00:31] rvanlieshout: find a way to store that information first
[14:00:34] mwlang: has joined #RubyOnRails
[14:00:34] krz: has joined #RubyOnRails
[14:00:53] uysalut: each day has 24 slots
[14:02:42] uysalut: User many_to_many Day many_to_many Slot
[14:02:54] uysalut: this way I have to add each day to Days table
[14:03:06] uysalut: 21 March 2016 Wednesday
[14:03:12] uysalut: 22 March 2016 Thursday
[14:03:14] rvanlieshout: or create some kind of schedule
[14:03:21] rvanlieshout: that you apply to weeks or ranges
[14:04:28] siaW: has joined #RubyOnRails
[14:04:34] IFrank004: has joined #RubyOnRails
[14:06:54] gormandy: has joined #RubyOnRails
[14:07:04] leofrozenyogurt: has joined #RubyOnRails
[14:07:31] leofrozenyogurt: hey guys im looking for some architecture help, so im uploading multiple nested images with cocoon through direct to s3 upload
[14:09:11] leofrozenyogurt: and each of them has a progress bar
[14:09:41] scepticulous: what would be the most reasonable status code for a routing error? 404 was my first idea, but I think maybe there is something better, so that is it not the same as requesting a non existing resource from a valid endpoint
[14:09:51] leofrozenyogurt: but what the client wants is it to go through carrierwave in the background aka make it into a background worker, now my next logical conclusion is to use carrierwave direct but its support for nested models is not too great
[14:12:04] jottr: has joined #RubyOnRails
[14:12:10] baweaver: has joined #RubyOnRails
[14:14:26] rvanlieshout: leofrozenyogurt: carrierwave doesn't have to support nested models
[14:14:29] rvanlieshout: it's just an attribute
[14:15:05] uysalut: has joined #RubyOnRails
[14:22:45] arup_r: has joined #RubyOnRails
[14:23:26] RedCoder: has joined #RubyOnRails
[14:23:27] flashpoint9: has joined #RubyOnRails
[14:23:50] Cervajz_: has joined #RubyOnRails
[14:24:26] RedCoder: has left #RubyOnRails: ()
[14:24:51] Ropeney: has joined #RubyOnRails
[14:25:22] banister: has joined #RubyOnRails
[14:26:11] Ropeney: anyone know if quote_value does any sql escaping when in a sql query string?
[14:28:05] rvanlieshout: what is quote_value?
[14:28:35] Ropeney: ActiveRecord::Base.connection.execute("SELECT * FROM Person WHERE name = #{quote_value(params[:q])")
[14:28:44] Ropeney: rvanlieshout: http://apidock.com/rails/ActiveRecord/Base/quote_value
[14:28:50] rvanlieshout: why would you want to do that?
[14:28:59] rvanlieshout: but don't write raw sql
[14:29:00] Darmani_: has joined #RubyOnRails
[14:30:27] Ropeney: Writing raw sql is fine in some cases, im just wondering if quote_value does escaping. I've noticed this code somewhere.
[14:31:23] rvanlieshout: agreed, but then at least use the proper helpers
[14:31:30] rvanlieshout: that sanitize a condition array
[14:31:37] Ropeney: yes, you are correct
[14:31:41] Ropeney: but i didnt write this code :)
[14:31:59] Ropeney: so I was wondering if quote_value did something I didn't know of
[14:32:16] RegulationD: has joined #RubyOnRails
[14:32:36] rvanlieshout: i never heard of that one
[14:33:04] Ropeney: so your not sure if it does?
[14:33:26] rvanlieshout: raise method(:quote_value).source_location.inspect
[14:33:40] bricker: has joined #RubyOnRails
[14:34:09] Ropeney: alias_method :quote_value, :sanitize
[14:34:11] Ropeney: so it might do it
[14:34:28] mfaeh: has joined #RubyOnRails
[14:38:15] chipotle: has joined #RubyOnRails
[14:39:59] Ropeney: good michael_mbp, how goes you?
[14:40:01] mdel: has joined #RubyOnRails
[14:40:45] michael_mbp: could be better. Not had any Rails work in 3-months.
[14:41:26] michael_mbp: on the plus side, things can only improve LOL!
[14:41:27] jimbo: has joined #RubyOnRails
[14:42:46] LuisC: has joined #RubyOnRails
[14:43:34] Ropeney: stay optimistic! :D
[14:44:45] Darmani_: Optimism is the key when it comes to computer programming.
[14:44:58] Darmani_: Otherwise you fall into a deep depression q.q
[14:45:00] chouhoulis: has joined #RubyOnRails
[14:46:28] diegoviola: has joined #RubyOnRails
[14:47:53] |PiP|: has joined #RubyOnRails
[14:47:57] arup_r: hey hey.....
[14:48:25] bamorim: has joined #RubyOnRails
[14:50:18] ql6wlld: has joined #RubyOnRails
[14:56:33] uris: has joined #RubyOnRails
[14:56:37] Cervajz: has joined #RubyOnRails
[14:56:45] bricker: has joined #RubyOnRails
[14:57:04] fexilal: has joined #RubyOnRails
[14:59:17] delgiudices: has joined #RubyOnRails
[14:59:22] LuisC: has joined #RubyOnRails
[14:59:30] yatish27: has joined #RubyOnRails
[15:02:12] Palsson: has joined #RubyOnRails
[15:02:26] LuisC: how do I get the ID of a partial inside other partial ?
[15:02:45] tbuehlmann: what's the id of a partial?
[15:03:10] LuisC: id from the url
[15:04:03] jottr: has joined #RubyOnRails
[15:04:21] lessless: has joined #RubyOnRails
[15:06:01] drbayer: has joined #RubyOnRails
[15:06:14] dn5: has joined #RubyOnRails
[15:06:39] dn5: is this appropriate channel to ask about deploying rails app to vps?
[15:08:30] aaronr: has joined #RubyOnRails
[15:10:10] cgfbee: has joined #RubyOnRails
[15:10:12] cfloare: has joined #RubyOnRails
[15:11:00] Tref: has joined #RubyOnRails
[15:11:53] kies: has joined #RubyOnRails
[15:13:22] dn5: anyway, I deployed my app and it works fine over apache/passenger in development mode, yet when I set RailsEnv to production, the vps is dead
[15:16:59] uglybandersnatch: has joined #RubyOnRails
[15:19:14] adavia: has joined #RubyOnRails
[15:20:16] tomatoes: has joined #RubyOnRails
[15:21:32] polishdub: has joined #RubyOnRails
[15:27:48] darkxploit: has joined #RubyOnRails
[15:27:54] jayp: has joined #RubyOnRails
[15:30:46] mikecmpbll: has joined #RubyOnRails
[15:31:35] yellow5: has joined #RubyOnRails
[15:31:38] tbuehlmann: luis_: um, `params[:id]`? and of course you have access to instance variables "from above"
[15:31:55] mikecmpbll: does anyone know how I can get the session id in my log tags? there's a couple of stackoverflow posts but neither work for me in 4.1
[15:32:02] tbuehlmann: I personally wouldn't use instance variables directly in partials, but local variables/helper methods instead
[15:32:24] mikecmpbll: i appear to have a rails request object passed to the lambda in log tags, but i'm struggling to work out how to get from that to particular session values.
[15:33:12] mikecmpbll: i use the cookie store for sessions btw
[15:36:04] disgrntld: has joined #RubyOnRails
[15:37:00] workmad3: mikecmpbll: whereabouts in the stack are you inserting your tagging middleware?
[15:37:01] mikecmpbll: AFEHAFEACUhåafea
[15:37:50] mikecmpbll: one mo, think i messed up my testing.
[15:40:07] smathy: has joined #RubyOnRails
[15:40:48] mikecmpbll: r.cookie_jar.signed[Rails.application.config.session_options[:key]] is nil :/
[15:41:12] mikecmpbll: config.log_tags = [lambda{ |r| puts r.cookie_jar.signed[Rails.application.config.session_options[:key]].inspect }]
[15:41:24] sp1rs: has joined #RubyOnRails
[15:41:52] Megamos: has joined #RubyOnRails
[15:43:09] Lingo: has joined #RubyOnRails
[15:44:23] dionysus69: has joined #RubyOnRails
[15:45:45] vernaz: has joined #RubyOnRails
[15:45:47] bronson: has joined #RubyOnRails
[15:46:08] rogue_koder: has joined #RubyOnRails
[15:49:55] ss_much: has joined #RubyOnRails
[15:51:26] [Butch]: has joined #RubyOnRails
[15:52:38] smathy: has joined #RubyOnRails
[15:53:19] codelahoma: has joined #RubyOnRails
[15:53:22] PedramT: has joined #RubyOnRails
[15:56:03] sp1rs: has joined #RubyOnRails
[15:56:34] helpa: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[16:00:02] ktchup: has joined #RubyOnRails
[16:00:03] netzfisch: has joined #RubyOnRails
[16:01:24] franzip: has joined #RubyOnRails
[16:02:44] pwnd_nsfw`: has left #RubyOnRails: ()
[16:02:56] pwnd_nsfw: has joined #RubyOnRails
[16:02:58] pwnd_nsfw: So, I want to support two different types of users with devise... These two types of users don't really share anything in common, so I'm ruling out having one model that supports both types of users... However, everything that devise/pundit are built on are totally useless in a sense
[16:03:33] pwnd_nsfw: or that I have to write a lot of duplicate code for things such as signing in and out, managing the sessions
[16:03:51] pwnd_nsfw: It just doesn't feel right having them share a model..
[16:03:58] nettoweb: has joined #RubyOnRails
[16:04:24] pwnd_nsfw: Assume I haven't written any code and am just trying to grasp the ideas
[16:04:57] jottr: has joined #RubyOnRails
[16:08:52] timdotrb: has joined #RubyOnRails
[16:10:16] rattatmatt: has joined #RubyOnRails
[16:11:10] Maletor: has joined #RubyOnRails
[16:13:03] Maletor: has joined #RubyOnRails
[16:14:35] smathy: pwnd_nsfw, have a User model which does just the authentication, then the other non-auth stuff goes into other associated models.
[16:14:38] baweaver: has joined #RubyOnRails
[16:14:41] tjohnson: has joined #RubyOnRails
[16:15:17] pwnd_nsfw: smathy, it felt slightly cluttered having this super model
[16:15:26] pwnd_nsfw: but if that's a reasonable way, I'm down
[16:15:31] tubbo: "super model"?
[16:15:41] pwnd_nsfw: yano, like... "To the rescue!"
[16:16:01] pwnd_nsfw: I mean like... the functionality for a regular user could still exist for the other type of user
[16:16:03] russt: has joined #RubyOnRails
[16:16:14] pwnd_nsfw: since they're sharing the same model 'n all
[16:16:29] tfitts: has joined #RubyOnRails
[16:16:50] Maletor: has joined #RubyOnRails
[16:16:57] fexilal: can I anti-rant in here?
[16:17:17] pwnd_nsfw: Is it on the topic of RoR?
[16:17:29] pwnd_nsfw: I'm no professional, but yeah probably
[16:17:37] smathy: pwnd_nsfw, not sure what "cluttered" really means, more models/classes == cluttered?
[16:18:04] pwnd_nsfw: Cluttered as not having the functionality clearly separated
[16:18:09] smathy: pwnd_nsfw, see, to me, stuffing multiple things into a single model with a bunch of fields that are always null == cluttered.
[16:18:39] pwnd_nsfw: Yeah, I feel you on that, that's why I thought having the two different models was a good idea
[16:18:44] pwnd_nsfw: But still feels so dirty
[16:18:49] smathy: pwnd_nsfw, oh right "this super model" was the thing you already had, not the thing I'm proposing.
[16:18:59] pwnd_nsfw: And just about all of the auth code is duplicate
[16:19:03] AzaToth: has joined #RubyOnRails
[16:19:10] pwnd_nsfw: I have two models though...
[16:19:10] smathy: pwnd_nsfw, right, yeah, abstract the auth out into the user.
[16:19:31] pwnd_nsfw: you're not referring to STI are you?
[16:19:51] smathy: pwnd_nsfw, yeah, but it sounds like BOTH of those models includes two different things. "Other stuff" specific to your use case PLUS the auth stuff.
[16:19:52] tubbo: fexilal: what is an "anti-rant"? ranting against ranting?
[16:20:03] fexilal: Damn, Ruby on Rails is a-m-a-z-i-n-g and fun! I alwways used LAMP to 'just build it' but damn I wish I took a deeper look into RoR sooner.
[16:20:07] fexilal: everything is so beautiful
[16:20:12] tfitts: it's called praise
[16:20:13] smathy: You should have THREE models, the auth stuff in one, then two other models with the specific stuff for each of your two different types of "users".
[16:20:19] smathy: pwnd_nsfw, no, I hate STI.
[16:20:20] merida: has joined #RubyOnRails
[16:20:21] merida_: has joined #RubyOnRails
[16:20:25] Technodrome: has joined #RubyOnRails
[16:20:27] pwnd_nsfw: I hate STI too
[16:20:34] pwnd_nsfw: and I think it still borks devise
[16:20:36] tubbo: STI is useless if you make use of proper data design
[16:20:46] fexilal: tfitts : you're right, sorry about the spaghetti-english
[16:20:59] pwnd_nsfw: fexilal, I said the same thing when I moved from PHP to rails
[16:21:12] pwnd_nsfw: Like, shit, I wish I had found ruby in general much earlier
[16:21:36] pwnd_nsfw: smathy, do you have any "literature" on this idea?
[16:21:41] Macaveli: has joined #RubyOnRails
[16:22:07] tfitts: fexilal: I wrote all our stuff on PHP for almost 9 years before switcht to ruby/rails. Was so happy the day I got rid of the last of my php code.
[16:22:27] smathy: pwnd_nsfw, like I'm writing this school thing right now. I have a User model with all the auth stuff (email, password_hash, last_logged_in_at, unlock_token, etc.) and then I have other models which are all 1:1 with User: SchoolStaff, Staff, Student. Those models have the various things distinct to those types of users. All have their own tables.
[16:22:44] fexilal: even the literature is great. Focuses on a lot of practical things like testing, design, best-practices, etc.
[16:22:52] adavia: if i have two models posts and users and both have many images then Polymorphic association is the way to go even if the images for users has a couple more of attributes?
[16:22:58] fexilal: yeah, I wish I could go back to 2006
[16:23:05] smathy: pwnd_nsfw, the literature on this idea is any and all literature in the world on OOP. You should ALWAYS have a separation of concerns, every text ever written on OO supports this.
[16:23:20] pwnd_nsfw: Haha, of course
[16:23:47] pwnd_nsfw: I was just unsure how to make these things work in the context of the tools I had available
[16:24:36] pwnd_nsfw: smathy, http://stackoverflow.com/questions/14647681/use-separate-authentication-model-with-devise-on-rails
[16:24:43] pwnd_nsfw: Something like the first answer on this?
[16:24:57] smathy: pwnd_nsfw, there's just a conceptual disease that has infected communities like the Rails community who have little/no formal training and who work in a DB -> (ORM) -> Class direction, so for reasons I don't really understand they resist making new tables/classes.
[16:24:59] Macaveli: has joined #RubyOnRails
[16:25:00] tubbo: as well as relational database theory, they somewhat go hand-in-hand
[16:25:24] tubbo: (but not all the time)
[16:25:50] smathy: pwnd_nsfw, sure, that mirrors the principle. It's a principle far larger than auth/devise though.
[16:26:00] pwnd_nsfw: I understand
[16:26:54] pwnd_nsfw: I'm not afraid to make more classes, or utilize OOP for what it's worth. ;) Surely I'm not a professional, and still have a ton to learn. I appreciate your help
[16:27:34] smathy: pwnd_nsfw, yes, tubbo is also right, most DBAs cringe at the DBs that Rails devs create because the concepts are not well abstracted/separated/constrained.
[16:28:33] cabinB: has joined #RubyOnRails
[16:28:36] pwnd_nsfw: Understood, I will start studying on my off time.
[16:28:45] smoitra: has joined #RubyOnRails
[16:28:57] pwnd_nsfw: I have a lot of refactoring to do now ;)
[16:29:16] tubbo: hence why some people moved to mongo
[16:29:26] duderono_: has joined #RubyOnRails
[16:29:29] tubbo: i will say that's one thing i like about mongo
[16:29:32] pwnd_nsfw: because you don't need to understand relational db concepts? :P
[16:30:04] smathy: pwnd_nsfw, most new programmers make the same mistake, they think that the only reason to make a new method/class/container-of-any-sort is when the functionality it encapsulates is being used more than once. If some code is being used just once they just leave it inline. They do the same with database tables and model classes. It's so rare to see 1:1 associations in a Rails app, and ironically the whole ORM model makes things like joins so
[16:30:04] smathy: simple that it's never been easier to separate concerns into separate tables/classes.
[16:30:06] tubbo: because relational data concepts don't matter. what matters more is the structure of your program. it's just a persistence layer for the object model of your application.
[16:30:40] tubbo: the problem with mongo is that, unlike a relational database like postgres, it has a lot of stuff "missing"...for example protecting future data integrity
[16:31:16] pwnd_nsfw: I'm just glad I recognized it to be a problem from the beginning
[16:31:30] smathy: tubbo, also, a lot of people who move from an RDBMS to a doc store just map their same relational silos over into the doc store, entirely missing the point.
[16:31:37] mrgreenfur: has joined #RubyOnRails
[16:31:45] smathy: pwnd_nsfw, yep, you're ahead of most :)
[16:31:56] workmad3: tubbo: I quite like using postgres JSON fields for hybrid setups, which I find to be more common (I have a bunch of stuff where relational structures make sense, and then a chunk of stuff that hangs off bits of that where I don't need the structure)
[16:32:01] blackmesa: has joined #RubyOnRails
[16:32:53] tubbo: workmad3: see we have quite the opposite going on. it makes more sense to use the doc-oriented approach so we can support things like nested embeds, which AR + postgres can't do.
[16:33:09] rubyonrailed: has joined #RubyOnRails
[16:33:27] tubbo: i like JSONB/JSON in postgres, but i kinda wish there was a mongoid-ish extension to AR that supported defining other models as embedded objects
[16:33:29] pwnd_nsfw: I'm also hesitant to change how I had my current authentication strat because I had told the project manager "oh, I'd rather do it this way because it's easier" huh
[16:33:45] tubbo: plus, the way ruby works it's harder to nest classes in classes. our order item model is called Order::Item, rather than OrderItem. it makes things a lot easier to browse.
[16:34:23] rubyonrailed: Does anyone know why i'm getting this no route matches error? https://gist.github.com/JasonMannon/a4c86c51300c9f262518
[16:34:26] jhn: has joined #RubyOnRails
[16:34:26] workmad3: tubbo: how is it 'harder to nest classes in classes'?
[16:35:01] smathy: tubbo, yeah, you need to use Ruby's serialization (into a non-JSON field) in order to get embedded classes/objects.
[16:35:04] workmad3: tubbo: or is that meant to target rails/AR rather than ruby? :)
[16:35:06] pwnd_nsfw: rubyonrailed, channel_id should just be id
[16:35:31] sneakerhax: has joined #RubyOnRails
[16:35:43] rubyonrailed: pwnd_nsfw: I believe you're correct. Thanks
[16:35:45] pwnd_nsfw: If you look at the route it's ":id" and not ":channel_id"
[16:36:24] tubbo: workmad3: https://gist.github.com/tubbo/e9448213fe673938cc28
[16:36:26] pwnd_nsfw: I wonder if I can still keep my two login forms so project manager would have no idea ;)
[16:36:50] vernaz: has joined #RubyOnRails
[16:36:52] Moeh: Hey guys, I am using the paranoia gem to implement soft deletion of entities (https://github.com/rubysherpas/paranoia). In a callback I would now like to set deleted_by_user_id to the @current_user that is set by the application controller. Is there any way to access this @current_user in the model?
[16:37:23] tubbo: workmad3: it was more targeting ruby...but i suppose AR is an accomplice. it's that i have to consistently define the subclass of my class whenever i write `class` in Ruby. so i have to type more.
[16:37:30] workmad3: tubbo: `class Order::Item::PriceCalculator` works fine without redeclaring the inheritance of each container
[16:38:03] workmad3: tubbo: in either setup
[16:38:13] Spungey: has joined #RubyOnRails
[16:38:34] alyosha: has joined #RubyOnRails
[16:38:39] tubbo: workmad3: that still requires more typing if you want to reference Order::Item, which is typically the case if it's a class nested within anothe
[16:38:43] arup_r: has joined #RubyOnRails
[16:38:44] tubbo: at least, in our system.
[16:39:10] tubbo: i'm not saying it's a reason to choose 1 tech over the other, believe me...i'm still using PG for all my own endeavors...but i can see why it would be considered a +1.
[16:39:34] alyosha: topic says 4.2.5 is latest version, but 4.2.6 is latest version
[16:39:36] tubbo: frankly there's nothing about ActiveRecord::Base that requires it to be a class. it could just as easily be defined as a module..
[16:39:40] smathy: Moeh, soft delete and audit tracking are two separate things. Probably take a look at: https://github.com/collectiveidea/audited#current-user-tracking
[16:39:44] workmad3: tubbo: I guess... it's more of a criticism of nesting inside classes that inherit from something other than Object though (which I can appreciate), as both examples are ruby ;)
[16:40:15] sypheren: has joined #RubyOnRails
[16:41:11] workmad3: tubbo: so I guess what I was wondering about is how you were putting criticism on ruby in general when contrasting 2 purely ruby approaches to nesting classes inside classes :)
[16:41:31] Spungey: has left #RubyOnRails: ()
[16:41:43] tubbo: thanks for the heads-up alyosha
[16:42:23] PedramT: has joined #RubyOnRails
[16:43:01] Moeh: smathy: Thanks, will check it out!
[16:43:16] workmad3: tubbo: still, it sounds like you've at least thought about the tradeoffs at multiple levels... which is more than a lot of teams did when they cargo-culted their way over to Mongo :)
[16:43:20] tubbo: workmad3: it's a criticism of how ruby's syntax works, in which you can't abbreviate that.
[16:43:38] tubbo: workmad3: i didn't think about any of this, i joined a team who used mongo and am observing its pros and cons
[16:44:18] pwnd_nsfw: smathy, so when registering, you'd use boolean or symbol to specify which type of "user" this model is inside of the user table, correct?
[16:45:07] jottr: has joined #RubyOnRails
[16:45:46] smathy: Moeh, btw, to answer your question, no - you can't access current_user from a model, you have to pass it in or set it some other way like audited does by using Thread.current
[16:46:27] Moeh: Okay, good to know!
[16:47:09] Spungey__: has joined #RubyOnRails
[16:47:57] bronson: has joined #RubyOnRails
[16:48:27] smathy: pwnd_nsfw, I tend to find either there are very different registration processes for the different types of users, and so I put them in totally different forms with the User model nested within the other model, but even if that wasn't the case I'd still have separate forms or workflows for different types of users.
[16:48:56] unreal: has joined #RubyOnRails
[16:48:59] Spungey420: has joined #RubyOnRails
[16:49:14] mikecmpbll: alright, accessed the session by moving the session middleware up the stack before the logger stuff, seems to work.
[16:49:19] unl0ckd: has joined #RubyOnRails
[16:49:27] mfaeh: has joined #RubyOnRails
[16:49:36] mikecmpbll: is there a something i can access on the session that is consistent throughout the session, but unique to that session?
[16:49:47] mikecmpbll: the session id itself changes on each request
[16:50:43] smathy: pwnd_nsfw, and no, there'd definitely not be any boolean or type field in my `users` table, I generally use a polymorphic association, so for me a User generally `belongs_to :account, polymorphic: true`
[16:52:07] pwnd_nsfw: Account being the bit that handles the authentication?
[16:53:00] mikecmpbll: nvm the session id stays the same. been one of those days ...
[16:53:33] workmad3: mikecmpbll: you were getting a new session ID in tests because you weren't sending the session cookie on the 'next' request? :)
[16:53:49] Spungey420: hi. does anyone know why rspec gives no output in bash terminal, but it does in the rubymine terminal ?
[16:56:01] Mattx: has joined #RubyOnRails
[16:56:06] RegulationD: has joined #RubyOnRails
[16:56:07] Mattx: Hey there, any channel for AR?
[16:56:45] TheNet: has joined #RubyOnRails
[16:57:24] mikecmpbll: workmad3 : idk :( working now anyways
[16:57:32] pwnd_nsfw: smathy, https://gist.github.com/SirUncleCid/447db9e50e1da2121a50 Does that look about right?
[16:58:24] Mattx: I'm using ActiveRecord standalone, and I'm getting "FATAL: sorry, too many clients already". The tools launches many threads for a few seconds, but not more than 10 in any given moment. I think AR is not reusing connections
[16:58:42] RegulationD: has joined #RubyOnRails
[17:02:09] sleungcy: has joined #RubyOnRails
[17:03:54] smathy: Mattx, it's part of Rails, so this is the place.
[17:04:09] adavia: if i have two models posts and users and both have many images then Polymorphic association is the way to go even if the images for users has a couple more of attributes?
[17:04:10] smathy: Mattx, are you using a connection pool?
[17:04:31] smathy: pwnd_nsfw, yes.
[17:04:37] Mattx: smathy, I've set a pool size of 50 or so in config.yml, but other than that, no
[17:04:48] pwnd_nsfw: Thanks smathy. This idea is great. Much appreciated
[17:05:16] WhatTheRails: has joined #RubyOnRails
[17:05:29] pwnd_nsfw: smathy, how's tb by the way? I haven't heard much about it lately
[17:05:36] adavia: or maybe STI
[17:06:33] Jasaka: has joined #RubyOnRails
[17:06:36] WhatTheRails: Does it make sense using accepts_nested_attributes_for if i have this in my "User" model? has_one :partner, class_name: 'User', foreign_key: :partner_id
[17:06:48] Mattx: smathy, pgsql is configured to support up to 100 connections, so 50 in the pool should be fine
[17:07:01] flashpoint9: has joined #RubyOnRails
[17:07:04] chrisja: has joined #RubyOnRails
[17:07:46] manfrin: has joined #RubyOnRails
[17:07:50] choke: has joined #RubyOnRails
[17:07:54] smathy: Mattx, so you're just calling establish_connection directly in each thread?
[17:09:00] Mattx: nope, I'm only calling establish_connection once in the main program
[17:09:11] smathy: Mattx, and then... ?
[17:09:45] Mattx: and then I'm launching those threads, assuming the connection is setup
[17:09:50] smathy: Mattx, actually, let me cut these 20 questions short. This is what you should be using: http://devdocs.io/rails/activerecord/connectionadapters/connectionpool
[17:09:54] Mattx: and it works for a while until I get that error I showed
[17:10:06] Mattx: I'll take a look, thanks
[17:11:44] bronson: has joined #RubyOnRails
[17:13:07] sp1rs: has joined #RubyOnRails
[17:13:08] Mattx: smathy, what I'm not getting is why AR is not reusing connections, I only estalished one. what is it doing?
[17:14:54] arup_r: has joined #RubyOnRails
[17:15:33] mikecmpbll: github borked?
[17:17:36] chipotle: has joined #RubyOnRails
[17:18:31] bronson: has joined #RubyOnRails
[17:18:58] WhatTheRails: Does it make sense using accepts_nested_attributes_for if i have this in my "User" model? has_one :partner, class_name: 'User', foreign_key: :partner_id
[17:18:58] Spungey420: how come i see more full stack rails jobs than back-end rails jobs ? is it generally expected people also are competent front end developers also ?
[17:19:35] Sigma00: Spungey420: small companies usually prefer jack of all trades
[17:19:56] startupality: has joined #RubyOnRails
[17:20:01] mikecmpbll: WhatTheRails : if you want to create/edit an object from the form of an associated object, sure
[17:20:32] WhatTheRails: I was wondering because the model is self referenced
[17:20:44] mikecmpbll: WhatTheRails : won't matter :)
[17:20:46] alethea: has joined #RubyOnRails
[17:21:10] Ergo: has joined #RubyOnRails
[17:22:09] nozpheratu: has joined #RubyOnRails
[17:22:27] agit0: has joined #RubyOnRails
[17:23:48] smathy: Mattx, each thread will create its own socket on the first `accept` call on the DB connection object.
[17:24:35] smathy: Mattx, the DB limit of 100 is on sockets, described as "clients" in the error you're receiving.
[17:24:46] Mattx: got it, thanks
[17:25:35] todd1: has joined #RubyOnRails
[17:27:07] smathy: Mattx, threads can't (easily) share the same socket, and even if they could you wouldn't want your threads to be blocked on that single socket.
[17:27:33] djbkd: has joined #RubyOnRails
[17:28:48] openstruct: has joined #RubyOnRails
[17:29:03] baweaver: has joined #RubyOnRails
[17:33:15] djbkd: has joined #RubyOnRails
[17:33:19] arup_r: has joined #RubyOnRails
[17:33:28] Quintasan: Anyone using devise_token_auth with normal devise? I can't get this to send emails without my interference. When I register an account the logs say that email has been sent but nothing reaches my inbox. I'm using mailgun and it definitely works if I do it manually (think User.last.send_confirmation_instructions).
[17:35:18] MaxHoffman: has joined #RubyOnRails
[17:35:27] cpruitt: has joined #RubyOnRails
[17:37:17] startupality: has joined #RubyOnRails
[17:38:29] cpruitt: Normally I’m not too bad with planning out my models / database structure but this one has be a little “concerned”. I’ve got a customer that needs to store MLS information. The MLS docs outline 546 different data attributes for a property. That just sounds like bad news if it’s all in one table. Anyone have thoughts on how to work with that many attributes, especially given that any of them could end up being searchable? Do I br
[17:38:30] cpruitt: them up into a much of `has_one` relationships and do joins or …. ?
[17:39:01] drbayer: has joined #RubyOnRails
[17:39:27] yellow5: has joined #RubyOnRails
[17:39:40] baweaver: has joined #RubyOnRails
[17:39:55] todd1: has left #RubyOnRails: ()
[17:40:08] n008f4g_: has joined #RubyOnRails
[17:40:09] arup_r: cpruitt: yes.. but it is good to see them and make decision... :)
[17:40:14] uris: has joined #RubyOnRails
[17:40:45] arup_r: first break them into models.. and then find the relationships between them
[17:41:24] adavia: is it bad to have a polymorphic association with a couple different attributes for two of my models?
[17:41:32] tildes: has joined #RubyOnRails
[17:42:08] arup_r: adavia: you means you have 2 sets _type and _id fields ?
[17:43:03] Devalo: has joined #RubyOnRails
[17:43:18] norc_: has joined #RubyOnRails
[17:43:19] cpruitt: arup_r: I’m not sure I follow the “then find the relationships” It’s technically all one model. Property.has_one :extra_attributes, Property.has_one :extra_extra_attributes, Property.has_one :even_more_extra_attributes. Any additional models would just be single records linked back to the primary property ID.
[17:43:20] djbkd: has joined #RubyOnRails
[17:43:53] adavia: arup_r: no, i mean that i can have an image model with 2 different attributes more used by users and not by posts
[17:44:04] cpruitt: arup_r: In other words, there aren’t any compled relationships here or data shared between different models. It’s a totally flat graph.
[17:44:14] arup_r: adavia: then it is fine, I think
[17:44:22] matthias_: has joined #RubyOnRails
[17:44:35] tomatoes: has joined #RubyOnRails
[17:44:36] adavia: STI would be another approach i guess
[17:45:01] arup_r: No. not in your case ..
[17:45:28] arup_r: hmm.. or yeah.. can be make sense, yes adavia :)
[17:45:41] arup_r: UserImage and PostImage ..like that
[17:45:48] arup_r: with STI ..
[17:47:16] arup_r: wait for some experts advises.. :D adavia .. Not much aware of the better approach between them.. I'd do polymorphism ..
[17:48:31] cpruitt: adavia: All your really saying is that two of your attributes for an image are unused in a certain context. That’s not a problem.
[17:48:32] adavia: i believe so
[17:48:34] arup_r: cpruitt: hm.. need to see them.. if you can group fields logically into a separte entity,.. then you may make them each as a model.
[17:48:42] adavia: cpruitt: yes
[17:49:00] startupality: has joined #RubyOnRails
[17:49:28] cpruitt: That’s like saying that you have a “product” model with a “downlaodable_file” atribute. That attribute isn’t used for a shippable product. No problem there.
[17:49:41] delgiudices: has joined #RubyOnRails
[17:50:31] adavia: cpruitt: anyways not this case but if you would have more than maybe 5 attributes then creating different tables would be the right thing
[17:50:39] cpruitt: Just add whatever attributes you need to associate with a “complete” image and if some context ignores them, don’t sweat it. (Disclaimer: I’m assuming you’re intelligently designing your models as a whole. I’m not saying “dump everything in one table just because you can”)
[17:51:04] jkahn: has joined #RubyOnRails
[17:51:25] arup_r: ^ good advise
[17:52:16] kies: has joined #RubyOnRails
[17:53:01] cpruitt: adavia: There’s no hard & fast rule. Your job is to decide what makes “an image” vs what makes “a post graphic” or “an avitar”. If you have a lot of similar attributes them maybe they’re the same thing. If you have a lot of different attributes, maybe they’re not. People and Pets share a lot of the same charisterics (hair color, name, age) but that doesn’t mean you should go forcing polymorphism or STI. It just means th
[17:53:02] cpruitt: models have a few things in common.
[17:53:39] startupality: has joined #RubyOnRails
[17:53:51] Quintasan: What the hell is wrong with this shit, how on Earth does User.last.send_confirmation_instructions send the damn email when invoked manually and is not sent when invoked by the controller.
[17:53:52] cpruitt: If you’re mapping out your object attributes & you’re thinking “Man, these two things just seem really different and have no overlapping uses” that might be an indication that you need separate models.
[17:54:32] banister: has joined #RubyOnRails
[17:54:38] adavia: cpruitt: true.. good advice
[17:54:38] sp1rs: has joined #RubyOnRails
[17:55:04] cpruitt: Quintasan: If you find a debugger that can answer questions that generically, let me know. ;-) (probably need a lot more info to help)
[17:55:27] Quintasan: cpruitt: https://github.com/lynndylanhurley/devise_token_auth/issues/581
[17:55:43] Quintasan: Generally I can register on the website and using the API but the email doesn't get send.
[17:56:01] Quintasan: The logs show that the email was send but mailgun doesn't even get the request to send the email
[17:56:27] Quintasan: If I just open up the console, take the last created used and invoke send_confirmation_instructions the mail actually gets sent.
[17:56:47] Quintasan: I've been trying to debug this for last 8 hours and I'm going insane.
[17:56:56] Quintasan: Code is at: https://github.com/TeMoMuKo/asrapi
[17:57:17] baweaver: has joined #RubyOnRails
[17:57:46] workmad3: Quintasan: you've double-checked that your server is running in production?
[17:57:52] Quintasan: workmad3: Definitely.
[17:57:53] workmad3: Quintasan: and not development?
[17:58:10] cpruitt: If your dev log is showing that the email is going out (e.g. you can see the mail message in your terminal) then my experience is that your controller is doign it’s job. My first suspect would be your mail config.
[17:58:26] cpruitt: Something is mismatched about those two configs.
[17:58:55] cpruitt: (Missed that this was on prod but same comment applies)
[17:59:02] Quintasan: workmad3: I wouldn't be able to send things via mailgun when in development since I don't have mailgun configured in development
[18:00:03] workmad3: Quintasan: yes, but your dev config is set to not raise delivery errors, which would then result in the email appearing in your log but not being sent, and no errors occuring
[18:00:06] smathy: Quintasan, where in that repository are you calling send_confirmation_instructions ?
[18:00:15] workmad3: Quintasan: i.e. your observed behaviour
[18:00:40] Quintasan: workmad3: I shouldn't be doing that but I'm currently sitting in rails console in production environment
[18:01:21] Quintasan: workmad3: I'm literally opening rails console on the server in production mode and issuing "User.last.send_confirmation_instructions"
[18:01:39] workmad3: Quintasan: and you said that works... and isn't what I'm asking about
[18:01:51] workmad3: Quintasan: I'm asking about your server environment, not your console environment
[18:02:18] Quintasan: smathy: I am not invoking that manually in the controllers. Devise should be invoking that.
[18:03:03] cpruitt: (Reminds my why I stopped using Devise)
[18:03:15] djbkd: has joined #RubyOnRails
[18:03:15] drbayer: has joined #RubyOnRails
[18:03:49] djbkd: has joined #RubyOnRails
[18:04:05] Quintasan: workmad3: yes, config/environments/production.rb has it set to false. I'll try setting that to true but I highly doubt this would actually be the problem
[18:04:45] workmad3: Quintasan: again, not what I'm asking... I'm asking are you *absolutely* sure that your rails app server is running with `RAILS_ENV=production`?
[18:05:12] Quintasan: I'll just go and check it three more times.
[18:05:19] workmad3: Quintasan: because the behaviour you've described so far would be in-line with your app server being run in dev mode (namely that you're not getting delivery errors, but you're seeing a log of the email)
[18:05:27] Quintasan: I'm not sure of anything at this point.
[18:05:48] Quintasan: Environment=RAILS_ENV=production is in my systemd unit
[18:05:53] Quintasan: which starts the thing
[18:07:11] cpruitt: workmad3: Glancing at his production.rb wouldn’t the same be true about his production environment?
[18:07:16] Quintasan: config/puma.rb defaults to production as well
[18:07:25] cpruitt: Log level set to :debug & raise deliver is false
[18:07:55] workmad3: cpruitt: ah, good points
[18:08:07] JakFrist: has joined #RubyOnRails
[18:08:08] workmad3: cpruitt: that doesn't quite explain why it works in a console though :)
[18:08:40] cpruitt: workmad3: yeah, I think there’s more debugging that needs to happen than we have access to. lol
[18:09:06] cpruitt: Quintasan: I’d set your deliver errors to true. It won’t “solve” anything but maybe you’ll at least see a new error to tip you off
[18:09:26] cpruitt: Geez… wny can I type fine everywhere except this friggin IRC client?
[18:09:34] P4Titan: has joined #RubyOnRails
[18:09:38] jenrzzz: has joined #RubyOnRails
[18:09:39] intrigueD: has joined #RubyOnRails
[18:09:45] cpruitt: Everyone just pretend I’m not a native english speaker, m’kay?
[18:10:10] workmad3: Quintasan: I can't see where you're setting up your mailgun api key btw
[18:10:17] Pazician: has joined #RubyOnRails
[18:10:20] workmad3: cpruitt: no can do, I'll just silently judge you instead
[18:10:37] cpruitt: Long as it’s silent I don’t care.
[18:10:41] Quintasan: Mailgunner::Client defaults to extracting the domain and api_key values it needs from the MAILGUN_API_KEY and MAILGUN_SMTP_LOGIN environment variables.
[18:11:00] cpruitt: workmad3: Otherwise I’ll have to go cry somewhere. That part sucks.
[18:11:06] workmad3: Quintasan: and you definitely added those to your systemd setup and restarted the server?
[18:11:06] Quintasan: workmad3: I'm setting them in the systemd unit via Environment= directive.
[18:11:08] smathy: Quintasan, if I were you I'd put a byebug into Devise::ConfirmationsController#create and see why it's not doing what you want it to.
[18:11:50] djbkd: has joined #RubyOnRails
[18:12:27] djbkd: has joined #RubyOnRails
[18:12:36] Macaveli: has joined #RubyOnRails
[18:12:44] jkahn: has joined #RubyOnRails
[18:13:39] kahn_dumb: has joined #RubyOnRails
[18:14:33] P4Titan: Hello all! I have an issue with my rvm default values. I have a .ruby-gemset and version file, yet when I enter in the project's directory, rvm does not pick up on this and proceeds to use the (default) gemset
[18:14:59] sp1rs: has joined #RubyOnRails
[18:15:49] baweaver: has joined #RubyOnRails
[18:16:03] darkxploit: has joined #RubyOnRails
[18:17:25] DoctorMonocular: has joined #RubyOnRails
[18:17:52] moeabdol2: has joined #RubyOnRails
[18:19:51] pawnbox: has joined #RubyOnRails
[18:22:17] sleungcy: Hi, what does "&." mean in ruby? I am seeing some code like "puts self.user&.name"
[18:23:16] workmad3: sleungcy: it's the new 'safe navigation' operator
[18:23:38] workmad3: sleungcy: basically it's a nil-check before calling the `.name` method
[18:24:08] sypheren: has joined #RubyOnRails
[18:25:55] alyosha: http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/
[18:26:02] sp1rs: has joined #RubyOnRails
[18:26:08] yatish27: has joined #RubyOnRails
[18:26:15] Ergo: has joined #RubyOnRails
[18:30:02] P4Titan: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[18:31:24] DoctorMonocular: has joined #RubyOnRails
[18:32:33] Quintasan: workmad3: now that I made the server raise errors I'm getting 401 from Mailgun. I thought I messed up in the unit file and the server doesn't know about the credentials but I added Rails.logger.info ENV['MAILGUN_API_KEY'] and the key itself shows up in the logs.
[18:32:58] kgutteridge: has joined #RubyOnRails
[18:33:04] workmad3: Quintasan: interesting
[18:34:38] workmad3: Quintasan: checked the spelling of the other variable?
[18:34:59] Quintasan: yeah, both variables are named correctly
[18:35:13] Quintasan: I copypasted it from the mailgunner library which I'm using
[18:35:26] workmad3: any chance of a link to that?
[18:36:32] edwinvdgraaf: has joined #RubyOnRails
[18:36:36] Quintasan: https://github.com/timcraft/mailgunner/
[18:37:18] yfeldblum: has joined #RubyOnRails
[18:37:55] |PiP|: has joined #RubyOnRails
[18:38:20] jenrzzz: has joined #RubyOnRails
[18:38:35] |PiP|: im trying to build a dynamic JSON API, where, within the request parameters, I can specify which associations to load (including nested associations). Anyone know of a good gem or pattern to follow
[18:38:37] workmad3: Quintasan: strange... best I can suggest is double-checking the values for both of them :/
[18:45:37] mikecmpbll: has joined #RubyOnRails
[18:45:54] dionysus69: has joined #RubyOnRails
[18:46:02] pwnd_nsfw: smathy, would you alias methods from your user model to it's "sub" models, so you don't have to do something like student.user.name?
[18:46:03] tbuehlmann: |PiP|: I wrote a little something for that. restrictions: it's just about loading the resource(s) and not rendering it, and up to now the association embedder only retrieves the first level of associations (not nested)
[18:46:20] tbuehlmann: |PiP|: if interested: https://github.com/tbuehlmann/lappen
[18:47:14] smathy: pwnd_nsfw, delegate - and yes.
[18:47:49] pwnd_nsfw: Do you copy the same stuff into each model, or can you dry that with concerns?
[18:48:43] jenrzzz: has joined #RubyOnRails
[18:49:14] futilegames: has joined #RubyOnRails
[18:49:28] jenrzzz: has joined #RubyOnRails
[18:49:59] jenrzzz: has joined #RubyOnRails
[18:50:28] jenrzzz: |PiP|: http://jsonapi.org/format/#fetching-includes
[18:53:20] agit0: has joined #RubyOnRails
[18:54:47] halfamind1: has joined #RubyOnRails
[18:58:32] zave: has joined #RubyOnRails
[19:00:22] |PiP|: tbuehlmann: thanks ill check it out
[19:00:23] robbyoconnor: has joined #RubyOnRails
[19:01:57] robbyoconnor: has joined #RubyOnRails
[19:02:16] edwinvdgraaf: has joined #RubyOnRails
[19:02:25] cpruitt: I posed a somewhat vague question earlier. I’d like to re-ask with some more detail. I have data I need to model (real estate data for property for sale). The problem is that the table would contain more columns than is probably wise (or even possible). Anyone have thoughts on how to structure this in a way that is performant and searchable? I basically need one model to manage, I believe the CS term is “a crapload” of attributes. No
[19:02:26] cpruitt: sure if there’s a proven method to doing this.
[19:02:27] cpruitt: For added clarity, here is a gist describing the potential data being acquired: https://gist.github.com/cpruitt/963a2e835f95b64e946b
[19:03:51] gregk: has joined #RubyOnRails
[19:05:17] djbkd: has joined #RubyOnRails
[19:06:12] smathy: pwnd_nsfw, you could dry it if you needed to, but for things like delegations I tend to just put them into the models. It's usually just one field, for me :email
[19:06:24] robbyoconnor: has joined #RubyOnRails
[19:06:26] smathy: pwnd_nsfw, I put name into the other model, it's nothing to do with authentication.
[19:06:46] pwnd_nsfw: Gotcha. Thanks again!
[19:06:59] djbkd: has joined #RubyOnRails
[19:07:20] sp1rs: has joined #RubyOnRails
[19:08:27] cnk: has joined #RubyOnRails
[19:08:53] gregk: folks, is there a way to tell 'fields_for' helper to prefix form field names with something (as if it were a nested form)?
[19:10:40] tildes: has joined #RubyOnRails
[19:11:18] mdw: has joined #RubyOnRails
[19:12:46] theblang: has joined #RubyOnRails
[19:13:13] rubyonra_: has joined #RubyOnRails
[19:15:54] adre: has joined #RubyOnRails
[19:17:14] smathy: gregk, the first argument is the name to use for field names.
[19:17:22] sp1rs: has joined #RubyOnRails
[19:18:00] djellemah: has joined #RubyOnRails
[19:18:50] arup_r: it seems we have, but with form_for I see http://makandracards.com/makandra/1035-add-a-prefix-to-form-field-ids
[19:18:50] uglybandersnatch: has joined #RubyOnRails
[19:19:49] mdw: has joined #RubyOnRails
[19:21:38] Devalo: has joined #RubyOnRails
[19:22:19] sypheren: has joined #RubyOnRails
[19:23:00] arup_r: has joined #RubyOnRails
[19:27:50] Ergo^: has joined #RubyOnRails
[19:28:23] drbayer: has joined #RubyOnRails
[19:28:48] edwinvdgraaf: has joined #RubyOnRails
[19:28:56] baweaver: has joined #RubyOnRails
[19:30:49] delgiudices: has joined #RubyOnRails
[19:31:22] Disavowed: has joined #RubyOnRails
[19:32:02] baweaver: has joined #RubyOnRails
[19:32:32] siaW: has joined #RubyOnRails
[19:33:45] rattatmatt: has joined #RubyOnRails
[19:35:56] Radar: GOOD MORNING
[19:36:13] gregk: smathy: well that's simple, should've tested it, thought it only took simple names/symbols, thanks!
[19:36:46] delgiudices: Radar, when would you say it's worth building a client side mvc app with rails as backend instead of just using turbolinks
[19:36:47] smathy: gregk, np.
[19:36:56] Radar: delgiudices: Do you realise what time it is here?
[19:37:07] delgiudices: What time is it there?
[19:37:11] Radar: blindsiding a dude with a question like that before 7am!
[19:37:26] smathy: You're the one who said good morning!
[19:37:30] delgiudices: I have to admin been waiting like the whole day for you to come up :)
[19:38:13] baweaver: has joined #RubyOnRails
[19:39:29] krzkrz: has joined #RubyOnRails
[19:40:34] kt2: has joined #RubyOnRails
[19:42:53] KanKava: has joined #RubyOnRails
[19:44:31] Radar: delgiudices: How does using turbolinks make a difference?
[19:44:35] Ergo^: has joined #RubyOnRails
[19:44:42] jenrzzz: has joined #RubyOnRails
[19:44:50] Radar: How is that two choices?
[19:44:53] delgiudices: Well with turbolinks you don't have to render the whole page every time you click a link
[19:45:05] delgiudices: Which is kind of what you do with client side apps
[19:45:13] delgiudices: you load data with json and that way you don't render the whole thing
[19:45:15] Radar: But you still build the app as per normal.
[19:45:23] delgiudices: Yeah that's it
[19:45:29] Radar: You don't load anything with JSON. Turbolinks makes the next request and pulls just the body.
[19:45:30] delgiudices: So it's way easier to maintain and faster to build
[19:45:31] fryguy: um turbolinks does not do json
[19:45:39] FLeiXiuS: has joined #RubyOnRails
[19:45:39] FLeiXiuS: has joined #RubyOnRails
[19:45:40] delgiudices: I know turbolinks doesn't do json
[19:45:50] Radar: I would recommend you stay away from turbolinks because it has caused me very hard-to-debug problems in the past.
[19:45:53] delgiudices: But its still feeling more natural
[19:46:18] delgiudices: Radar so you say that in today's world you should always use client heavy apps?
[19:46:28] Radar: PaulePanter: 4
[19:46:29] delgiudices: unless its something very trivial
[19:46:36] mhoungbo: has joined #RubyOnRails
[19:46:41] Radar: delgiudices: what do you mean by "client heavy"?
[19:46:48] delgiudices: Sorry for the term
[19:46:59] delgiudices: I mean having the client handle the routing and views etc..
[19:47:01] PaulePanter: Radar: What the command for the Robot?
[19:47:08] PaulePanter: I have a question regarding time.
[19:47:11] Radar: PaulePanter: There is no eval bot in this channel.
[19:47:17] Radar: PaulePanter: Doesn't everyone?
[19:47:24] jenrzzz: has joined #RubyOnRails
[19:47:25] Radar: delgiudices: As in a JS framework
[19:47:27] PaulePanter: Radar: Probably.
[19:47:33] Radar: PaulePanter: !ask
[19:47:33] helpa: PaulePanter: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[19:47:45] PaulePanter: Why does `Time.now.to_time` work?
[19:47:46] delgiudices: Yeah as in angular or ember
[19:47:51] djbkd: has joined #RubyOnRails
[19:48:01] PaulePanter: I can’t find `to_time()` in the documentation for the class Time.
[19:48:18] PaulePanter: … only for the class String.
[19:48:20] PaulePanter: http://apidock.com/rails/String/to_time
[19:48:45] arup_r: PaulePanter: Time.now.method(:to_time).owner type in rails console you will get the answer
[19:48:58] PaulePanter: http://paste.debian.net/417789/
[19:49:13] arup_r: after that Time.now.method(:to_time).source_locations will show you the actual code
[19:49:23] Radar: arup_r: no it won't
[19:49:25] PaulePanter: > Time.now.method(:to_time).owner => Time
[19:49:30] Radar: arup_r: please try things in the console before suggesting them
[19:49:44] Radar: PaulePanter: Why wouldn't it work? You may wish to convert an object to a time, when you don't know what that object is
[19:50:04] Radar: PaulePanter: And so if the object is a time and you "convert" it to a Time, you get a Time back.
[19:50:17] arup_r: ok, sorry.
[19:50:24] PaulePanter: Radar: But how does the method get defined?
[19:50:41] PaulePanter: arup_r: Radar is right, it didn’t show the source.
[19:50:43] Radar: PaulePanter: My guess is somewhere in the bowels of the C code for Ruby.
[19:50:47] arup_r: it is probablt C code. that is why it wouldn't come with Time.now.method(:to_time).source_location
[19:51:09] PaulePanter: Ok, I guess that is good enough for me right now.
[19:51:23] PaulePanter: I was just a little confused, that it worked in the console but wasn’t documented.
[19:51:50] tubbo: Radar: would you accept a PR to helpa for an eval command?
[19:51:52] arup_r: PaulePanter: source_location is handy,,, it shows http://ruby-doc.org/core-1.9.3/Method.html#method-i-source_location but, not all. anway
[19:52:03] Radar: tubbo: No because it's a lot of overhead to make it sandboxed.
[19:52:20] tubbo: Radar: i thought you might say that :)
[19:52:35] Radar: tubbo: If you found a way so that the code didn't run on the same machine as helpa then I would accept
[19:52:46] arup_r: PaulePanter: the idea I gave very helpful.. just not work in your particular example.. :)
[19:52:59] tubbo: Radar: yeah def. can i have your workstation's ip address and username/password?
[19:53:11] tubbo: for...testing...yeah...
[19:53:35] PaulePanter: arup_r: Thanks, I’ll try to remember it.
[19:53:39] PaulePanter: Thank you everyone!
[19:53:51] arup_r: yeah, don't give fake advises.. :)
[19:54:14] meoblast001: has joined #RubyOnRails
[19:54:55] sp1rs: has joined #RubyOnRails
[19:55:32] tubbo: i'm just kidding but now you got me thinking if that's possible
[19:55:36] tubbo: you know, without paying for it
[19:56:01] boontdustie: has joined #RubyOnRails
[19:58:18] FooMunki: has joined #RubyOnRails
[19:58:35] sp1rs: has joined #RubyOnRails
[19:59:15] delgiudices: Radar yeah JS framework as in Ember or angualr
[19:59:18] FooMunki: has joined #RubyOnRails
[19:59:27] Radar: delgiudices: You could if you wished.
[19:59:32] Radar: delgiudices: We use React at work
[19:59:36] Radar: Distracted by IRC trolls
[19:59:44] drbayer: has joined #RubyOnRails
[20:00:01] delgiudices: But doesnt that imply that the application will take much more time to be built?
[20:00:12] delgiudices: Or is that just the fact that i'm not familiar with a JS Framework
[20:01:15] tubbo: react isn't really comparable to ember or angular
[20:01:36] tubbo: it's more like if you took the component-based view layer(s) out of those frameworks and added a new variant of JS that allowed you to write HTML within it
[20:01:56] crystal77: has joined #RubyOnRails
[20:02:43] tubbo: delgiudices: i don't think you need a JS framework, but it's nice to have.
[20:03:58] tubbo: that said, i think it's easier to write rails apps where rails is the dominant framework...otherwise it feels kinda clunky...i never liked writing ember + rails apps together
[20:04:16] das3in: has joined #RubyOnRails
[20:05:53] delgiudices: But the thing is, nowadays it's kind of like a must
[20:05:57] delgiudices: If you want your apps to compete with other
[20:06:06] delgiudices: Because js apps feel way more natural
[20:06:15] delgiudices: In my opinion
[20:06:37] Spungey420: why are majority of rails jobs i see full stack ? are you expected to be a competent full stack developer with a knowledge of a JS framework? (react or angular etc)
[20:06:46] Technodrome: has joined #RubyOnRails
[20:07:21] Spungey420: my coworkers tell me to stop trying to learn front end coding and to specialise, but it seems to limit job opportunities
[20:09:30] tubbo: delgiudices: apps that don't need to reload the page for every request do feel a lot easier to work with, that's for sure. but it really depends on the app.
[20:09:58] delgiudices: tubbo i guess so
[20:10:06] tubbo: delgiudices: at almost any company i've worked for, we've been rendering html from the server. a lot of the time, the rendered html doesn't include the layout along with it, so it feels more snappy.
[20:11:00] baweaver: has joined #RubyOnRails
[20:11:14] tubbo: Spungey420: i started doing front-end before moving into back-end.
[20:11:31] tubbo: there are job opportunities for like everything. do what you want to do.
[20:13:00] Spungey420: i think most ppl start with front end, but i totally did not
[20:13:39] matthias_: has joined #RubyOnRails
[20:13:42] Spungey420: anytime i see a rails job it says must know rails, TDD, sql, javascript + a framework, css and html
[20:14:31] theRoUS: has joined #RubyOnRails
[20:15:40] monque: has joined #RubyOnRails
[20:16:04] mrbubbles: has joined #RubyOnRails
[20:16:14] mrbubbles: Good evening
[20:16:19] lemur: has joined #RubyOnRails
[20:16:22] theRoUS: i backed into rails 2 through the middleware bit, not the mvc app pattern. as a consequence, all the concerns/assets/services/... stuff is new to me. what would be a good/complete rails-for-n00bs-to-become-pros book?
[20:16:34] jenrzzz: has joined #RubyOnRails
[20:16:39] gingray: has joined #RubyOnRails
[20:16:47] mrbubbles: theRoUS Rails 4 in action is good
[20:17:50] cabinB: I have a view that is an html input form. The text fields are scattered about the html such that I need multiple form_for to write to the same model when it is submitted
[20:18:12] Maletor: has joined #RubyOnRails
[20:18:18] netzfisch: has joined #RubyOnRails
[20:18:44] cabinB: in other words, at the top of the HTML, I have "name"... later on, toward the bottom, I have "phone no". In between is another form for a nested model.
[20:19:02] cabinB: so the top and bottom need to have the same form_for. how is that done?
[20:19:13] merida_: has joined #RubyOnRails
[20:19:13] merida: has joined #RubyOnRails
[20:19:38] djbkd: has joined #RubyOnRails
[20:22:19] cnk: cabinB: so do you have 2 submit buttons? or are both forms ending up at the same controller for processing?
[20:22:26] theRoUS: mrbubbles: not on kindle, alas
[20:22:42] cabinB: one submit button, both forms --> same controller, same model
[20:23:48] delgiudi_: has joined #RubyOnRails
[20:24:14] cnk: form_for has a block, right? so different names for the block var? form_for :foo do |form1| ...
[20:24:23] cnk: the other do | form2 |
[20:24:26] cabinB: cnk can i simply have two form_for @model in one view? (actually, to be more specific, one is a view, the other is a partial
[20:25:17] cnk: No idea. I can't conceive of a situation where I would want 2 form tags unless they go different places
[20:25:37] cnk: so with out context, I can't really reson about the correct solution
[20:25:47] brycesenz: has joined #RubyOnRails
[20:26:18] cabinB: cnk ok I see what you're saying. for both, it can be (for example) form_for @customer, but one block user do |f1| and the other do |f2| and they will both save to same model?
[20:26:21] cnk: The partial you could just pass the same form in as a local, I think
[20:26:39] cnk: I don't know but that is what I would try
[20:28:11] cabinB: cnk duh... i can use pry to test it. wasn't thinking sorry. will let u know how it turns out if you're interested.
[20:28:29] cnk: yes I am curious
[20:28:43] djellemah: has joined #RubyOnRails
[20:30:36] gregk: ewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwrrrrrrrr
[20:30:49] gregk: lol sorry, cat owned the keyboard
[20:30:55] gregk: under control now
[20:31:41] arup_r: gregk: what is she doing there? hehe
[20:31:45] halfamind: has joined #RubyOnRails
[20:32:19] gregk: scared, my gf is vaccum cleaning, so the cat's all over the place
[20:33:51] delgiudi_: has joined #RubyOnRails
[20:34:33] nettoweb: has joined #RubyOnRails
[20:34:39] askhat: has joined #RubyOnRails
[20:36:51] mrbubbles: Okay so say I have a model with some attributes... say A, B, C. I want an additional model attribute, AVE which is the average of A B and C. Obviously I could just set up AVE as a function to make the calculation and return the value. However, I also want to store the value for use in future without needing to have it calculated again (in case I quickly need the average values of thousands of models). SO I now
[20:36:51] mrbubbles: have columsn in my table for A, B, C and AVE.
[20:37:54] mrbubbles: At the moment I'm just calling a function before_save that calculates the value and sets it on the model so that it's written to the DB. HOWEVER, I was wondering if there is a better pattern I can follow. The problem is that I now need to have some of the models recalculate the average and update the reading in the table...
[20:38:05] mrbubbles: The way I'm doing it just feels a bit "linear" if that makes sense :)
[20:39:16] arup_r: mrbubbles: callback looks ok for this
[20:39:21] arup_r: as you have now
[20:39:55] mrbubbles: Oh that's a good point
[20:40:01] arup_r: regarding old record, updating them is time activity.
[20:40:21] mrbubbles: Ah, so maybe if I just save one of the old ones then it will re-calculate the values
[20:40:24] chipotle: has joined #RubyOnRails
[20:40:35] mrbubbles: makes sense, I do have it in a before_save callback
[20:40:55] arup_r: ok, write a Rake task, and do the calculation and update it for old records.
[20:40:58] Devalo: has joined #RubyOnRails
[20:41:21] P4Titan: has joined #RubyOnRails
[20:41:33] P4Titan: has left #RubyOnRails: ()
[20:42:07] pokEarl: has joined #RubyOnRails
[20:44:17] trosborn: has joined #RubyOnRails
[20:48:23] nerium: has joined #RubyOnRails
[20:50:47] bratchley: has joined #RubyOnRails
[20:52:10] banister: has joined #RubyOnRails
[20:53:56] bratchley: hey I'm trying to learn RoR using a book online, but whenever I execute "rails server" I get an error. It's pretty much a blank app ("rails _4.2.0_ new hello_app") with a modified Gemfile (https://dpaste.de/sGmN) but I get a require error when starting (https://dpaste.de/pQ29). The book reads like the "rails server" command should've worked, though
[20:55:57] nettoweb: has joined #RubyOnRails
[20:56:03] arBmind: has joined #RubyOnRails
[20:59:58] Pazician: has joined #RubyOnRails
[21:00:26] gingray_: has joined #RubyOnRails
[21:01:00] jstransky: has joined #RubyOnRails
[21:02:08] pwnd_nsfw: I have another idea to brainstorm. So, I'm going to have a list of people that provide services. They will be able to be sorted by location and by one or more services
[21:02:24] pwnd_nsfw: Currently all done by get variables, but looks uglier than shit
[21:02:46] pwnd_nsfw: There's a list on the page that users can click to select the one or more services
[21:03:59] FCser: has joined #RubyOnRails
[21:04:55] boontdustie: has joined #RubyOnRails
[21:05:08] pwnd_nsfw: bratchley, do you have node installed?
[21:05:15] WhatTheRails: Anyone using React here? I'm trying to display a form mapped to a "User" model. This "User" model has_one "partner", which is also mapped to the "User" class, so the model is self referenced. Anyone have an idea how to map the form written with React to this associated model ? I don't know if I should use accepts_nested_attributes_for and have the field names written as user[partner_attributes][...] or just flat out the
[21:05:33] n008f4g_: has joined #RubyOnRails
[21:05:49] zave: has joined #RubyOnRails
[21:06:18] bratchley: pwnd_nsfw: the Cloud9 IDE doesn't let me install anything
[21:06:39] cac: has joined #RubyOnRails
[21:06:44] bratchley: pwnd_nsfw: C9 is referenced directly in the book I'm trying to follow and they also don't mention having to install nodejs manually
[21:07:01] pwnd_nsfw: I wouldn't imagine you having to install it on c9
[21:07:54] gingray: has joined #RubyOnRails
[21:08:15] Guest34101: has joined #RubyOnRails
[21:08:19] Spungey420: where can i get freelane work for rails back-end/testing if thats even possible
[21:08:44] pwnd_nsfw: bratchley, just for the lulz, try 5.0.2
[21:08:53] pwnd_nsfw: Spungey420, I use upwork
[21:09:23] Spungey420: did you have to do small pay stuff first ?
[21:09:40] pwnd_nsfw: No one is really going to trust you with larger projects without your foot in the door first
[21:09:55] pwnd_nsfw: My first job on upwork was converting pdf -> bootstrap heh
[21:10:04] pwnd_nsfw: And some simple php stuff
[21:11:10] pwnd_nsfw: bratchley, or adding gem 'sass', '3.4.13'
[21:11:37] xploshioon: has joined #RubyOnRails
[21:12:47] Guest34101: has left #RubyOnRails: ()
[21:13:35] smathy: bratchley, does `bundle exec rails server` work?
[21:13:55] xploshioon: Hi guys, I am trying to use this gem https://github.com/mhfs/devise-async I installed too the gem delayed job and configured, but I need to run a command to start delayed job in production or I just push and don't need anything to do? and thanks, new with this...
[21:14:51] bratchley: one second I blew it away and now I'm trying to rebuild the rails app but now "rails _4.2.0_ new hello_app" is failing as well
[21:18:44] edwinvdgraaf: has joined #RubyOnRails
[21:19:33] bratchley: pwnd_nsfw: adding the sass gem made it work
[21:19:47] bratchley: in retrospect it seems like an obvious error, my only excuse is that I'm brand new
[21:20:48] Mattx: has joined #RubyOnRails
[21:21:06] pwnd_nsfw: I just SO'd the shit out of it
[21:21:20] Mattx: Is it enought to put ActiveRecord::Base.connection.close or ActiveRecord::Base.clear_active_connections! at the end of a thread? I'm still getting "FATAL: sorry, too many clients already"
[21:22:06] bratchley: pwnd_nsfw: "SO'd" ?
[21:22:18] pwnd_nsfw: stack overflow
[21:23:32] bratchley: ty anyways though, you got me passed my first hurdle
[21:25:47] blackmesa: has joined #RubyOnRails
[21:29:50] FooMunki: has joined #RubyOnRails
[21:34:03] intrigueD: has joined #RubyOnRails
[21:34:17] jsrn: has joined #RubyOnRails
[21:36:31] kgutteridge: has joined #RubyOnRails
[21:36:38] djbkd: has joined #RubyOnRails
[21:38:17] yfeldblum: has joined #RubyOnRails
[21:38:56] polishdub: has joined #RubyOnRails
[21:39:32] P4Titan: has joined #RubyOnRails
[21:39:47] imuglyandimproud: has joined #RubyOnRails
[21:40:07] nettoweb: has joined #RubyOnRails
[21:40:08] Maletor: has joined #RubyOnRails
[21:40:15] P4Titan: Hello all! I have a fairly simple question. I would like to redirect from the end of one action handler to another and then have that other one render normally
[21:40:33] P4Titan: I have this: redirect_to action: data_entry and return
[21:40:38] imuglyandimproud: Hey all, what is the correct way to configure the correct testing directory (spec vs test) in an engine? "rails g" installs all testing modules to test
[21:45:35] cd-rum: has joined #RubyOnRails
[21:47:39] imuglyandimproud: ahhhhh got it, looks like I had a typo =]
[21:48:45] baweaver: has joined #RubyOnRails
[21:50:08] smathy: Mattx, definitely don't close it. Did you read "Obtaining (checking out) a connection" in http://devdocs.io/rails/activerecord/connectionadapters/connectionpool ?
[21:50:26] smathy: Mattx, it's fairly clear on the few ways to use the pool.
[21:51:37] smathy: P4Titan, not sure if you noticed, but you didn't ask a question.
[21:52:47] Disavowed: has joined #RubyOnRails
[21:55:20] P4Titan: well, I seemed to figure it out
[21:55:30] P4Titan: tho now I have an actual question this time
[21:55:31] Cohedrin: has joined #RubyOnRails
[21:55:46] Spungey420: P4Titan how did u do that out of curiosity
[21:55:58] P4Titan: are the form helper functions restricted to work only w/ model objects
[21:56:12] P4Titan: Spungey420: redirect_to action: :data_entry
[21:56:22] P4Titan: aparently, the arg of action has to be a symbol
[21:56:44] Spungey420: form_for uses the model but form_tag can be anything
[21:56:51] Spungey420: im not expert in front end helpers
[21:57:09] pulpfiction: has joined #RubyOnRails
[21:57:54] pulpfiction: guys, if i have a gemfile on the root of a project, isn't it just the case of executing `bundle install` to install the project dependencies?
[21:58:08] P4Titan: pulpfiction: it should
[21:58:16] pulpfiction: i'm getting the following message: bundle: Usage: bundle package dest prefix
[21:58:34] pulpfiction: Arguments: (bla bla bla listing what each argument means)
[21:59:14] P4Titan: tbh, ur question belongs better with #ruby than #rubyonrails
[21:59:30] P4Titan: furthermore, I personally don't know why that happens then, sorry
[21:59:36] pulpfiction: ok, will try there :) thanks
[22:01:07] polishdub: has joined #RubyOnRails
[22:01:22] DoctorMonocular: has joined #RubyOnRails
[22:04:08] snockerton: has joined #RubyOnRails
[22:05:16] ur5us: has joined #RubyOnRails
[22:08:55] baweaver: has joined #RubyOnRails
[22:09:56] brycesenz: has joined #RubyOnRails
[22:11:11] atrius: has joined #RubyOnRails
[22:12:06] techandy1: has joined #RubyOnRails
[22:14:30] techandy1: afternoon everybody
[22:15:41] htmldrum_: has joined #RubyOnRails
[22:15:41] htmldrum: has joined #RubyOnRails
[22:17:24] lemur: has joined #RubyOnRails
[22:17:36] johnflux: has joined #RubyOnRails
[22:17:36] johnflux: has joined #RubyOnRails
[22:19:24] alyosha: has joined #RubyOnRails
[22:19:48] Diabolik: what's the benefit of using symbols vs strings in translations
[22:19:55] tvw: has joined #RubyOnRails
[22:19:58] Diabolik: t('.second_prize') over
[22:19:58] Diabolik: t(:second_prize) ?
[22:20:05] snockerton: has left #RubyOnRails: ()
[22:21:26] smathy: Diabolik, nothing significant.
[22:21:40] uglybandersnatch: has joined #RubyOnRails
[22:22:06] intrigueD: has joined #RubyOnRails
[22:23:10] quazimodo: has joined #RubyOnRails
[22:28:40] superlou: has joined #RubyOnRails
[22:31:01] maxx88: has joined #RubyOnRails
[22:33:23] nerium: has joined #RubyOnRails
[22:33:49] Technodrome: has joined #RubyOnRails
[22:34:20] ql6wlld: has joined #RubyOnRails
[22:36:37] stannard: has joined #RubyOnRails
[22:37:56] mrgreenfur: has joined #RubyOnRails
[22:42:15] statelesscode: has joined #RubyOnRails
[22:47:21] wroos: has joined #RubyOnRails
[22:47:46] _Tariq: has joined #RubyOnRails
[22:48:03] jenrzzz: has joined #RubyOnRails
[22:56:36] tfitts: I'm trying to integrate with shopify and finding I need almost a 1:1 map of models to shopify models. I'm thinking about namespacing models since they would otherwise all be ShopifyWhatever. Anyone currently do this (namespaced models) and recommend it or want to tell me why it would be a bad idea?
[22:58:21] rubyonrailed: has joined #RubyOnRails
[23:00:45] cd-rum: has joined #RubyOnRails
[23:01:15] Radar: tfitts: nothing wrong with namespacing them.
[23:01:20] Radar: tfitts: Shopify::Product would be fine.
[23:01:24] uglybandersnatch: has joined #RubyOnRails
[23:02:33] baweaver: has joined #RubyOnRails
[23:05:48] uglybandersnatch: has joined #RubyOnRails
[23:05:51] intrigueD: has joined #RubyOnRails
[23:06:54] siaW: has joined #RubyOnRails
[23:08:26] siaW: i’m trying to push to heroku and i keep getting this https://gist.github.com/siaw23/f8c32773f15d4c704166#file-pushing_to_heroku-txt-L17
[23:08:39] siaW: does someone have any idea why that?
[23:09:31] zave: has joined #RubyOnRails
[23:11:34] Tref: has joined #RubyOnRails
[23:11:38] bob434: has joined #RubyOnRails
[23:13:53] Radar: siaw: Citizen! Please do not be alarmed.
[23:14:11] Radar: siaw: looks like RubyGems spat the dummy, but then it worked shortly after. No need to worry about it.
[23:14:40] siaW: does it mean that i need to eait for rubygems to fix their stuff?
[23:15:26] Radar: It looks like it is fixed?
[23:15:31] Radar: Did your deploy fail and I just can't see it?
[23:15:37] siaW: let me try again
[23:15:59] Radar: https://gist.github.com/siaw23/f8c32773f15d4c704166#file-pushing_to_heroku-txt-L144-L152
[23:16:07] Radar: Seems to indicate to me that the deployment completed successfully?
[23:16:28] JoshGlzBrk: has joined #RubyOnRails
[23:17:05] hnanon: has joined #RubyOnRails
[23:17:29] siaW: Radar: so what this line? Push rejected to radiant-caverns-68355.
[23:17:34] baweaver: has joined #RubyOnRails
[23:17:39] hnanon: I have an action called "landing" in a cities controller.
[23:17:43] rodferso1|dinner: has joined #RubyOnRails
[23:17:45] Radar: siaw: Please point to the line in that gist that says that
[23:18:48] siaW: here: https://gist.github.com/siaw23/f8c32773f15d4c704166#file-pushing_to_heroku-txt-L134
[23:20:01] pwnd_nsfw: remote: Web Console is activated in the production environment, which is
[23:20:01] pwnd_nsfw: remote: usually a mistake. To ensure it's only activated in development
[23:20:01] pwnd_nsfw: remote: mode, move it to the development group of your Gemfile:
[23:20:02] hnanon: Is it possible to have a route like example.com/seattle-home-page where "seattle-home-page" points to the controller's "landing" action?
[23:20:42] hnanon: and where "seattle" would be a dynamic part of the route?
[23:21:39] siaW: fixed it ;)
[23:21:49] pwnd_nsfw: siaw, what was the issue?
[23:22:15] siaW: i put <% console %> and web-console gem in production :D
[23:22:24] siaW: just had to remove it
[23:23:43] clorisu: has joined #RubyOnRails
[23:24:36] clorisu: has joined #RubyOnRails
[23:29:32] Radar: siaw: You updated the gist.
[23:29:38] brycesenz: has joined #RubyOnRails
[23:29:43] siaW: Radar: i did :) sorry
[23:29:50] Radar: that's cheating :)
[23:30:48] siaW: if i wanted to ad a column to a table, i’d do this ‘rails generate migration AddListIdColumnToIdeas list_id:integer’
[23:30:57] siaW: now what if i want to add say 4 columns.
[23:31:02] siaW: how can i do that?
[23:31:19] solars: has joined #RubyOnRails
[23:34:19] zave: has joined #RubyOnRails
[23:35:09] cnk: siaw: do what you did - then edit the migration (and probably the class + file name)
[23:35:41] cnk: believe me, doing it manually is a LOT less trouble than fighting with Django's automatically created migrations
[23:36:44] helpa: has joined #RubyOnRails
[23:39:29] Ropeney: has joined #RubyOnRails
[23:44:20] choke: has joined #RubyOnRails
[23:45:25] Graphettion: has joined #RubyOnRails
[23:47:49] DLSteve: has joined #RubyOnRails
[23:50:20] cd-rum: has joined #RubyOnRails
[23:52:05] Inside: has joined #RubyOnRails
[23:52:05] Inside: has joined #RubyOnRails
[23:53:24] jenrzzz: has joined #RubyOnRails
[23:53:24] jenrzzz: has joined #RubyOnRails
[23:53:35] bamorim: has joined #RubyOnRails
[23:54:38] uglybandersnatch: has joined #RubyOnRails
[23:56:30] clorisu: has joined #RubyOnRails