« Back to channel list

#RubyOnRails - 27 July 2016

« Back 1 day Forward 1 day »
[00:02:51] neanderslob: has joined #RubyOnRails
[00:03:42] zpe: has joined #RubyOnRails
[00:06:25] zacts: has joined #RubyOnRails
[00:06:53] Arcaire: has joined #RubyOnRails
[00:06:55] Arcaire: anyone use slim here
[00:07:10] Arcaire: i can't really work out the google search terms for "a link inside a p tag"
[00:07:18] Arcaire: because google doesn't function well on any lex with less than three characters
[00:08:02] Arcaire: nvm the term that worked was 'nesting'
[00:08:18] arBmind1: has joined #RubyOnRails
[00:09:20] douglascorrea: has joined #RubyOnRails
[00:10:01] jenrzzz: has joined #RubyOnRails
[00:12:35] hannelita: has joined #RubyOnRails
[00:13:16] adre: has joined #RubyOnRails
[00:16:25] l4v2: has joined #RubyOnRails
[00:21:34] Devalo: has joined #RubyOnRails
[00:22:05] Velizar: has joined #RubyOnRails
[00:29:48] douglascorrea: has joined #RubyOnRails
[00:32:03] barhum2013: has joined #RubyOnRails
[00:35:59] cleopatra: has joined #RubyOnRails
[00:37:29] paradisaeidae_: has joined #RubyOnRails
[00:38:51] hahuang61: has joined #RubyOnRails
[00:44:34] JesseH: has joined #RubyOnRails
[00:50:25] macsteps: has joined #RubyOnRails
[00:56:51] Rodya_: has joined #RubyOnRails
[00:56:57] douglasc_: has joined #RubyOnRails
[00:57:55] Arcaire: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[00:59:02] jstransky: has joined #RubyOnRails
[00:59:11] Rodya_: has joined #RubyOnRails
[01:03:17] nacsurte: has joined #RubyOnRails
[01:04:50] djdarkbeat: has joined #RubyOnRails
[01:06:26] zpe: has joined #RubyOnRails
[01:07:50] r3vDev: has joined #RubyOnRails
[01:08:03] Axilla: has joined #RubyOnRails
[01:16:54] blackmesa: has joined #RubyOnRails
[01:17:00] exadeci: has joined #RubyOnRails
[01:18:25] SteenJobs: has joined #RubyOnRails
[01:20:02] craysiii: has joined #RubyOnRails
[01:20:59] SteenJobs_: has joined #RubyOnRails
[01:27:06] exadeci: Hello, I'm using json_api_client to communicate with a rails 5 project that uses active_model_serializers with the :json_api adapter, the :get requests work perfectly but with the :post ones the params are missing (not a CSRF issue), json_api_client request has them but they get lost in the server, has one of you experienced this with rails
[01:27:06] exadeci: 5/active_model_serializers ?
[01:31:40] Ropeney: has joined #RubyOnRails
[01:35:51] pydave6367: has joined #RubyOnRails
[01:41:53] Axilla: has joined #RubyOnRails
[01:43:57] der-landgraf: has joined #RubyOnRails
[01:43:57] der-landgraf: has joined #RubyOnRails
[01:44:27] sevenseacat: has joined #RubyOnRails
[01:45:29] AndrewIsHere: has joined #RubyOnRails
[01:46:24] Rodya_: has joined #RubyOnRails
[01:47:21] yoongkang: has joined #RubyOnRails
[01:53:36] duncannz: has joined #RubyOnRails
[02:00:49] Rodya_: has joined #RubyOnRails
[02:01:05] l4v2: So I feel pretty comfortable with my understanding of rails structure so anyone on here hiring?
[02:02:03] Radar: l4v2: What is the difference between a helper and a decorator?
[02:02:16] Radar: l4v2: What is the difference between { this: "that" } and { :this => "that" }
[02:02:53] Radar: l4v2: When is a good time to use Turbolinks?
[02:02:55] l4v2: I know that the helper file is to store logic, especially if it is needed for more than one controller
[02:03:15] l4v2: and the second one is a hash in older and newer ruby
[02:03:16] Radar: l4v2: Explain to me what a "service class" is and what function it provides.
[02:03:18] Ropeney: Always a good time to use Turbolinks
[02:03:23] Radar: admin plz ban Ropeney
[02:03:42] nettoweb: has joined #RubyOnRails
[02:04:33] l4v2: and it is always a good time to use Turbo links as previously stated.
[02:04:41] l4v2: Radar, how did I do?
[02:04:42] Radar: l4v2: I'm sorry but you're fired. Next.
[02:05:29] Radar: l4v2: You didn't explain what a decorator is and you missed the question about the service class.
[02:05:44] Radar: l4v2: Do you have an example of your Rails code somewhere that I could look at?
[02:06:06] Radar: (protip: I am not actually offering any jobs, I am just giving you the kinds of questions interviewers would give you)
[02:06:40] l4v2: That detailed huh?
[02:07:06] crdpink2: has joined #RubyOnRails
[02:07:12] zpe: has joined #RubyOnRails
[02:07:17] Radar: imo those kinds of questions are a good gauge on how experienced someone is in Ruby. I can tell a lot more by looking at a code example, which is why I asked for one.
[02:07:18] l4v2: Not all projects incorporate all things
[02:08:02] l4v2: My code so far is what I did with the Michael Hartl project
[02:08:29] Radar: There are at least ten thousand developers who have done the Michael Hartl project. Do you have anything unique to show to prospective employers?
[02:08:36] l4v2: And I amm just almost done re reading his book to pick up on the details. I haven’t built anything yet
[02:09:13] Radar: You will need to build something unique to show to an employer. Here's a few ideas: https://github.com/radar/guides/tree/master/what_next
[02:10:11] jtong: has joined #RubyOnRails
[02:14:11] Rodya_: has joined #RubyOnRails
[02:15:44] sevenseacat: while completing a tutorial is a great first step, its a lot different from being able to build custom apps on demand
[02:18:44] blackmesa: has joined #RubyOnRails
[02:19:21] Spami: has joined #RubyOnRails
[02:20:06] Rubie: has joined #RubyOnRails
[02:20:15] SteenJobs: has joined #RubyOnRails
[02:21:41] jtong: has joined #RubyOnRails
[02:22:09] Devalo: has joined #RubyOnRails
[02:23:33] crdpink: has joined #RubyOnRails
[02:25:49] l4v2: Thanks Radar, even though I did say I understood the structure of Rails (ya dink) :) pretty impressive body of work you got though
[02:26:28] Ropeney: whats a dink :(
[02:26:28] sevenseacat: you can *say* all you want, but you need to prove it
[02:26:56] sevenseacat: some form of lame insult it appears
[02:29:20] l4v2: WIth a smiley face next to it, it should be taken in a playful manner
[02:30:18] l4v2: I will give Radar that he is a advanced coder, but I said I understood the structure of rails, so his response was technically wrong.
[02:30:25] sevenseacat: no, it wasn't
[02:30:37] sevenseacat: he said nothing about his own ability, he was asking questions and offering advice to judge yours
[02:31:08] l4v2: Structure would imply the basic structure of the Rails framework
[02:31:09] tibuda: has joined #RubyOnRails
[02:31:24] sevenseacat: and you can say you understand it all you like, but whether you actually do is a different matter
[02:31:29] l4v2: I’m in a good mood though, I’m not trying to be a jerk.
[02:31:57] pickandmix_: lmao anyone of you here plays pokemongo? I'm trying to build a webapp for it
[02:32:02] l4v2: Well that is where I am at now.
[02:32:03] pickandmix_: but totally clueless on how to start
[02:32:21] sevenseacat: l4v2: great, so build some toy apps to show your understanding, as Radar suggested
[02:32:34] sevenseacat: those will be great to show an employer who will want to see some evidence of your skills
[02:32:53] sevenseacat: no-one is going to hire you just because you said you know things
[02:33:25] sevenseacat: pickandmix_: I hit level 5 yesterday! \o/
[02:33:33] pickandmix_: sevenseacat: I'm trying to build a pokemongo scanner webapp, but in the reddit dev
[02:33:37] l4v2: seavensacat, did you get a degree in CS?
[02:33:45] pickandmix_: all of them are like python APIs
[02:34:00] pickandmix_: I actually wanna build it in ruby and to kinda like polish up my skills
[02:34:01] l4v2: totally useless right?
[02:34:04] pickandmix_: sevenseacat: how would you approach it?
[02:34:09] pickandmix_: if you were me.
[02:34:37] l4v2: Well I’m in a bad area for tech, unless I want to do Java
[02:34:49] pickandmix_: l4v2: you did CS?
[02:35:02] sevenseacat: whether you have a degree or not, you will still need some code samples to show employers.
[02:35:20] tibuda: has left #RubyOnRails: ()
[02:35:59] Derperperd: has joined #RubyOnRails
[02:36:07] l4v2: I know, I already had an idea of my own project, but I need a job, cause I’m broke. I can’t play on the computer all day
[02:36:34] sevenseacat: start building it then
[02:36:43] l4v2: It’s like 7 years of up front work
[02:36:49] pickandmix_: sevenseacat: any advice for mine? :/
[02:36:54] sevenseacat: then build one of the sample apps Radar suggested
[02:37:17] l4v2: does he have solutions to it? I didn’t see any if I get stuck
[02:37:24] sevenseacat: pickandmix_: I have no idea about any pokemon go-related API stuff
[02:37:27] l4v2: but I only checked it out for a minute
[02:37:32] sevenseacat: l4v2: if you get stuck, you can always ask questions here.
[02:37:42] sevenseacat: l4v2: we will not provide solutions, they are not tests
[02:38:05] l4v2: What do you thnk I should build then?
[02:38:12] pickandmix_: sevenseacat: so if you were to be in my case, there are python APIs available. Should I pick up python instead?
[02:38:19] l4v2: out iof his 4 examples
[02:38:34] l4v2: the t shirt store with a shopping cart
[02:38:36] sevenseacat: pick one. I don't really care which. the idea is to practice your skills.
[02:38:46] l4v2: you care
[02:38:54] sevenseacat: if you get a job? not really.
[02:39:14] sevenseacat: I'm here to help people and offer advice,.
[02:39:52] l4v2: do you have a job?
[02:40:20] l4v2: are you an employee?
[02:41:06] l4v2: a Rails employee?
[02:41:07] sevenseacat: I am also a published author, and fifteen year veteran of the tech industry. any more questions for my credentials?
[02:41:31] l4v2: what did you write?
[02:41:33] 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
[02:41:35] l4v2: Rails Guides?
[02:42:56] l4v2: sevenseacat you wrote Rails 4 in Action
[02:43:06] sevenseacat: I co-wrote it with Radar, yes.
[02:45:49] Derperperd: has joined #RubyOnRails
[02:46:54] AndrewIsHere: has joined #RubyOnRails
[02:47:49] tjbiddle: has joined #RubyOnRails
[02:48:06] yoongkang: has joined #RubyOnRails
[02:48:16] zeknox: has joined #RubyOnRails
[02:49:15] l4v2: how long did that book take to complete?
[02:49:18] zeknox: can someone look at the sample snippet and help me understand if its possible to access a model attribute dynamically with the use of a string? https://gist.github.com/zeknox/c678f8f227ff50617f92bcf6dd264567
[02:49:57] sevenseacat: I worked on it for roughly ten months.
[02:50:28] sevenseacat: zeknox: you can, but you will need to look at using a method like `public_send` to convert the string into a method call
[02:50:43] sevenseacat: eg. model.public_send(model_attribute, calc_algo())
[02:51:25] Malgorath: has joined #RubyOnRails
[02:52:04] Malgorath: Can anyone help me with some weird issue? https://gist.github.com/malgorath/1dcb5f245e245b19b0be00f6b280b3b4 <= gist on the issue, getting ActiveRecord::AssociationTypeMismatch in TaskListsController#create
[02:52:39] sevenseacat: Malgorath: can you add the full error with backtrace to the gist?
[02:53:14] Malgorath: sevenseacat, just did, Full trace.txt
[02:53:16] sevenseacat: Malgorath: https://gist.github.com/malgorath/1dcb5f245e245b19b0be00f6b280b3b4#file-_form-html-erb-L24-L26 you're submitting an ID for an actual association value
[02:53:38] sevenseacat: setting the process_steps_category expects an actual category record, not the ID of one
[02:54:15] Malgorath: so drop the .id right?
[02:54:36] sevenseacat: if you want to set the ID, actually set the id value
[02:54:41] sevenseacat: ie. process_steps_category_id
[02:56:03] Malgorath: yeah when I do that, it does not set the column process_steps_category :-/
[02:56:16] sevenseacat: and so it shouldnt, because you dont have a category called that
[02:56:29] Malgorath: omg I think i made the migration wrong
[02:56:48] Malgorath: add_column :process_lists, :process_steps_category, :integer
[02:57:00] Malgorath: should be add_column :process_lists, :process_steps_category_id, :integer right?
[02:57:01] sevenseacat: if its a foreign key, it should be something_id
[02:59:56] zeknox: sevenseacat: thanks for public_send, it appears to be accessing the Model.attribute properly, but I'm not able to assign a value to the attribute as show in the example here: https://gist.github.com/zeknox/9ceba4a5673ba3650b55d484233c3143
[03:00:46] sevenseacat: oh right, because you want to call the setter method, which will be something like "growth_annualized_#{size}yrs=" (note the =)
[03:00:57] sevenseacat: at the moment you're calling the getter, not the setterrt
[03:01:36] zeknox: sorry, im not following what the syntax looks like to set the attribute
[03:01:53] sevenseacat: same syntax, but the method name is different
[03:01:56] jtong: has joined #RubyOnRails
[03:04:31] zeknox: sevenseacat: trying it out, but not making progress: https://gist.github.com/zeknox/9ceba4a5673ba3650b55d484233c3143
[03:04:48] sevenseacat: you did note the = in the method name
[03:06:26] sevenseacat: saying @model.foo = 12 is syntactic sugar for calling @model.foo=(12)
[03:06:34] sevenseacat: the method name is foo=
[03:07:54] zpe: has joined #RubyOnRails
[03:10:29] hannelita: has joined #RubyOnRails
[03:11:01] zeknox: sevenseacat: thank you for the assistance, think I got what I was after: stock.send("#{dividend_attribute}=", 0)
[03:11:47] zeknox: sevenseacat: thats some low level stuff! wish I knew more meta hotness
[03:16:34] siaw23: has joined #RubyOnRails
[03:18:21] braincrash: has joined #RubyOnRails
[03:19:45] blackmesa: has joined #RubyOnRails
[03:19:58] Limix: has joined #RubyOnRails
[03:20:54] k3rn31: has joined #RubyOnRails
[03:21:50] dstarh: has joined #RubyOnRails
[03:23:09] Radar: l4v2: Did you pick an app yet?
[03:23:17] IFrank00: has joined #RubyOnRails
[03:24:24] jtong: has joined #RubyOnRails
[03:28:49] spyder55: has joined #RubyOnRails
[03:32:25] jtong: has joined #RubyOnRails
[03:32:26] l4v2: Well Radar, I already had an idea for a big project, a social media caliber project, but maybe instead I will do the online t-shirt store with a checkout. Becuase a checkout is a pretty sueful concept
[03:33:02] _Tariq: has joined #RubyOnRails
[03:33:07] Radar: l4v2: I mentor a lot of newbies and they often shoot for the big scale app... and it never works. I really encourage you to build a series of small apps and rehearse the basics before attempting anything large.
[03:33:39] l4v2: Ok, good idea, baby steps
[03:34:25] l4v2: I like your book too, I do not own it, but I think it’s cool that you worte one
[03:35:05] l4v2: to put the code in color instead of black and white probably would have cost a lot more to make huh
[03:35:33] sevenseacat: we didn't get a say in that
[03:36:53] l4v2: I’d like to read a book on the making of a code book ;)
[03:37:20] l4v2: make it all about the experiences gained from it
[03:37:29] l4v2: and the process
[03:37:42] USvER[1]: has joined #RubyOnRails
[03:37:48] sevenseacat: https://reinteractive.net/posts/260-lessons-learned-from-rails-4-in-action
[03:45:41] Coldblackice_: has joined #RubyOnRails
[03:46:40] seap: has joined #RubyOnRails
[03:47:07] jtong: has joined #RubyOnRails
[03:48:51] yoongkang: has joined #RubyOnRails
[03:51:42] pawnbox: has joined #RubyOnRails
[03:52:00] l4v2: nice blog.
[03:52:20] l4v2: So do you all work for reinteractive?
[03:53:09] Coldblackice: has joined #RubyOnRails
[03:55:41] jenrzzz: has joined #RubyOnRails
[03:57:07] pawnbox: has joined #RubyOnRails
[03:58:41] jtong: has joined #RubyOnRails
[03:59:28] Pwnna: has left #RubyOnRails: ("Leaving")
[03:59:30] lxsameer: has joined #RubyOnRails
[03:59:44] djbkd: has joined #RubyOnRails
[04:00:27] sumobob: has joined #RubyOnRails
[04:01:18] qguv: has joined #RubyOnRails
[04:04:32] jtong: has joined #RubyOnRails
[04:06:42] l4v2: Ok, well I have to clean my kitchen, I was gonna finish reading Michael Hartl’s book, first, but maybe I will get started on one of Radar’s project instead.
[04:06:53] adam12: sevenseacat: Would you write another?
[04:07:07] sevenseacat: another book? absolutely
[04:07:11] Rubie: has joined #RubyOnRails
[04:08:31] sevenseacat: because I like helping people.
[04:09:06] sevenseacat: I've built up knowledge in my brain. I can teach that to other people.
[04:09:29] l4v2: in my .rvm/gems file can I delete the symlinks? that look like this ruby-2-head@global
[04:09:32] cleopatra: great tip Radar :P
[04:09:59] jtong: has joined #RubyOnRails
[04:12:15] sevenseacat: l4v2: I would assume they are there for a reason.
[04:13:00] SteenJobs: has joined #RubyOnRails
[04:14:48] adre: has joined #RubyOnRails
[04:14:55] conta: has joined #RubyOnRails
[04:20:29] agent_white: has joined #RubyOnRails
[04:20:32] blackmesa: has joined #RubyOnRails
[04:21:23] jtong: has joined #RubyOnRails
[04:23:08] Devalo: has joined #RubyOnRails
[04:23:13] Axilla: has joined #RubyOnRails
[04:24:33] barajasfab: has joined #RubyOnRails
[04:27:46] kies: has joined #RubyOnRails
[04:29:33] pickandmix_: has joined #RubyOnRails
[04:32:24] pawnbox: has joined #RubyOnRails
[04:33:07] jtong: has joined #RubyOnRails
[04:35:32] SteenJobs: what does one do if they need to execute a command with sudo within a custom cap task?
[04:36:29] SteenJobs: specificially running
[04:36:30] SteenJobs: "pkill -3 -f resque"
[04:38:30] SteenJobs: or in other words, how can i run that command without needing to use root
[04:41:30] yardenbar: has joined #RubyOnRails
[04:42:50] SteenJobs: i guess i just need to figure out how to run resque from a user other than root
[04:44:17] duderonomy: has joined #RubyOnRails
[04:44:32] jtong: has joined #RubyOnRails
[04:49:42] yoongkang: has joined #RubyOnRails
[04:51:14] SteenJobs: oh that’s the problem - cap runs resque as deploy, but god is running resque as root, AND they’re not seeing each other and now there are > 1 resque processes being run. ugh.
[04:52:31] djdarkbeat: has joined #RubyOnRails
[04:52:37] conta: has joined #RubyOnRails
[04:55:36] jtong: has joined #RubyOnRails
[04:56:05] syndikate: has joined #RubyOnRails
[05:01:20] jtong: has joined #RubyOnRails
[05:02:40] Limix: has joined #RubyOnRails
[05:05:36] FCser: has joined #RubyOnRails
[05:05:57] Rubie: has joined #RubyOnRails
[05:07:00] jtong: has joined #RubyOnRails
[05:08:50] axilla_: has joined #RubyOnRails
[05:10:48] rvanlieshout: has joined #RubyOnRails
[05:12:17] AndrewIsHere: has joined #RubyOnRails
[05:12:45] jtong: has joined #RubyOnRails
[05:12:53] bga57: has joined #RubyOnRails
[05:21:09] jenrzzz: has joined #RubyOnRails
[05:21:18] blackmesa: has joined #RubyOnRails
[05:24:07] Cohedrin: has joined #RubyOnRails
[05:24:22] jtong: has joined #RubyOnRails
[05:25:37] Cohedrin: has joined #RubyOnRails
[05:27:49] hannelita: has joined #RubyOnRails
[05:28:37] Limix: has joined #RubyOnRails
[05:29:30] Contigi: has joined #RubyOnRails
[05:29:59] yardenbar: has joined #RubyOnRails
[05:30:00] alfiemax: has joined #RubyOnRails
[05:30:06] SteenJobs: has joined #RubyOnRails
[05:31:24] zpe: has joined #RubyOnRails
[05:32:45] sumobob: has joined #RubyOnRails
[05:33:53] SteenJobs: has joined #RubyOnRails
[05:35:27] jtong: has joined #RubyOnRails
[05:39:05] Leepoff: has joined #RubyOnRails
[05:47:14] jishankai: has joined #RubyOnRails
[05:51:18] armyriad: has joined #RubyOnRails
[05:52:39] Macaveli: has joined #RubyOnRails
[05:55:33] spyder55: has joined #RubyOnRails
[05:57:35] pawnbox: has joined #RubyOnRails
[05:58:52] pontiki: has joined #RubyOnRails
[06:00:18] SteenJobs: all fixed :)
[06:02:12] solars: has joined #RubyOnRails
[06:03:02] SteenJobs: has joined #RubyOnRails
[06:03:19] armyriad: has joined #RubyOnRails
[06:05:58] dunpeal: has joined #RubyOnRails
[06:06:16] abhinav: has joined #RubyOnRails
[06:07:24] Rubie: has joined #RubyOnRails
[06:11:40] alfiemax: has anyone used https://github.com/NicosKaralis/pushmeup
[06:11:49] alfiemax: for ios notification?
[06:13:45] AndrewIsHere: has joined #RubyOnRails
[06:15:33] 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.
[06:15:39] jtong: has joined #RubyOnRails
[06:16:08] adre: has joined #RubyOnRails
[06:17:10] armyriad: has joined #RubyOnRails
[06:18:58] pawnbox: has joined #RubyOnRails
[06:20:48] mohsenjalalian: has joined #RubyOnRails
[06:22:03] hannelita: has joined #RubyOnRails
[06:22:28] blackmesa: has joined #RubyOnRails
[06:23:47] snoobydoo: has joined #RubyOnRails
[06:25:36] DoubleMalt: has joined #RubyOnRails
[06:26:27] snoobydoo: Hi everyone, I'm trying to model an association - and I'm having issues trying to think of the best way to do it. Association I'm trying to model: Every User belongs to a UserSegment, and every UserSegment should have many users to follow (reference to user_ids) and many users to discover (again, a array of user id's)
[06:26:47] Zelptron: has left #RubyOnRails: ()
[06:27:24] jstransky: has joined #RubyOnRails
[06:27:55] snoobydoo: I'm trying to create a UserSegment table with a many-many relationship with the User table, and a join table - but I'm not sure how the user segment can be modeled such that it can refer to two different sets of user IDs - basically every user segment should be able to return two sets of users IDs (users to follow, users to discover)
[06:28:45] snoobydoo: Am I on the right direction approaching this problem? Any thoughts?
[06:28:49] conta: has joined #RubyOnRails
[06:31:01] comrad: has joined #RubyOnRails
[06:34:04] mark_661: has joined #RubyOnRails
[06:34:06] minotep: has joined #RubyOnRails
[06:39:00] agit0: has joined #RubyOnRails
[06:39:06] yfeldblum: has joined #RubyOnRails
[06:40:15] ur5us_: has joined #RubyOnRails
[06:40:27] alfiemax: well my issue is that when i do `APNS.send_notification(device_token, 'Hello iPhone!' )`
[06:40:34] alfiemax: it just retuns me `nil`
[06:40:50] alfiemax: so i'm not sure what its supposed to return back when it's a success
[06:40:53] syndikate: has joined #RubyOnRails
[06:40:55] alfiemax: how do i debug?
[06:41:03] sevenseacat: what do the docs say it's supposed to return when success
[06:41:35] GorillaApe: has joined #RubyOnRails
[06:41:45] GorillaApe: is there a way
[06:41:48] armyriad: has joined #RubyOnRails
[06:44:29] Radar: HELPA HAS SPOKEN
[06:44:37] A_Drone: has joined #RubyOnRails
[06:44:53] A_Drone: Can I change the version on this http://api.rubyonrails.org to 4.2.5?
[06:44:57] Radar: alfiemax: https://github.com/NicosKaralis/pushmeup/blob/master/lib/pushmeup/apns/core.rb#L35-L38
[06:45:06] A_Drone: I don't see any UI for that, and http://api.rubyonrails.org/v4.2.5 didn't quite work
[06:45:14] Radar: A_Drone: http://api.rubyonrails.org/v4.2.5/
[06:45:23] Radar: How did that "not quite work"?
[06:45:50] A_Drone: Ah, I mistook the 404 on another site for this one - apidock I think
[06:47:46] Radar: Glad to help :)
[06:50:06] tvw: has joined #RubyOnRails
[06:50:32] abhinav: has joined #RubyOnRails
[06:51:39] dminca: has joined #RubyOnRails
[06:51:43] Hosh: has joined #RubyOnRails
[06:51:45] swgillespie: has joined #RubyOnRails
[06:52:02] mohsenjalalian: hi everyone i want to check enum value in my model to have a validation i want to use with_options how can i do it?
[06:52:09] pfg: has joined #RubyOnRails
[06:52:17] Hates_: has joined #RubyOnRails
[06:52:28] Hyuk: has joined #RubyOnRails
[06:52:33] zrl: has joined #RubyOnRails
[06:52:45] pawnbox_: has joined #RubyOnRails
[06:53:52] Radar: mohsenjalalian: I don't understand. Can you please show us some code?
[06:54:27] Leepoff: has joined #RubyOnRails
[06:56:16] mohsenjalalian: Radar I want my validation run when my enum has a specidfic value
[06:57:29] mark_661: has joined #RubyOnRails
[06:57:58] Radar: mohsenjalalian: http://guides.rubyonrails.org/active_record_validations.html#using-a-symbol-with-if-and-unless
[07:01:23] yfeldblum: has joined #RubyOnRails
[07:04:26] mohsenjalalian: Radar:https://gist.github.com/mohsenjalalian/fdc341eb607f518959ac6bdcb64cbd71
[07:04:36] mohsenjalalian: this is my code
[07:04:48] Radar: mohsenjalalian: Ok, so use an if like the guides link that I just showed you.
[07:06:39] mohsenjalalian: Radar: thanks a lot i will check it
[07:06:55] tego101: has joined #RubyOnRails
[07:08:18] daffy_duck: has joined #RubyOnRails
[07:10:12] futilegames: has joined #RubyOnRails
[07:12:36] blackhuey: has joined #RubyOnRails
[07:16:00] hannelita: has joined #RubyOnRails
[07:18:11] jtong: has joined #RubyOnRails
[07:18:15] roshanavand: has joined #RubyOnRails
[07:24:29] blackmesa: has joined #RubyOnRails
[07:25:04] abhinav: has left #RubyOnRails: ()
[07:25:28] dionysus69: has joined #RubyOnRails
[07:25:40] dionysus69: I just started using guard and rack-livereload middleware, firefox gives me flashplayer bar saying continue blocking or allow. does it mean either rack-livereload or guard are using flash player?
[07:28:05] darutoko: has joined #RubyOnRails
[07:28:28] jenrzzz: has joined #RubyOnRails
[07:28:28] jenrzzz: has joined #RubyOnRails
[07:29:48] blackmesa: has joined #RubyOnRails
[07:30:54] artto: has joined #RubyOnRails
[07:31:10] jtong: has joined #RubyOnRails
[07:32:12] A_Drone: Is there a way to start an ordered hash with existing values? http://api.rubyonrails.org/v4.2.5/classes/ActiveSupport/OrderedHash.html
[07:32:19] A_Drone: I tried foo = ActiveSupport::OrderedHash.new({a: 'b', c: 'd'})
[07:32:27] A_Drone: but foo is started empty
[07:32:36] sevenseacat: hashes are ordered from Ruby 1.9 by default
[07:33:00] A_Drone: But I read someone saying "This is an implementation detail and you shoudn't depend on it"
[07:33:10] FCser: has joined #RubyOnRails
[07:33:24] sevenseacat: http://ruby-doc.org/core-1.9.3/Hash.html "Hashes enumerate their values in the order that the corresponding keys were inserted."
[07:34:12] sevenseacat: i dont know why you wouldnt depend on it
[07:34:55] A_Drone: Thanks, that's a useful link I can show to my code reviewers if this get asked. Then ActiveSupport::OrderedHash ought to be deprecated shouldn't it?
[07:35:45] sevenseacat: it is in rails 5.
[07:35:46] duderonomy: has joined #RubyOnRails
[07:35:49] sevenseacat: http://api.rubyonrails.org/classes/ActiveSupport/OrderedHash.html
[07:36:00] monoprotic: has joined #RubyOnRails
[07:37:32] spyder55: has joined #RubyOnRails
[07:38:11] FCser: has joined #RubyOnRails
[07:38:23] spyder55: has joined #RubyOnRails
[07:38:38] kanzure: has joined #RubyOnRails
[07:38:59] adam^: has joined #RubyOnRails
[07:39:02] crankharder: has joined #RubyOnRails
[07:39:12] icedp: has joined #RubyOnRails
[07:40:52] veloutin: has joined #RubyOnRails
[07:41:42] Nowaker: has joined #RubyOnRails
[07:41:46] pawnbox: has joined #RubyOnRails
[07:42:21] queuetip: has joined #RubyOnRails
[07:43:27] codelahoma: has joined #RubyOnRails
[07:43:41] rbr: has joined #RubyOnRails
[07:45:54] snowy: has joined #RubyOnRails
[07:46:29] jtong: has joined #RubyOnRails
[07:47:03] aganov: has joined #RubyOnRails
[07:47:15] Pupeno: has joined #RubyOnRails
[07:50:27] artto: has joined #RubyOnRails
[07:51:36] yoongkang: has joined #RubyOnRails
[07:52:16] JesseH: has joined #RubyOnRails
[07:53:12] AzaToth: has joined #RubyOnRails
[07:55:32] Kedare: has joined #RubyOnRails
[07:56:09] mikecmpbll: has joined #RubyOnRails
[07:57:50] jtong: has joined #RubyOnRails
[08:00:26] artto: has joined #RubyOnRails
[08:02:43] agit0: has joined #RubyOnRails
[08:05:18] FCser: has joined #RubyOnRails
[08:09:17] jtong: has joined #RubyOnRails
[08:09:27] phredus: has joined #RubyOnRails
[08:10:15] hannelita: has joined #RubyOnRails
[08:10:21] FCser: has joined #RubyOnRails
[08:11:10] kanzure: has joined #RubyOnRails
[08:11:41] Kingdutch: has joined #RubyOnRails
[08:13:40] adre: has joined #RubyOnRails
[08:15:04] AndrewIsHere: has joined #RubyOnRails
[08:19:31] mhenrixon: has joined #RubyOnRails
[08:20:57] jtong: has joined #RubyOnRails
[08:22:13] Devalo: has joined #RubyOnRails
[08:23:56] abhinav: has joined #RubyOnRails
[08:31:27] Ergo: has joined #RubyOnRails
[08:34:13] jtong: has joined #RubyOnRails
[08:36:31] artto: has joined #RubyOnRails
[08:37:12] blackmesa: has joined #RubyOnRails
[08:41:29] Pupeno: has joined #RubyOnRails
[08:43:15] dionysus69: has joined #RubyOnRails
[08:43:50] jtong: has joined #RubyOnRails
[08:50:50] der-landgraf: has joined #RubyOnRails
[08:52:27] dANOKELOFF: has joined #RubyOnRails
[08:54:55] jtong: has joined #RubyOnRails
[08:59:43] der-landgraf: has joined #RubyOnRails
[09:02:34] futilegames: has joined #RubyOnRails
[09:04:18] hannelita: has joined #RubyOnRails
[09:06:56] A_Drone: has joined #RubyOnRails
[09:08:12] yfeldblum: has joined #RubyOnRails
[09:09:00] workmad3: has joined #RubyOnRails
[09:12:04] jtong: has joined #RubyOnRails
[09:13:40] workmad3_: has joined #RubyOnRails
[09:13:51] jenrzzz: has joined #RubyOnRails
[09:14:27] pawnbox: has joined #RubyOnRails
[09:15:48] snowy: has joined #RubyOnRails
[09:16:58] abhinav: how can I write some test, such that, If in future I added some new association to my model, that test should fail? currently i am checking 1st level associations with array of current associations. but it becomes complex when made recursive.
[09:17:40] zpe: has joined #RubyOnRails
[09:17:49] sypheren: has joined #RubyOnRails
[09:18:50] workmad3: has joined #RubyOnRails
[09:19:50] Derperperd: has joined #RubyOnRails
[09:21:04] tbuehlmann: abhinav: why would you test that?
[09:22:15] abhinav: tbuehlmann: i have a function to clone my model. not everything can be clone simply by using deep cloneable gem. i have to do lots of manual coding along with the gem. hence if i add new associtaion in future, and forget to add that association inside clone function, the test should notify by failing
[09:22:54] abhinav: test failure should indicate that, that new association is not taken care inside clone function
[09:23:21] jtong: has joined #RubyOnRails
[09:23:53] universa1: abhinav: (Model.methods + Model.first.methods).uniq.sort ?! ;-)
[09:25:09] Derperperd: has joined #RubyOnRails
[09:26:27] abhinav: .method gives a lot more than just associations. Model.reflections gives correct associations
[09:26:31] abhinav: universa1: ^
[09:28:25] abhinav: reflections.keys I mean.
[09:28:26] universa1: abhinav: so write a script which dumps the current relation structure into some file, and then load that in your test and compare it to the current state?!
[09:29:03] universa1: abhinav: https://github.com/preston/railroady -- and alike might prove helpful
[09:29:03] tbuehlmann: abhinav: I'd whitelist the things you want to be allowed, so you don't have a problem when adding things
[09:29:14] abhinav: universa1: ok. thought about that. but was not really convinced. hence looking for something better way.
[09:29:24] blackmesa: has joined #RubyOnRails
[09:29:25] abhinav: universa1: checking link. thanks.
[09:29:36] abhinav: tbuehlmann: yes. i have whitelist array.
[09:29:44] abhinav: created manualy.
[09:29:50] universa1: well, i'd seriously think about if cloning of a nested relationship structure is really necessary.
[09:30:03] abhinav: in some cases.
[09:31:09] jtong: has joined #RubyOnRails
[09:31:14] universa1: if you say so. presenting your use case might result in better ideas... ...but anyways, back to work.
[09:32:50] abhinav: our cloning is not resurt of some other requirement. Cloning itself is the requirement!
[09:33:11] universa1: cloning is a solution, not a business use case.
[09:43:18] conta: has joined #RubyOnRails
[09:45:23] wd40s: has joined #RubyOnRails
[09:46:08] Derperperd: has joined #RubyOnRails
[09:46:12] snoobydoo: has joined #RubyOnRails
[09:47:09] Derperperd: has joined #RubyOnRails
[09:47:42] AimlessRAven: has joined #RubyOnRails
[09:47:52] Synthead: has joined #RubyOnRails
[09:47:58] AimlessRAven: = f.association :product, as: :radio_buttons, collection: brand.available_products, label_method: ->(p){humanized_money_with_symbol(p.price_min) }, item_wrapper_class: 'inline'
[09:48:08] AimlessRAven: can i add div to my label_method: ->(p){humanized_money_with_symbol(p.price_min)
[09:48:20] r3vDev: has joined #RubyOnRails
[09:48:44] AimlessRAven: for example label_method: ->(p){humanized_money_with_symbol(p.price_min) <br> promotion_label(brand)}
[09:49:24] blackmesa: has joined #RubyOnRails
[09:51:46] snoobydoo: Hi all, I have two models - User and UserSegment [User belongs_to a UserSegment; UserSegment has_many Users] I want UserSegment to hold two other fields :users_to_follow and :users_to_discover - each of them will again be a collection of Users, since I already have a has_many on UserSegment, when i do has_many :users_to_follow it returns the same fields as its users. How do I make sure this
[09:51:52] snoobydoo: references two different sets of users independant of the has_many :users relationship that's defined?
[09:51:56] snoobydoo: User Model: https://gist.github.com/arvindravi/b03d3b35de315cbed9c1eb9fa5d3e1c0
[09:52:03] snoobydoo: UserSegment Model: https://gist.github.com/arvindravi/89520ca916baf0f697a59288c37ceafc
[09:53:05] universa1: snoobydoo: did you check the docs for has_many ?
[09:53:26] zpe: has joined #RubyOnRails
[09:53:27] universa1: snoobydoo: and the associations guide?
[09:54:10] snoobydoo: I'm going through it - But i'm not sure what to look as such for my case
[09:55:17] universa1: foreign key?
[09:56:22] yoongkang: has joined #RubyOnRails
[09:56:42] Cervajz: has joined #RubyOnRails
[09:57:25] snoobydoo: universa1: Thanks. But, Won't the foreign_key for the other two associations (users_to_follow, users_to_discover) be the same as :users? which is `user_id` on that table?
[09:57:36] jtong: has joined #RubyOnRails
[09:57:45] universa1: snoobydoo: no.
[09:57:53] universa1: snoobydoo: take a pen and some paper, and draw it out.
[09:58:31] universa1: snoobydoo: you need to store the information somewhere... there is no magic space that just happens to give you the right information...
[09:58:34] hannelita: has joined #RubyOnRails
[10:01:23] marr: has joined #RubyOnRails
[10:04:35] arBmind: has joined #RubyOnRails
[10:04:41] tennis: has joined #RubyOnRails
[10:04:48] snoobydoo: Makes sense, thanks universa1. I'm going to have to make a join table with segement_id and user_ids_to_follow and store that information there I guess
[10:04:52] srinidhi: has joined #RubyOnRails
[10:05:16] universa1: snoobydoo: !associations
[10:05:16] helpa: snoobydoo: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[10:05:36] universa1: snoobydoo: look for the many to many relationships: has and belongs to many and has many through
[10:06:39] hwcomcn: has joined #RubyOnRails
[10:06:54] GorillaApe: has joined #RubyOnRails
[10:06:59] zpe: has joined #RubyOnRails
[10:07:02] GorillaApe: Is there a way
[10:07:07] sevenseacat: not anymore, sorry.
[10:07:41] blackmesa: has joined #RubyOnRails
[10:08:03] A_Drone: has joined #RubyOnRails
[10:08:29] GorillaApe: How to test my models with minitest when havings tons of validations ? I mean it would be easier to test whether it has a specific validator than writing presence test length etc
[10:08:48] Hobogrammer: has joined #RubyOnRails
[10:08:57] universa1: GorillaApe: maybe shoulda-matchers prove helpful in your situation.
[10:09:03] alfiemax: has joined #RubyOnRails
[10:09:08] sevenseacat: GorillaApe: are you testing an implementation detail, or what the validation rules actually are?
[10:09:15] jtong: has joined #RubyOnRails
[10:09:17] weckl: has joined #RubyOnRails
[10:09:21] GorillaApe: they are a bit however latest 3.1 doesnt work with minitest
[10:09:39] tlarevo: has joined #RubyOnRails
[10:10:14] universa1: i haven't used minitest, but the readme says in the first line it is compatible to minitest.
[10:10:20] GorillaApe: I am not sure what you mean but I find testing each field too much work.
[10:10:34] sevenseacat: then don't test each field
[10:10:41] universa1: https://github.com/thoughtbot/shoulda-matchers#minitest
[10:10:59] GorillaApe: For example having an IP validator would require several test cases
[10:11:19] GorillaApe: having several in a model would require rewriting all these cases to all these models
[10:11:29] universa1: so write a shared example?
[10:11:31] sevenseacat: does minitest not have an equivalent of shared examples?
[10:11:55] sevenseacat: something for you to look into :P
[10:12:08] ur5us: has joined #RubyOnRails
[10:12:20] universa1: was bored, so did a quick google: http://anti-pattern.com/shared-examples-with-minitest
[10:12:47] sevenseacat: yeah I wasn't going to, for someone complaining that its too hard
[10:13:19] universa1: GorillaApe: !g minitest shared examples
[10:14:41] bartt: has joined #RubyOnRails
[10:15:28] bartt: Hi, is it possible when doing an INSERT to use an SQL function? I need to do INSERT INTO global_points (name, location) VALUES ('Town', ST_GeographyFromText('SRID=4326;POINT(-110 30)') );, where I have the lat lng -110 and 30
[10:16:10] universa1: bart_: https://github.com/rgeo/activerecord-postgis-adapter -- this?
[10:20:41] jtong: has joined #RubyOnRails
[10:21:17] wd40s: has joined #RubyOnRails
[10:25:15] openstruct: has joined #RubyOnRails
[10:31:06] openstruct: Is it a horrible idea to write a rails engine with version 5 with the hopes of mounting it on an rails 4.2 app?
[10:31:15] DrYockel1: has joined #RubyOnRails
[10:33:43] workmad3: openstruct: you'd need to be very careful to not use any rails 5 features
[10:33:46] jtong: has joined #RubyOnRails
[10:33:59] minotep: has joined #RubyOnRails
[10:34:11] openstruct: workmad3: I'm mostly just using the --api mode.
[10:34:36] openstruct: With the jsonapi-resources gem (beta, playing on that bleeding age. weeeeee)
[10:35:01] workmad3: openstruct: doesn't matter if you're mounting it as an engine what you're doing... an engine gets its code loaded in the same process, so if you're mounting in a rails 4.2 app, only rails 4.2 will be loaded (not rails 5)
[10:35:05] sevenseacat: oh that gem drove me nuts
[10:35:40] openstruct: sevenseacat: I semi wish I has stayed with AMS. Thought it'd be faster but namespacing with en engine and versioned api has been absolute hell.
[10:35:52] tlarevo: has left #RubyOnRails: ()
[10:36:13] openstruct: workmad3: Good to know...I foresee some late nights ahead.
[10:36:47] workmad3: openstruct: tbh, if you're aiming for a rails 4.2 app and it's not an engine you're going to release publicly, you'd be pretty crazy to write the gem using rails 5 :)
[10:37:04] workmad3: s/gem/engine
[10:37:19] openstruct: workmad3: We're hoping to upgrade the app to 5 in the near future, that's the main reason.
[10:37:58] workmad3: openstruct: so upgrade the engine at the same time... or don't pull it out as an engine until after the upgrade and write it as part of the app initially (which also IMO leads to easier initial development)
[10:38:28] Pupeno: has joined #RubyOnRails
[10:39:12] artto: has joined #RubyOnRails
[10:39:16] openstruct: workmad3: I like the idea of implementing it as an engine as we plan on moving it out once we get past the MVP stage. Granted, I can just upgrade as you said.
[10:39:26] openstruct: Bleh, time to downgrade the engine.
[10:39:30] sevenseacat: the best laid plans
[10:40:04] workmad3: openstruct: I'm not a fan of starting out features in an engine... it makes it harder to develop them IMO... I much prefer to start it off in-app, get it working, and then treat extracting an engine as a separate task :)
[10:40:57] blackmesa: has joined #RubyOnRails
[10:41:27] openstruct: workmad3: Well, now I'm torn. I need to get some coffee :)
[10:42:19] workmad3: coffee is always a good idea :)
[10:43:22] openstruct: I thought I was being clever with the engine idea. But now I feel the many pains.
[10:43:25] jtong: has joined #RubyOnRails
[10:44:51] tlarevo_: has joined #RubyOnRails
[10:47:35] workmad3: openstruct: it's easier to extract something once you know what the something is ;)
[10:47:59] workmad3: openstruct: and at the start of a large feature (or set of related features), you don't know exactly what it is
[10:49:12] GodFather: has joined #RubyOnRails
[10:49:20] workmad3: openstruct: so I have nothing bad to say about the idea of implementing something with the intention of extracting it as an engine (and keeping that in mind helps you to remember to keep the implementation isolated in ways that aid extraction)... but doing that initial chunk of development while also jumping through the hoops of an engine is IMO just a pain :)
[10:49:28] openstruct: workmad3: I'd argue that in this case, I know the scope of the feature. I wasn't able to get my team on board with making a separate app since we're at MVP stage and we didn't want to deal with syncing across services. This seemed liked the best way to keep the logic completely decoupled. Granted, I understand your logic here.
[10:49:44] Hyuk: has joined #RubyOnRails
[10:49:49] openstruct: haha yes, it has been a major source of pain.
[10:49:56] workmad3: openstruct: you may know the scope... but you don't know the fine-detailed interfaces with the rest of your codebase
[10:50:11] openstruct: workmad3: You're right, that changed a lot.
[10:50:31] openstruct: If only I was that person that had it all in their head at the beginning :)
[10:50:42] workmad3: openstruct: it always does when you start development on a new set of features :)
[10:51:14] workmad3: openstruct: and it's that aspect of it that makes starting out in an engine most painful IMO :)
[10:51:20] AimlessRAven: can i set newline here
[10:51:21] AimlessRAven: = f.association :product, as: :radio_buttons, collection: brand.available_products, label_method: ->(p){ p.set_promotion ? humanized_money_with_symbol(p.price_min) + humanized_money_with_symbol(p.discount_amount) + " off" : humanized_money_with_symbol(p.price_min) }, item_wrapper_class: 'inline'
[10:51:34] AimlessRAven: i want my humanized_money_with_symbol(p.discount_amount) + " off"
[10:51:37] AimlessRAven: to be on newline
[10:51:44] openstruct: workmad3: I appreciate the wisdom, thanks for the help!
[10:52:20] workmad3: openstruct: no probs... hopefully it's not too painful going forward!
[10:52:34] hannelita: has joined #RubyOnRails
[10:53:10] workmad3: AimlessRaven: did you try putting a newline in?
[10:53:18] rodfersou: has joined #RubyOnRails
[10:54:51] jtong: has joined #RubyOnRails
[10:55:39] AimlessRAven: workmad3: yes but dont work
[10:55:59] workmad3: AimlessRaven: that kinda answers your question then :P
[10:56:07] wd40s: has joined #RubyOnRails
[10:57:12] Ergo: has joined #RubyOnRails
[11:00:44] pawnbox: has joined #RubyOnRails
[11:06:14] jtong: has joined #RubyOnRails
[11:06:30] c355E3B: has joined #RubyOnRails
[11:08:09] rickmasta: has joined #RubyOnRails
[11:09:17] bartt: universa1: it's great, I just think it feels a but clunky to change the adapter name from postgresql to postgis
[11:09:24] bartt: universa1: in database.yml
[11:09:45] abhinav: has joined #RubyOnRails
[11:10:28] Pupeno: has joined #RubyOnRails
[11:10:30] abhinav: what can I use in v3.2.21 for assert_not?
[11:10:37] abhinav: its not available for that version.
[11:10:55] sevenseacat: v3.2.21 of....?
[11:11:00] fernandomm: has joined #RubyOnRails
[11:11:07] abhinav: i am doing assert_not(Model.photo.detect {|photo| condition=condition})
[11:11:19] abhinav: sevenseacat: Rails. :-/
[11:11:44] abhinav: since I am using .detect, I cant use assert_not_equal
[11:12:22] sevenseacat: invert the condition in the detect? or at least write it so its a condition, not an assignment
[11:12:49] abhinav: inverting will do.
[11:14:41] Cervajz: has joined #RubyOnRails
[11:15:32] abhinav: sevenseacat: no. not working with inverting == to !=
[11:17:08] abhinav: sevenseacat: is thery any opposite of .detect? like .notdetect! :-)
[11:19:18] dminca: has joined #RubyOnRails
[11:21:04] dminca: has joined #RubyOnRails
[11:22:49] JamieD: has joined #RubyOnRails
[11:22:50] mark_661: has joined #RubyOnRails
[11:25:12] rodfersou: has joined #RubyOnRails
[11:26:38] umdstu: has joined #RubyOnRails
[11:37:13] tlarevo: has joined #RubyOnRails
[11:37:28] wd40s: has joined #RubyOnRails
[11:40:41] openstruct: has joined #RubyOnRails
[11:45:55] jtong: has joined #RubyOnRails
[11:46:45] hannelita: has joined #RubyOnRails
[11:49:45] artto: has joined #RubyOnRails
[11:52:32] AimlessRAven: can i use humanized_money_with_symbol to display 2 argments like humanized_money_with_symbol(product.price, product.discount.price)
[11:53:08] Pupeno: has joined #RubyOnRails
[11:57:02] blackmesa: has joined #RubyOnRails
[11:57:35] jtong: has joined #RubyOnRails
[11:57:35] ur5us: has joined #RubyOnRails
[11:59:33] Mia: has joined #RubyOnRails
[11:59:51] tlarevo: has joined #RubyOnRails
[12:01:34] futilegames: has joined #RubyOnRails
[12:05:41] gregf_: has joined #RubyOnRails
[12:05:45] kedare1: has joined #RubyOnRails
[12:06:18] zpe: has joined #RubyOnRails
[12:06:24] DrYockel1: has joined #RubyOnRails
[12:07:49] Pupeno_: has joined #RubyOnRails
[12:08:57] jtong: has joined #RubyOnRails
[12:09:41] hannelita: has joined #RubyOnRails
[12:09:43] kitsuneyo: has joined #RubyOnRails
[12:09:48] Ropeney: has joined #RubyOnRails
[12:10:48] kitsuneyo: i'm thinking of using jquery UI for file upload, how good a fit is it with rails?
[12:11:07] kitsuneyo: specifically this: https://blueimp.github.io/jQuery-File-Upload/jquery-ui.html
[12:16:35] AndrewIsHere: has joined #RubyOnRails
[12:19:20] Hyuk: has joined #RubyOnRails
[12:27:11] flujan: has joined #RubyOnRails
[12:28:11] King_Rex: has joined #RubyOnRails
[12:31:38] zpe: has joined #RubyOnRails
[12:33:06] bbrowning_away: has joined #RubyOnRails
[12:33:41] ych: has joined #RubyOnRails
[12:34:05] GodFather: has joined #RubyOnRails
[12:35:09] Ergo: has joined #RubyOnRails
[12:35:51] StevenXL: Good morning everyone.
[12:37:03] StevenXL: I am dealing with some legacy code. My former CTO thought it would be a good idea to use a shared examples group in which, within the shared examples, we send a private message to the controller to simulate a request - for example - `send(:http_method, :action, params)
[12:37:04] freestyl3r: has joined #RubyOnRails
[12:37:29] universa1: this is not sending a private method to the controller
[12:38:48] universa1: it is the aequivalent of doing: http_method action, params
[12:38:53] universa1: in your test.
[12:39:00] freestyl3r: Hello. There is a deprecation warning when trying to pass an instance of ActiveRecord::Base to `find` but what about 'where'? I can't find anything. Is where(id: Model.first) going to stay?
[12:39:24] universa1: with http method being something like: get/post, action most likely something like :index, :create, and params being some hash
[12:39:24] StevenXL: universa1: I'm not following. I thought that the `send` method was used to invoke a private method on any object.
[12:39:25] Velizar: has joined #RubyOnRails
[12:39:56] datamann: has joined #RubyOnRails
[12:40:04] universa1: stevenxl: not to any object! to one object.
[12:40:40] universa1: stevenxl: and unless you specifically put some object in front of send, it calls on self
[12:40:48] StevenXL: universa1: I think I'm following what you are saying. We have one object - it happens to be an instance of a controller - and we are using `send` to invoke a private method on it, correct? Otherwise, there'd be no reason to use `send`.
[12:40:51] StevenXL: Am I missing something?
[12:40:57] universa1: stevenxl: !code
[12:40:57] helpa: stevenxl: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[12:41:25] sevenseacat: you dont need to use send in that scenario
[12:42:03] StevenXL: OK: Here is a shared example: https://gist.github.com/StevenXL/9c386386f0bd05db1f72547595ff4883
[12:43:00] universa1: stevenxl: so as i said, you don't send a private message to the controller, you're invoking a test method!
[12:43:12] universa1: which in turn might call the controller, but the send does not!
[12:43:16] StevenXL: Here is an example of how we use it: https://gist.github.com/StevenXL/e578fd4f4a770f53683f920ab9f71f1a
[12:43:39] StevenXL: universa1: I see what you are saying yes. My apologies for not being clearer.
[12:43:45] hannelita: has joined #RubyOnRails
[12:44:58] StevenXL: what we're getting at is that, in the first gist, if I put in `binding.pry` and invoke `self`, I'm not going to get a controller I've defined.
[12:45:05] StevenXL: Is that what you are getting at?
[12:45:32] universa1: stevenxl: kinda, yes.
[12:45:49] StevenXL: ok thanks, I fully agree with that.
[12:46:44] workmad3: stevenxl: yeah, that shared example is sending a message to the test instance you're running... it just happens that rspec pulls in the rails dsl for controller tests that defines methods like `get`, `post` etc for making requests against the controller subject
[12:47:23] StevenXL: Yup. I just put in a binding and invoked `self` and got this: `RSpec::ExampleGroups::ApiV2CandidateInvitationsController::PATCHAccept::Behaviors`.
[12:47:30] StevenXL: So I hear what you folks are saying.
[12:48:29] StevenXL: The reason why this was done this way is because we "hand-rolled" a logging system, and we wanted to test that the CreateApiEventJob was invoked whenever we hit certain controllers, regardless of the method, etc.
[12:49:28] StevenXL: What would be the recommended way to set up a shared example group that would test this, without resorting to calling private methods?
[12:49:43] workmad3: stevenxl: you're not calling private methods, you're doing dynamic dispatch
[12:49:58] universa1: in that simple use case i probably would ahve gone the explicit route, and just have the expect; controller call in the test...
[12:50:44] workmad3: stevenxl: `send` is a mechanism for dynamic dispatch, not just a way to call private methods... if you wanted to keep the example group (rather than universa1's suggestion of inlining things), you could see if things work with `public_send`
[12:50:55] StevenXL: workmad3: Not familiar with that. I'll have to look it up. Maybe it's my ignorance and I'm blaming it on the person that wrote the code.
[12:51:15] StevenXL: workmad3: (Not familiar with dynamic dispatch, I mean).
[12:51:32] workmad3: stevenxl: but really what you're doing is setting up an example group that is able to be configured to call a method based on a passed-in parameter (dynamic dispatch)
[12:51:38] banisterfiend: has joined #RubyOnRails
[12:51:46] StevenXL: universa1: That's the path I would have taken, but I'm a software engineer with <= 6 mths of exp, for what that is worth.
[12:52:14] shinnya: has joined #RubyOnRails
[12:52:26] adre: has joined #RubyOnRails
[12:53:22] StevenXL: workmad3: Yes that is true. Only problem with it is that whatever gets written to the database is not being cleaned up. I could try and use an after(:each) block in the shared examples, and have no problem going that route, but I thought I'd try to fix the root problem first.
[12:53:25] workmad3: universa1: it would depend on how many times I wrote out the same test personally :)
[12:53:41] workmad3: stevenxl: that sounds like a completely unrelated problem
[12:53:58] roshanavnad_: has joined #RubyOnRails
[12:54:15] workmad3: stevenxl: and it sounds like you either want to turn on transactional fixtures or set up DatabaseCleaner
[12:54:22] universa1: workmad3: yeah well... the added complexity and replacing 2 with one 1 line ;)
[12:54:49] workmad3: universa1: true... if it was purely one spec, I'd be hard-pressed to justify it :)
[12:54:54] blackmesa: has joined #RubyOnRails
[12:55:45] StevenXL: workmad3: transactional fixtures is set up in the test database. DatabaseCleaner makes the tests fail because the method called invokes (somewhere down the line) a controller action that needs a record in the db, and DatabaseCleaner cleans up the db too soon.
[12:56:07] workmad3: stevenxl: oh, I see the issue... it's because of how you're creating the data to pass into the shared example group...
[12:56:33] universa1: workmad3: yeah... ...and their name wasn't really intention revealing imho ;) but I definately also see the possibility of extracting it ;)
[12:56:35] StevenXL: workmad3: Yup. In that example when we use the shared example group, we're creating a database record
[12:56:35] workmad3: stevenxl: i.e. `it_behaves_like "ApiEventManager", :patch, :accept, {id: FactoryGirl.create(:recruiter_submission).token}` <-- that invokes `FactoryGirl.create` at the time the test is loaded
[12:56:42] StevenXL: workmad3: Yup exactly.
[12:56:58] StevenXL: And we do that because the action called by that controller "needs" that record in the db.
[12:57:10] StevenXL: I tried stubbing it out but couldn't get it to work.
[12:57:14] universa1: stevenxl: test is loaded == when the file is initially read in!
[12:57:26] universa1: and not, when the test is actually run.
[12:57:32] StevenXL: I'll paste the relevant controller code
[12:57:41] workmad3: stevenxl: I'd probably suggest you could do this by passing in a proc to run for params, rather than the hash itself
[12:58:44] StevenXL: workmad3: Would I then invoke this proc in the shared examples group? (My understanding is that a proc is just an anonymous function).
[12:58:50] StevenXL: Or is that not the right thing?
[12:58:57] mhenrixon_: has joined #RubyOnRails
[12:58:59] workmad3: stevenxl: which would mean doing ->{ {id: FactoryGirl.create(:recruiter_submission).token } } in the test, and then `action_params.call` when you need the params in the example group (or maybe doing `let(:params) { action_params.call }` in the shared example)
[12:59:02] wd40s: has joined #RubyOnRails
[12:59:19] StevenXL: Oh I like that!
[12:59:26] workmad3: stevenxl: yeah, a proc or lambda is an anonymous function... you'd use it in this case to delay execution
[12:59:47] StevenXL: and since then the code would run in the example group, hopefully that cleans up the records.
[12:59:55] workmad3: stevenxl: so that rather than the factorygirl create happening when the test code is loaded off disk, you'd be doing it inside the test... and therefore inside your transactional fixture
[13:00:26] StevenXL: that is really awesome.
[13:00:38] StevenXL: Can you folks explain to me (or link me) to what you mean by test code is loaded off disk?
[13:00:47] StevenXL: I'm confused as to waht counts as a transaction and what doesnt.
[13:01:10] workmad3: stevenxl: when rspec loads your tests, it basically `require`s all your _spec files
[13:01:49] blackmesa: has joined #RubyOnRails
[13:01:51] workmad3: stevenxl: at that point, the code in those files is run using RSpec`s DSL methods... so things like `describe` blocks and `context` blocks are run immediately to build your test suite, and `it` blocks are stored as tests in order to be run in the actual test run
[13:02:37] workmad3: stevenxl: `it_behaves_like` is then just a normal method call, being run as soon as the test code is loaded by RSpec... and as you probably know, method arguments are evaluated before the method is called
[13:02:55] quazimodo: has joined #RubyOnRails
[13:02:56] quazimod1: has joined #RubyOnRails
[13:04:01] StevenXL: I see. So that code (the factory girl create) is being run when the test suite is being "built". It doesn't run as an example. The transactional fixtures does a rollback after each example (?), and therefore misses the stuff created outside of an example.
[13:04:08] workmad3: stevenxl: then the way that transactional fixtures works is that rspec will start a database transaction before it runs each test, and rolls it back after the test is complete (with the result that any DB changes inside the test are visible to the test but get reset afterwards)
[13:04:18] workmad3: stevenxl: yup, bingo!
[13:04:58] StevenXL: Wow - that's incredible. Thank you so much for that explanation. I'm learning a lot from this issue.
[13:05:14] StevenXL: Very grateful for your and universa1 help!
[13:05:23] freestyl3r: has left #RubyOnRails: ("WeeChat 1.5")
[13:07:39] mhenrixon_: has joined #RubyOnRails
[13:07:44] ramortegui: has joined #RubyOnRails
[13:08:19] rails576: has joined #RubyOnRails
[13:10:06] rails576: Hello my Friends. I am new to rails and wanted to rewrite an app for rails. Now we have a PostgrSQL DB and I want to Read some data. I know how to do that in an Controller but now with a model. Does someone has a good tutorial? The DB is final and should not be managed by rails
[13:11:47] mhenrixo-: has joined #RubyOnRails
[13:12:58] mikecmpb_: has joined #RubyOnRails
[13:14:42] universa1: rails576: data to and from the database is handled through models.
[13:14:51] Didac: has joined #RubyOnRails
[13:15:07] universa1: rails576: it is probably easiest if you learn the rails way first, and then adopt your actual app
[13:15:29] universa1: rails576: you can configure rails to work with mostly any database structure.
[13:15:47] universa1: rails576: !guides
[13:15:47] helpa: rails576: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[13:17:17] jtong: has joined #RubyOnRails
[13:19:40] Rubie: has joined #RubyOnRails
[13:21:33] roshanavand__: has joined #RubyOnRails
[13:22:43] jtong: has joined #RubyOnRails
[13:22:52] rails576: universa1: I already tryed the tutorial and it's easy with models (if rails handles everithink). But if I creade a different model with my database I only got errors
[13:23:04] datamann: has joined #RubyOnRails
[13:23:09] universa1: rails576: what errors?
[13:23:19] universa1: rails576: database schema? code? => gist ;)
[13:24:12] rails576: universa1: I created the model "Projekt" which is empty. When I use "project = Project.all" there is always "undefined method `each' for nil:NilClass"
[13:24:28] sevenseacat: Projekt != Project for starters
[13:24:38] sevenseacat: let's see the actual code with the actual error
[13:24:55] rails576: I will mage a gist
[13:26:19] chouhoulis: has joined #RubyOnRails
[13:27:39] StevenXL: workmad3: I switched from send to public_send, which I think is clearer, and I am sending in a proc to delay the creation of an object. Everything is working great on that one example. Going to try and roll it out to the test.
[13:28:06] rails576: universa1, sevenseacat: https://gist.github.com/donnoc/e1fd78a50c2322928a29ae306e18e51c
[13:29:36] universa1: rails576: !gist-usage -- for future reference
[13:29:36] helpa: rails576: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[13:29:48] AimlessRAven: has joined #RubyOnRails
[13:30:15] AimlessRAven: hey all. For example if i find my product_id in js.. is there a way to find my product in my view with this js id who i catch
[13:31:17] universa1: rails576: https://gist.github.com/universal/22d19c0f3f67453fe893fa1007ac9048#file-gistfile1-txt-L7
[13:31:43] universa1: rails576: in the future also please gist verbose copies of the files, do not leave stuff out... ...it complicates linking errors to the actual line...
[13:31:56] sevenseacat: I think you've left out some code
[13:32:18] sevenseacat: and you should probably change those db credentials
[13:32:18] universa1: rails576: and also copy the full error trace
[13:32:40] rails576: sorry, I will make a new gist
[13:32:53] AimlessRAven: i mean.. i have js variable who handle an id. Now i wanna find product with this id
[13:32:56] AimlessRAven: with my js variable
[13:32:57] universa1: rails576: and the error also shows: the error happens in your view, not while you query
[13:33:07] universa1: AimlessRaven: where is the js executed?
[13:33:21] l4v2: has joined #RubyOnRails
[13:33:53] AimlessRAven: universa1: in my view
[13:34:04] jtong: has joined #RubyOnRails
[13:34:20] universa1: AimlessRaven: on your server or on a clients computer? where is your database?
[13:35:07] AimlessRAven: universa1: in my computer
[13:35:10] AimlessRAven: localhost:3000
[13:35:19] mikecmpbll: has joined #RubyOnRails
[13:35:23] universa1: AimlessRaven: o0
[13:35:24] yoongkang: has joined #RubyOnRails
[13:35:48] rails576: universa1: yes the error is in the view, but only because there is no data
[13:36:10] rails576: sevenseacat: https://gist.github.com/donnoc/7ed6a435d8ec26724140d3f4667daa46
[13:36:13] universa1: rails576: ok, what is the rails convention for table names?
[13:37:32] kitsuneyo: has joined #RubyOnRails
[13:37:51] universa1: AimlessRaven: is this your final answer?
[13:37:51] rails576: universa1: I don't know. but the Database is already set, I can't change it
[13:38:09] universa1: rails576: well... so change your model?
[13:38:22] banisterfiend: has joined #RubyOnRails
[13:38:29] rails576: universa1: what to change in the model? it's empty o.O ?
[13:38:29] universa1: rails576: this is why i said early on you should learn the rails way first, to know what you have to adopt.
[13:38:39] fmcgeough: has joined #RubyOnRails
[13:38:42] universa1: rails576: is your table name what rails expects?
[13:39:00] pawnbox: has joined #RubyOnRails
[13:39:26] universa1: rails576: *hint: it is not*
[13:39:38] rails576: universa1: as I said, I don't know. The Table Name is "project" and I created a Model "Project". You mean because of the capital?
[13:39:40] eGGshke: has joined #RubyOnRails
[13:39:46] universa1: rails576: no.
[13:40:06] universa1: rails576: for a Project model, the table name would be projects.
[13:40:20] universa1: rails576: so you have to tell rails, that it is not projects, but project.
[13:40:46] hannelita: has joined #RubyOnRails
[13:41:38] universa1: rails576: http://api.rubyonrails.org/classes/ActiveRecord/ModelSchema/ClassMethods.html#method-i-table_name-3D
[13:43:33] rails576: universa1: hmm ... thank you very much. I will read that and try to learn the "ruby way"
[13:43:41] JamieD: has joined #RubyOnRails
[13:45:45] jtong: has joined #RubyOnRails
[13:46:38] universa1: rails576: yw :-) and this circles back to learning the rails way first, rails is driven by a lot of conventions, which usually make the life simple, but in your case will make it harder
[13:51:28] chouhoulis: has joined #RubyOnRails
[13:51:35] jtong: has joined #RubyOnRails
[13:52:03] datamann: convention over configuration is great for some things :D you may hear yourself saying "Convention over configuration they say" in your head over and over good luck!
[13:52:18] Limix: has joined #RubyOnRails
[13:52:57] rails576: universa1: yeah ... It's hard if you only use PHP or Java and now Rails. Not as easy as I thought ^^.
[13:53:20] Zadrel: has joined #RubyOnRails
[13:53:24] jtong: has joined #RubyOnRails
[13:53:32] roshanavand__: has joined #RubyOnRails
[13:58:57] macsteps: has joined #RubyOnRails
[13:59:22] rails576: universa1: it worked with "self.table_name = "project" in the model. Thank you =D
[14:04:01] pawnbox: has joined #RubyOnRails
[14:05:17] Kedare: has joined #RubyOnRails
[14:06:19] pawnbox: has joined #RubyOnRails
[14:06:20] kaww: has joined #RubyOnRails
[14:09:34] artto_: has joined #RubyOnRails
[14:12:00] artto: has joined #RubyOnRails
[14:13:26] barajasfab: has joined #RubyOnRails
[14:14:05] srinidhi: has joined #RubyOnRails
[14:17:41] adkoge: has joined #RubyOnRails
[14:18:04] artto: has joined #RubyOnRails
[14:19:03] Axilla: has joined #RubyOnRails
[14:21:25] mikecmpb_: has joined #RubyOnRails
[14:22:51] Oliphaunte: has joined #RubyOnRails
[14:23:04] axl_: has joined #RubyOnRails
[14:23:30] theunraveler: has joined #RubyOnRails
[14:25:07] jtong_: has joined #RubyOnRails
[14:25:31] JamieD: has joined #RubyOnRails
[14:26:46] Limix: has joined #RubyOnRails
[14:27:42] Pupeno: has joined #RubyOnRails
[14:28:17] axl_: has joined #RubyOnRails
[14:31:34] macsteps: has joined #RubyOnRails
[14:31:35] sdwrage: has joined #RubyOnRails
[14:32:21] rafaelfranca: has joined #RubyOnRails
[14:33:33] andywww: has joined #RubyOnRails
[14:34:34] adkoge1: has joined #RubyOnRails
[14:34:54] andywww: i’ve recently moved over to postgres and when running rake db:purge, I’m getting a frustrating “There is 1 other session using the database.” because frankly i don’t care, can I force this somehow?
[14:35:16] kallisti5: andywww: maybe stop the web server?
[14:35:19] andywww: the goolgling i’ve done suggests you need to run some query from within postgres, is this the case?
[14:35:30] kallisti5: or kill off any reque tasks?
[14:35:36] kallisti5: (aka, anything using the database)
[14:35:50] kallisti5: you could also try rake db:drop if you want to toss everything
[14:35:57] kallisti5: then re-migrate / seed
[14:35:59] andywww: it was the web server
[14:36:00] andywww: thanks for that
[14:36:21] andywww: is purge not the same as drop?
[14:36:46] kallisti5: http://jacopretorius.net/2014/02/all-rails-db-rake-tasks-and-what-they-do.html
[14:37:05] andywww: yeah just on that, cheers
[14:37:26] kallisti5: no worries.. never actually heard of purge.. maybe something new in rails 5?
[14:37:47] andywww: a fair few of them seem to be shortcuts for combinations so it gets confusing
[14:38:09] andywww: “db:purge Empties the database for the current environment”
[14:38:12] andywww: apparently
[14:38:17] kallisti5: heh... i generally just mash in rails db:* commands until something happens"
[14:38:30] kallisti5: although that's bitten me before ^_^
[14:38:37] polishdub: has joined #RubyOnRails
[14:38:46] andywww: me too to be honest
[14:39:25] Takumo: Quick question, is there a way to override the behaviour of a `resource(s)` route to change the model field used as the identifier in the url
[14:39:36] Takumo: I want to use a unique random value in the url
[14:39:46] kitsuneyo: has joined #RubyOnRails
[14:40:29] rgiscard: has joined #RubyOnRails
[14:40:56] mikecmpbll: has joined #RubyOnRails
[14:42:28] tjbiddle: has joined #RubyOnRails
[14:42:53] pawnbox_: has joined #RubyOnRails
[14:43:19] tbuehlmann: Takumo: you want to override your model's #to_param method and add a `param: :random_value` to your resources route
[14:44:10] Takumo: tbuehlmann: thanks!
[14:44:34] tbuehlmann: see http://guides.rubyonrails.org/routing.html#overriding-named-route-parameters and http://api.rubyonrails.org/classes/ActiveModel/Conversion.html#method-i-to_param
[14:45:17] dionysus69: has joined #RubyOnRails
[14:45:26] wd40s: has joined #RubyOnRails
[14:47:10] sypheren: has joined #RubyOnRails
[14:48:20] The_Phoenix: has joined #RubyOnRails
[14:49:19] adavia: has joined #RubyOnRails
[14:53:17] Macaveli: has joined #RubyOnRails
[14:53:23] Velizar: How can I make this code work? Trip.find(params[:id]).includes(trip_items: :visit_constraints)
[14:53:36] Velizar: It complains because .includes is not a method on a single object
[14:53:49] prithaj: has joined #RubyOnRails
[14:54:07] SteenJobs: has joined #RubyOnRails
[14:54:47] Velizar: I could use where(id: params[:id]).includes(..).first, but that's not ideal because it returns nil instead of error if there the record is not found
[14:56:12] dlite: has joined #RubyOnRails
[14:57:14] pawnbox: has joined #RubyOnRails
[14:58:13] Velizar: I fixed it
[14:58:33] Derperperd: has joined #RubyOnRails
[14:58:37] mcqr: has joined #RubyOnRails
[14:59:50] rickmasta: has joined #RubyOnRails
[15:00:27] crystal77: has joined #RubyOnRails
[15:01:53] Pupeno: has joined #RubyOnRails
[15:07:16] dmz: has joined #RubyOnRails
[15:08:50] pawnbox: has joined #RubyOnRails
[15:12:55] one_zero: has joined #RubyOnRails
[15:13:39] weaksauce: has joined #RubyOnRails
[15:15:13] dopamean_: has joined #RubyOnRails
[15:18:11] weckl_: has joined #RubyOnRails
[15:21:31] adre: has joined #RubyOnRails
[15:24:22] dionysus69: has joined #RubyOnRails
[15:25:12] Velizar: Is it possible to update multiple fields at the same time with just one query, rather than n queries? I don't get it why Model.update(records.keys, records.values) generates n queries.
[15:25:44] sdwrage: has joined #RubyOnRails
[15:25:56] AndrewIsHere: has joined #RubyOnRails
[15:27:25] wd40s: has joined #RubyOnRails
[15:28:37] noble_beast: has joined #RubyOnRails
[15:28:43] weckl__: has joined #RubyOnRails
[15:30:26] disgrntld: has joined #RubyOnRails
[15:31:53] vikram__________: has joined #RubyOnRails
[15:32:10] tfitts: has joined #RubyOnRails
[15:33:57] tlarevo: has joined #RubyOnRails
[15:34:07] srinidhi: has joined #RubyOnRails
[15:34:12] blackmesa: has joined #RubyOnRails
[15:36:01] rickmasta: has joined #RubyOnRails
[15:37:55] artto: has joined #RubyOnRails
[15:38:34] The_Phoenix: has joined #RubyOnRails
[15:38:35] barhum2013: has joined #RubyOnRails
[15:38:42] Velizar: This is what it should generate: http://stackoverflow.com/a/2528188/1466212 [on a side note, why is SQL so damn redundant? ugh]
[15:38:56] Velizar: except with one column only
[15:40:13] wd40s: has joined #RubyOnRails
[15:40:31] yoongkang: has joined #RubyOnRails
[15:41:17] sumobob: has joined #RubyOnRails
[15:42:28] seap: has joined #RubyOnRails
[15:42:51] ych: has joined #RubyOnRails
[15:42:52] shinnya: has joined #RubyOnRails
[15:46:18] matthewd: Velizar: No.
[15:48:04] wd40s: has joined #RubyOnRails
[15:49:52] agent_white: has joined #RubyOnRails
[15:50:34] bga57: has joined #RubyOnRails
[15:50:45] dunpeal: has joined #RubyOnRails
[15:51:58] tjohnson: has joined #RubyOnRails
[15:54:16] agent_white: Mornin' folks
[15:55:10] artto: has joined #RubyOnRails
[15:55:43] jhack: has joined #RubyOnRails
[15:57:36] ur5us: has joined #RubyOnRails
[15:58:33] yottanami: has joined #RubyOnRails
[15:59:02] Pupeno: has joined #RubyOnRails
[16:00:09] yottanami: This is my query in rails http://dpaste.com/1TJH43B and as you see the start_time is nil but in database it is not nil you can check here http://dpaste.com/10KXVF0 why it can not load this value?
[16:02:34] minotep: has joined #RubyOnRails
[16:02:38] pawnbox: has joined #RubyOnRails
[16:02:57] acovrig: has joined #RubyOnRails
[16:03:03] [Butch]: has joined #RubyOnRails
[16:04:08] yottanami: and the raw sql using Activerecord works correct
[16:04:08] acovrig: I have 2 tables, profiles and forms, profiles has a column ‘default_form’ that should have a foreign_key to forms/uri (uri being the column it references); ‘add_foreign_key :profiles, :forms: column: :uri’ is what I was thinking; but it keeps referencing forms/id…
[16:04:55] acovrig: I’ve also tried add_foreign_key :profiles, :forms, column: :default_form, foreign_key: :uri
[16:05:48] srinidhi: has joined #RubyOnRails
[16:07:15] IFrank00: has joined #RubyOnRails
[16:07:21] nacsurte: has joined #RubyOnRails
[16:08:44] zpe: has joined #RubyOnRails
[16:10:36] JamieD: has joined #RubyOnRails
[16:11:03] czerasz: has joined #RubyOnRails
[16:15:10] syndikate: has joined #RubyOnRails
[16:15:41] cschneid_: has joined #RubyOnRails
[16:16:46] alfiemax: has joined #RubyOnRails
[16:18:40] ldnunes: has joined #RubyOnRails
[16:18:53] Polysics: has joined #RubyOnRails
[16:19:44] Devalo: has joined #RubyOnRails
[16:19:49] Polysics: hello! for reporting reasons, I need to pull documents for a contact. Documents are of various types, each belongs_to Contact
[16:20:02] Polysics: do I need to query for each type separately?
[16:22:49] arup_r: has joined #RubyOnRails
[16:24:01] arup_r: Hi I am trying to pick the orders which has only 1 line items and the product name is 'Anti-Cyst Treatment'. But my query picking orders which has more then 1 line items also. Can you tell me what wrong I did https://gist.github.com/aruprakshit/e5145f79cc4e4b914d1b727d2b8fed37 ?
[16:24:14] arup_r: 1 line item*
[16:27:27] conta: has joined #RubyOnRails
[16:27:37] Scrivener: has joined #RubyOnRails
[16:29:39] Pupeno: has joined #RubyOnRails
[16:30:14] ddyba: has joined #RubyOnRails
[16:30:52] jtong: has joined #RubyOnRails
[16:32:48] sdwrage: has joined #RubyOnRails
[16:35:34] blackmesa: has joined #RubyOnRails
[16:35:49] ddyba: I'm trying to run the `rails runner 'UserMigrationJob.some_task'` command; I've generated a job using the `rails g job user_migration` command
[16:36:13] tlarevo: has joined #RubyOnRails
[16:36:24] ddyba: After running the `rails runner` command, I get an error about the UserMigrationJob class not being defined
[16:37:02] ddyba: I'm wondering if I'm missing an additional step to get this to work.
[16:38:13] ddyba: I'm running on Rails; I just verified that the app/jobs folder isn't in the $LOAD_PATH
[16:40:57] ddyba: The Rails Guides for has documentation on ActiveJob and how custom ActiveJob classes can be defined in the app/jobs folder
[16:40:58] cnk: has joined #RubyOnRails
[16:41:55] yoongkang: has joined #RubyOnRails
[16:45:59] Scrivener: I'm using the puma application server (puma.io) to serve a rails app. If anyone's familiar with it, I have an app I was attempting to run in prod env on my local host. I expected the app to run and return a database connection error or related message, however, puma never seemed to return any error output at all, and would not respond to anything except a kill -9. Here's a gist containing my logged output of attempting to run puma, and
[16:45:59] Scrivener: my puma.rb -- https://gist.github.com/michael-endsley/99732b8c3c6329124612e9a82da33e8a
[16:46:44] Scrivener: I know this must be related to the part of the config where database connection is established (at worker boot), because if I change the app config to point at my development database, it works just fine.
[16:46:58] Scrivener: Does anyone know what I'm missing in order to get error output about this, though?
[16:47:08] tvw: has joined #RubyOnRails
[16:47:10] weckl_: has joined #RubyOnRails
[16:47:23] rickmasta: has joined #RubyOnRails
[16:48:09] Scrivener: It was a confusing mystery hang for a while.
[16:48:21] Cohedrin: has joined #RubyOnRails
[16:51:00] noble_beast: has joined #RubyOnRails
[16:54:56] roshanavand__: has joined #RubyOnRails
[16:56:22] cnk: Nothing in the rails production log?
[16:57:58] _djbkd: has joined #RubyOnRails
[16:58:50] rollinDyno: has joined #RubyOnRails
[17:01:41] rogue_koder: has joined #RubyOnRails
[17:03:57] Devalo: has joined #RubyOnRails
[17:04:42] Pupeno: has joined #RubyOnRails
[17:05:04] jtong: has joined #RubyOnRails
[17:06:12] crystal77: has joined #RubyOnRails
[17:09:46] acovrig: how do I specify the foriegn key in a relationship (usually :id, but not in this case)
[17:13:01] DoctorMonocular: has joined #RubyOnRails
[17:13:29] arup_r: has joined #RubyOnRails
[17:16:11] macsteps: has joined #RubyOnRails
[17:17:41] pawnbox: has joined #RubyOnRails
[17:17:59] dionysus69: has joined #RubyOnRails
[17:18:10] pLaTo0n: has joined #RubyOnRails
[17:18:10] pLaTo0n: has joined #RubyOnRails
[17:18:27] harfangk: has joined #RubyOnRails
[17:19:03] cnk: there is an arg for that - look at the AR relations docs
[17:19:16] cnk: I think it is foreign_key but you will need to double check
[17:19:55] pLaTo0n: has joined #RubyOnRails
[17:19:55] pLaTo0n: has joined #RubyOnRails
[17:20:28] acovrig: cnk: in the past I’ve used add_foreign_key :orders, :users, column: :placed_by_id, foreign_key: :id; but when it seems to be ignoring my foreign_key: :uri in this case
[17:20:45] jhack: has joined #RubyOnRails
[17:21:12] Limix: has joined #RubyOnRails
[17:21:13] cnk: context?
[17:21:17] cnk: please show code
[17:21:34] solars: has joined #RubyOnRails
[17:22:18] adam^: Has anybody ever benchmarked puma for serving static assets? I wonder how much of a performance hit there actually is.
[17:23:40] adam^: (vs reverse proxy obv)
[17:24:28] IFrank00: has joined #RubyOnRails
[17:24:59] pawnbox: has joined #RubyOnRails
[17:30:32] shinnya: has joined #RubyOnRails
[17:30:48] _sjs: has joined #RubyOnRails
[17:32:13] Devalo: has joined #RubyOnRails
[17:37:00] blackmesa: has joined #RubyOnRails
[17:39:35] Leepoff: has joined #RubyOnRails
[17:40:23] noble_beast: has joined #RubyOnRails
[17:42:54] Leepoff: has joined #RubyOnRails
[17:43:34] roshanavand__: has joined #RubyOnRails
[17:43:39] yoongkang: has joined #RubyOnRails
[17:43:44] mostlybadfly: has joined #RubyOnRails
[17:44:34] matthewd: adam^: It apparently works well enough for heroku.. but it's not puma's intended deployment environment
[17:44:40] SteenJobs: has joined #RubyOnRails
[17:45:16] theRoUS: has left #RubyOnRails: ("Off to another part of the maze of twisty little passages")
[17:48:11] hastur: has joined #RubyOnRails
[17:48:16] Oliphaunte: has joined #RubyOnRails
[17:48:42] yoongkang: has joined #RubyOnRails
[17:49:34] djdarkbeat: has joined #RubyOnRails
[17:50:53] Dimik: has joined #RubyOnRails
[17:51:04] dunpeal: has joined #RubyOnRails
[17:53:34] dionysus69: has joined #RubyOnRails
[17:54:02] guacamole: has joined #RubyOnRails
[17:55:46] yfeldblum: has joined #RubyOnRails
[17:56:25] Scrivener: cnk, sorry about the late reply, but no, there was nothing in the production log
[17:57:12] Scrivener: The puma workers were never spawned, it simply hung at that step and nothing was generated.
[17:57:30] cnk: Ya those "died before saying anything'" problems are hard to figure out
[17:57:57] roshanavand__: has joined #RubyOnRails
[17:58:02] cnk: you may need to strace the parent and see what it did just before it hung
[17:58:44] Scrivener: cnk, I actually tried that and ran into even more issues (using strace on alpine linux in docker) that I tried to debug before I just switched the database config
[17:58:55] Scrivener: But this isn't a strace help channel :)
[17:59:37] cnk: I hear docker is great - except when it isn't
[17:59:40] sdwrage: has joined #RubyOnRails
[18:00:00] Scrivener: I don't think docker is the problem here, but alpine might be.
[18:00:02] nacsurte: has joined #RubyOnRails
[18:00:06] Scrivener: Well, with strace that is.
[18:02:17] jstransky: has joined #RubyOnRails
[18:02:58] dionysus69: has joined #RubyOnRails
[18:03:31] adam^: matthewd: Yeah - I know that Heroku expects some sort of CDN in front, so maybe that's why?
[18:03:50] zpe: has joined #RubyOnRails
[18:06:00] SteenJobs: has joined #RubyOnRails
[18:06:29] zacts: has joined #RubyOnRails
[18:06:39] Sdwrage_: has joined #RubyOnRails
[18:07:09] minotep: has joined #RubyOnRails
[18:07:20] mikecmpbll: has joined #RubyOnRails
[18:07:40] adavia: can i render a jbuilder template within a data attribute?
[18:08:04] matthewd: adavia: partial?
[18:08:29] adavia: matthewd: yes
[18:09:11] adavia: something like render(template: "notifications/index", formats: [:json])
[18:09:20] Sdwrage__: has joined #RubyOnRails
[18:09:26] matthewd: adavia: .. does that work?
[18:09:36] dionysus69: has joined #RubyOnRails
[18:09:47] adavia: well it brings me up an empty array
[18:10:10] adavia: no matter what i have in the jbuilder
[18:13:20] kwerle: has joined #RubyOnRails
[18:13:29] duncannz: has joined #RubyOnRails
[18:13:32] Scrivener: cnk, docker was the barrier there indeed (with strace). It had to be run with --privileged
[18:13:47] Scrivener: Maybe will find out what's going on with puma now
[18:13:55] cnk: Hope so
[18:14:01] duncannz: has joined #RubyOnRails
[18:14:06] roshanavand__: has joined #RubyOnRails
[18:14:56] dlite: has joined #RubyOnRails
[18:15:19] kwerle: I have noticed that the type field for a polymorphic model may not be “not nullable” to work with rails - and that makes me sad. I wonder why rails does not assign the type until after the initial insert and I wonder if there is a workaround for this behavior.
[18:15:39] rickmasta: has joined #RubyOnRails
[18:16:50] banisterfiend: has joined #RubyOnRails
[18:17:27] cnk: kwerle: interesting. My guess is there is some part of the save machinery where you have one part but not the other.
[18:17:51] kwerle: Ugh. I see I can ‘before_validation :assign_temporary_type’
[18:17:52] cnk: If you sneak into the db and make that change, you might trigger the exception that is why you can't do that
[18:18:04] kwerle: def assign_temporary_type self.describable_type ||= 'temp' end
[18:18:05] cnk: that's quite odd
[18:18:24] cnk: what are you doing that you don't have the type at the time?
[18:18:33] kwerle: Oh - I totally do!
[18:18:53] kwerle: t.create_description - where t is a Thing and description is a polymorphic..
[18:19:02] kwerle: Rails is inserting the description without a type.
[18:19:12] kwerle: But with the foreign id, interestingly.
[18:19:33] cnk: that is very odd
[18:19:42] kwerle: That’s what I was thinking.
[18:19:45] conta: has joined #RubyOnRails
[18:19:47] kwerle: Oh - this is 4.2.6 by the way.
[18:19:51] kwerle: Have not tried on 5
[18:19:53] cnk: I haven't ever had trouble with polymorphic inheritance
[18:20:08] kwerle: Yeah, I just wanted to be strict with the db and make the type not nullable.
[18:20:21] kwerle: If it’s nullable it works.
[18:20:33] cnk: and if you make it not nullable?
[18:20:49] banisterfiend: Hi, i'm getting 'invalid authenticity token' errors when POSTing to an endpoint using js. I did have the js at the bottom of my view (in a :javascript block), and i did not get the error. But when i moved the JS out into a different location, i now get the error. Anyone know why?
[18:20:49] kwerle: ActiveRecord::StatementInvalid: SQLite3::ConstraintException: NOT NULL constraint failed: descriptions.describable_type: INSERT INTO "descriptions" ("describable_id", "created_at", "updated_at") VALUES (?, ?, ?)
[18:21:30] kwerle: That really seems like a bug to me. I’m sure there’s a reason for it, but ...
[18:21:45] cnk: show the code that is doing that insert
[18:21:59] kwerle: irb(main):004:0> t.create_description
[18:22:21] cnk: so how does that know which kind of description you want?
[18:23:05] kwerle: t is a Thing. It is creating a description. describable_type must be :Thing.
[18:23:09] adre: has joined #RubyOnRails
[18:23:25] kwerle: irb(main):012:0> t.description(true)
[18:23:25] kwerle: Description Load (3.0ms) SELECT "descriptions".* FROM "descriptions" WHERE "descriptions"."describable_id" = ? AND "descriptions"."describable_type" = ? LIMIT 1 [["describable_id", 1], [nil, "Thing"]]
[18:23:39] kwerle: You can query for the description and it does the right thing.
[18:24:06] kwerle: That seems like a scope qualifier - right? Why would the create_description not do the right thing with type, but it does the right thing with id?
[18:24:31] kwerle: And if I add that hack, it does do the right thing - but magically...
[18:24:38] cnk: I really can't tell without seeing content of your models and what data you hve for that craete
[18:24:50] SteenJobs: has joined #RubyOnRails
[18:24:57] kwerle: There is no code. I’m going to be rude and paste it...
[18:25:04] kwerle: class Thing < ActiveRecord::Base
[18:25:05] kwerle: has_one :description, as: :describable, foreign_type: :describable_type, foreign_key: :describable_id, :dependent => :destroy
[18:25:22] kwerle: class Description < ActiveRecord::Base
[18:25:23] kwerle: belongs_to :describable, polymorphic: true, foreign_type: :describable_type, foreign_key: :describable_id
[18:25:24] cnk: no - all the models in a paste
[18:25:29] cnk: not in line
[18:25:33] kwerle: There it is. All 6 lines.
[18:25:53] sagax: has joined #RubyOnRails
[18:26:26] Limix: Hi all, how can I access a host from a ruby config file example: config.redis = { url: redis }
[18:26:41] Limix: where redis is a host name created by docker
[18:26:49] kwerle: There really is nothing to it. If you create a project and:
[18:26:51] kwerle: rails g scaffold Thing name:string
[18:27:01] kwerle: rails g scaffold Description text:string describable_type:string describable_id:integer
[18:27:06] kwerle: You’re done.
[18:27:12] zpe: has joined #RubyOnRails
[18:27:19] Dimik--: has joined #RubyOnRails
[18:27:39] kwerle: Oh - and edit the schema so they are not nullable...
[18:27:56] kwerle: Once you do that it starts breaking.
[18:28:28] sagax: make project by docker container - it's true way?
[18:28:32] cnk: Been a while but I think "belongs_to :describable" means there needs to be a Describable model
[18:28:57] cnk: sagax: not in my book
[18:29:10] kwerle: sagax: but it is in mine!
[18:29:11] cnk: If you have docker experience, perhaps. But what is your use case?
[18:29:20] SteenJobs: has joined #RubyOnRails
[18:31:00] Oliphaunte: has joined #RubyOnRails
[18:31:28] sagax: hm, i think my case it's - to isolate projects among themselves on one server
[18:31:29] Pupeno: has joined #RubyOnRails
[18:32:14] sagax: to isolate projects on one server
[18:32:26] cnk: because you want to limit resources for some projects?
[18:33:11] sagax: no, i have physical server,
[18:33:24] sagax: without limit,
[18:33:36] IFrank00: has joined #RubyOnRails
[18:33:38] cnk: well there is a practical limit
[18:33:49] cnk: but what are you afraid of leaking ?
[18:34:10] sagax: i think that isolate database and environment - it's not bad idea
[18:34:15] cnk: apache vhosts and turning off symlink following is enough isolation for most of what I need
[18:34:22] macsteps: has joined #RubyOnRails
[18:35:00] cnk: fences are great - unless you want ot go from A to B and the fence is in your way
[18:35:32] qejk: has joined #RubyOnRails
[18:35:35] cnk: so what are you afraid of mixing that "isolate" is a thing you need more of?
[18:35:55] cnk: It may be the right thing in your case, but so far, you haven't articulated why
[18:38:03] sagax: just i reading about docker and thinking about - where i apply this case?
[18:38:13] roshanavand__: has joined #RubyOnRails
[18:38:20] blackmesa: has joined #RubyOnRails
[18:38:29] SteenJobs: cnk: what about using nginx to isolate?
[18:39:09] cnk: I expect so
[18:39:10] SteenJobs: cnk: like i have a wordpress app running as a subdirectory to my rails app, but they’re isolated presumably…bec nginx just reroutes based on the url
[18:39:35] cnk: yes - as long as it can't do any shnanigans iwth symlinks
[18:39:40] SteenJobs: isolated in the sense that they’re in totally separate directories on the server, if that’s what we mean by isolate?
[18:39:47] SteenJobs: what kind of shenanigans? uh oh..
[18:42:02] rollinDyno: has joined #RubyOnRails
[18:42:29] pawnbox: has joined #RubyOnRails
[18:43:02] jtong: has joined #RubyOnRails
[18:43:27] roshanavand__: has joined #RubyOnRails
[18:43:48] airdisa: has joined #RubyOnRails
[18:43:54] jtong: has joined #RubyOnRails
[18:44:12] Derperperd: has joined #RubyOnRails
[18:47:39] rakm: has joined #RubyOnRails
[18:48:37] JamieD: has joined #RubyOnRails
[18:48:41] rakm: is any one using capistrano with rbenv? i installed the capitrano-rbenv gem and required it in my capfile, but a simple task with execute "which rbenv" is failing and i'm not sure what else i need to add
[18:50:41] blackmesa: has joined #RubyOnRails
[18:51:16] fryguy: i use capistrano with rbenv, but I don't use the rbenv plugin
[18:51:56] rakm: fryguy how do you make sure the env is loaded?
[18:53:28] rafaelfranca: has joined #RubyOnRails
[18:53:29] rafaelfranca: has joined #RubyOnRails
[18:54:25] fryguy: i load the env in /etc/profile
[18:56:52] mikecmpbll: has joined #RubyOnRails
[19:00:30] IFrank00: has joined #RubyOnRails
[19:00:34] djbkd_: has joined #RubyOnRails
[19:01:02] blackmesa: has joined #RubyOnRails
[19:01:32] djbkd_: has joined #RubyOnRails
[19:03:24] jtong: has joined #RubyOnRails
[19:04:51] theunraveler: has joined #RubyOnRails
[19:06:55] Jasaka: has joined #RubyOnRails
[19:10:24] kwerle: sagax: docker because you isolate your dependencies - including rails version, crazy dependencies like imagemagik, and all that stuff. And so that folks who want to do work on windows/macos can do so. Everyone uses docker and has everything the same.
[19:11:47] chouhoulis: has joined #RubyOnRails
[19:13:09] sagax: kwerle, ok, thank, i got it
[19:13:42] mikecmpbll: has joined #RubyOnRails
[19:14:15] cnk: which is worth the initial overhead if everyone.size is large enough
[19:14:45] dionysus69: has joined #RubyOnRails
[19:15:00] IFrank00: has joined #RubyOnRails
[19:16:37] SteenJobs: has joined #RubyOnRails
[19:18:35] dlite: has joined #RubyOnRails
[19:21:30] dunpeal: has joined #RubyOnRails
[19:22:37] rickmasta: has joined #RubyOnRails
[19:24:40] yardenbar: has joined #RubyOnRails
[19:30:11] Axilla: has joined #RubyOnRails
[19:30:49] _djbkd: has joined #RubyOnRails
[19:31:31] jtong: has joined #RubyOnRails
[19:32:31] dlite: has joined #RubyOnRails
[19:32:59] meoblast001: has joined #RubyOnRails
[19:35:54] Derperperd: has joined #RubyOnRails
[19:39:14] alfy: has joined #RubyOnRails
[19:39:22] solars: has joined #RubyOnRails
[19:40:44] eyeamaye: has joined #RubyOnRails
[19:41:13] Pupeno: has joined #RubyOnRails
[19:41:37] blackmesa: has joined #RubyOnRails
[19:41:47] eyeamaye: could someone tell me if what i'm doing in the controller here is safe? http://pastie.org/private/8xiizatxwl1yekthyyszug
[19:41:58] eyeamaye: specifically the create method
[19:42:49] minotep: has joined #RubyOnRails
[19:42:52] eyeamaye: additionally, am i correct in thinking this kind of logic belongs in the controller, or is it more suited in the model, maybe via the before_save callback?
[19:43:18] akshat: has joined #RubyOnRails
[19:43:24] adam^: I'm assuming you're using a plain text field for date
[19:43:30] dionysus69: has joined #RubyOnRails
[19:43:31] adam^: and not the date helper from rails?
[19:44:12] eyeamaye: adam, i'm using date field in postgres
[19:44:20] eyeamaye: on the views though, yes
[19:44:24] adam^: I'm talking on the HTML side.
[19:44:26] eyeamaye: it's a plain text field and not the date helper
[19:44:34] adam^: Interesting. It's not typecast for you properly without it?
[19:44:59] sid_fules: has joined #RubyOnRails
[19:45:08] eyeamaye: to be clear, i'm NOT using the date_field
[19:45:36] eyeamaye: i'm not opposed to using it but i'm using uh. gem 'bootstrap-datepicker-rails'
[19:45:47] adam^: Does this code actually work? I would assume that sign_up_params is a method that returns a new object every time.
[19:45:52] eyeamaye: yes the code works
[19:46:01] adam^: And without the code it doesn't?
[19:46:10] eyeamaye: let me see if it saves
[19:46:11] mbd2: has joined #RubyOnRails
[19:46:33] adam^: I just figured ActiveRecord would typecast a m/d/y date properly, without you parsing it in the middle.
[19:46:51] eyeamaye: okay yes it saves
[19:47:07] eyeamaye: so the code works
[19:47:19] eyeamaye: i would assume activerecord would typecast it for me too but
[19:47:22] eyeamaye: i guess not
[19:47:26] eyeamaye: maybe if i was using the date_field
[19:47:30] eyeamaye: i suppose i can try it
[19:48:51] adam^: And the column is a date type in postgres?
[19:49:04] eyeamaye: date_field actually has a date picker
[19:49:10] eyeamaye: it feels pretty terrible to use but
[19:49:13] jenrzzz: has joined #RubyOnRails
[19:49:13] jenrzzz: has joined #RubyOnRails
[19:49:24] eyeamaye: it has one. didn't know that
[19:49:31] kwerle: has joined #RubyOnRails
[19:49:33] adam^: Well you should be able to get by just fine. The fact that ActiveRecord isn't typecasting your "m/d/Y" string into a postgres date is more alarming.
[19:49:52] kwerle: Yes, but the overhead for using docker is very very small.
[19:50:10] eyeamaye: adam^: soa re you saying that without any doubt, activerecord should be typecasting for me?
[19:50:19] eyeamaye: s/soa re/so are/
[19:50:26] adam^: I've never seen it not...
[19:50:43] Axilla: has joined #RubyOnRails
[19:50:46] adam^: You could try it in the console.
[19:50:51] eyeamaye: yeah i should
[19:50:54] eyeamaye: let me see about that
[19:51:07] IFrank00: has joined #RubyOnRails
[19:52:01] eyeamaye: so this is nil
[19:52:35] eyeamaye: User.new(email: "walkk@test", password: "temppass", birthday: "05/31/2010")
[19:52:35] eyeamaye: => #<User id: nil, email: "walkk@test", username: nil, lonlat: nil, bio: nil, created_at: nil, updated_at: nil, birthday: nil, name: nil, gender: nil>
[19:52:49] eyeamaye: do i need anything in the model to direct activerecord to cast it?
[19:53:17] srinidhi: has joined #RubyOnRails
[19:54:59] adam^: Nope. Weird.
[19:55:03] adam^: Maybe I'm crazy.
[19:55:32] eyeamaye: well i guess back to my original question then
[19:55:43] Axilla: has joined #RubyOnRails
[19:55:53] adam^: I'd be more likely to stick it in the model..
[19:55:54] eyeamaye: is using DateTime.strptime in the controller safe?
[19:56:00] eyeamaye: why in the model?
[19:56:35] adam^: It's a data concern. Why should controller care how model wants the data formatted?
[19:57:27] rickmasta: has joined #RubyOnRails
[19:58:06] eyeamaye: hmm. im not sure why but i kinda see it as being controller responsibility because i feel like the model shouldn't be responsible for formatting data.
[19:58:30] eyeamaye: if the model took input from multiple sources, in multiple formats, it would get messy
[19:58:54] eyeamaye: but if the respective controllers formatted the data to fit into the model's constraints, everything would be pretty clean
[20:00:02] whathappens: has joined #RubyOnRails
[20:00:57] FCser: has joined #RubyOnRails
[20:02:00] sid_fules: has joined #RubyOnRails
[20:04:50] matthewd: FWIW, AR *is* typecasting... that's why the value is ending up nil
[20:05:48] eyeamaye: matthewd, can you please explain?
[20:05:57] dlite: has joined #RubyOnRails
[20:06:18] matthewd: Ruby parses dates as d/m/Y; your value is invalid --> nil
[20:06:39] rakm: has joined #RubyOnRails
[20:07:13] matthewd: (the original value should be in birthday_before_type_cast)
[20:07:26] Oliphaunte: has joined #RubyOnRails
[20:17:30] srinidhi: has joined #RubyOnRails
[20:17:36] pawnbox: has joined #RubyOnRails
[20:18:11] zacts: has joined #RubyOnRails
[20:20:20] antgel: has joined #RubyOnRails
[20:20:45] srinidhi: has joined #RubyOnRails
[20:24:29] _djbkd: has joined #RubyOnRails
[20:24:31] srinidhi: has joined #RubyOnRails
[20:25:41] dionysus70: has joined #RubyOnRails
[20:27:13] ur5us: has joined #RubyOnRails
[20:31:39] DoctorMonocular: has joined #RubyOnRails
[20:32:40] Scrivener: I saw in bundler's docs that it remembers some options between calls to bundle/the bundler runtime (such as --without). I'm having an issue where an option I pass at one point isn't being remembered later. Anyone know of a good explanation regarding *how* bundler remembers options?
[20:32:44] Scrivener: Does it store this somewhere?
[20:33:14] adam^: Scrivener: .bundle/config
[20:33:19] fryguy: Scrivener: in the .bundle directory
[20:36:05] Scrivener: Hmm... under .bundle I'm only able to find cache/, no config/. I ran a 'bundle install --without production' just to check whether this directory would be generated.
[20:36:15] Scrivener: I'll poke around for it.
[20:36:15] whathappens: has joined #RubyOnRails
[20:36:20] jhack: has joined #RubyOnRails
[20:37:07] adam^: Scrivener: maybe ~/.bundle/config?
[20:37:08] dlite: has joined #RubyOnRails
[20:37:43] Scrivener: adam^, sorry, that's what I meant when I couldn't find it. There was ~/.bundle/cache, but no config/.
[20:38:01] Scrivener: I'm debugging something inside a docker container, so it may have gotten placed elsewhere.
[20:38:14] adam12: Ah. I'd check app folder then.
[20:39:31] danostrowski: has joined #RubyOnRails
[20:41:38] FCser: has joined #RubyOnRails
[20:42:11] khelair_: has joined #RubyOnRails
[20:42:46] Scrivener: adam12, thanks for your help, man. I learned that the bundler config file was in an unexpected location and I can make sure it's in the right place to be recognized now.
[20:43:01] SteenJobs: has joined #RubyOnRails
[20:43:29] adam12: Nice. Good luck with Docker. I burned up a bunch of hours last night on it.
[20:44:57] Axilla: has joined #RubyOnRails
[20:45:35] Scrivener: It's been fairly smooth so far on development, but once I started trying to build a production image it went a little wacky. I don't fully understand how rails/bundler environments are handled, and that has caused an issue with my chosen app server. Other than that, docker itself is pretty nice.
[20:45:35] neanderslob: has joined #RubyOnRails
[20:45:39] Scrivener: Good luck yourself!
[20:45:49] adam12: I gave up. Just using regular LXC containers I think
[20:45:53] adam12: With a normal deploy strategy.
[20:45:55] Scrivener: Haha, alright.
[20:46:20] adam12: Tho Docker compose and docker machine were super smooth. And gitlab container registry.
[20:46:21] Scrivener: Going Docker + Kubernetes here. It definitely is a new world for me. Coming from an environment of just deploying with a traditional config management (chef) setup.
[20:47:46] neanderslob_: has joined #RubyOnRails
[20:49:04] neanderslob: has joined #RubyOnRails
[20:49:33] jenrzzz_: has joined #RubyOnRails
[20:49:51] Uranio: has joined #RubyOnRails
[20:57:49] rickmasta: has joined #RubyOnRails
[20:58:41] JamieD: has joined #RubyOnRails
[20:59:47] SteenJobs: has joined #RubyOnRails
[21:00:20] rollinDyno: has joined #RubyOnRails
[21:01:43] Pupeno: has joined #RubyOnRails
[21:03:00] macsteps: has joined #RubyOnRails
[21:04:27] SteenJobs: rakm: you figure out your cap problem? i use cap + rvm, but these past couple of weeks i’ve been spending a lot of time with cap configuration, so feel free to gist me your deploy.rb
[21:04:34] SteenJobs: slash whatever task is running
[21:05:16] chouhoulis: has joined #RubyOnRails
[21:10:26] pickandmix_: Hi guys! May I ask how do you guys call an API such as this https://github.com/nabeelamjad/poke-api in ruby on rails?
[21:11:46] rickmasta: has joined #RubyOnRails
[21:12:23] fryguy: pickandmix_: there's an example file provided there
[21:12:34] fryguy: what's wrong when you follow the examples?
[21:13:15] pickandmix_: fryguy: tbh, I don't even know where to place that 'code block', I'm coming from javascript html css
[21:13:29] neanderslob: has joined #RubyOnRails
[21:13:33] pickandmix_: I've been doing the railstutorial, and it hasn't taught anything on api calling.
[21:13:40] fryguy: pickandmix_: maybe in a controller, or a service object
[21:13:41] pickandmix_: So I thought I asked for some advice :/
[21:13:44] neanderslob_: has joined #RubyOnRails
[21:13:51] pickandmix_: fryguy: not a helper file?
[21:13:57] fryguy: pickandmix_: probably not
[21:14:02] pickandmix_: fryguy: I always thought helper is where the 'javascripts' at.
[21:14:12] rafaelfranca: has joined #RubyOnRails
[21:15:15] neanderslob: has joined #RubyOnRails
[21:16:34] voidDotClass_: has joined #RubyOnRails
[21:18:13] tvw: has joined #RubyOnRails
[21:18:38] euphoria-: has joined #RubyOnRails
[21:19:15] tubbo: pickandmix_: !gettingstarted
[21:19:16] helpa: pickandmix_: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[21:19:16] quazimodo: has joined #RubyOnRails
[21:19:19] tubbo: did you read that?
[21:20:22] pickandmix_: tubbo: I actually did till chapt 10 of rails tut, and I find that I was forgetting stuffs at times, or not understanding.
[21:20:37] pickandmix_: tubbo: So I'm trying to dive straight and build a little project to familiarize myself more with rails.
[21:20:42] tubbo: great. so you know what each "part" of the rails app is for then.
[21:21:01] tubbo: controllers, helpers, models, views, assets/stylesheets, assets/javascripts (obviously, since you come from html/css/js)
[21:21:18] pickandmix_: tubbo: ahh yes. I think I do?
[21:23:16] pickandmix_: tubbo: I think ror was a great investment. So now I'm trying to build a webapp service for pokemongo, as a way to polish up my skills.
[21:24:06] quazimod1: has joined #RubyOnRails
[21:24:14] seventy: has joined #RubyOnRails
[21:25:00] tubbo: pickandmix_: interesting. i was just looking into that README of poke-api and didn't even know pokemon go had an API
[21:25:21] tubbo: so what is your service going to do?
[21:25:37] pickandmix_: okay basically
[21:26:00] seventy: has joined #RubyOnRails
[21:26:12] pickandmix_: tubbo: https://pokevision.com/ shows the real-time stats of pokemons
[21:26:41] pickandmix_: tubbo: but they are on a global scale. So I would actually like to build a way smaller scale just for my country.
[21:26:50] tubbo: pickandmix_: that makes sense, considering that site doesn't work :P
[21:27:01] tubbo: if you could make a version of that site that works... :D
[21:27:03] pickandmix_: yep I think it's because they are handling lots
[21:27:10] pickandmix_: I'm actually trying to build one for singapore
[21:27:21] pickandmix_: singapore is wayyyy smaller so perhaps I could do that.
[21:27:31] tubbo: pokevision doesn't seem worldwide at all
[21:27:31] pickandmix_: so today I actually learnt about mimtproxy
[21:27:51] pickandmix_: and it's so cool, when the post get requests and the mimt decoder.
[21:28:16] pickandmix_: tubbo: pokemon go isn't out in my country yet
[21:28:42] pickandmix_: so yeah, trying to build something useful, as well as polishing the skill. seems win-win
[21:28:46] Axilla: has joined #RubyOnRails
[21:30:35] zacts_raincity: has joined #RubyOnRails
[21:33:38] SteenJobs: tubbo: pretty sure there’s no public api - didn’t they just figure out Niantic’s endpoints and use it?
[21:34:09] SteenJobs: if there’s a public api, please tell me now so i can build an iOS version for myself (maybe i’ll let others use it :P)
[21:34:29] pickandmix_: SteenJobs: There's a few API out there, but no official one
[21:34:49] rickmasta: has joined #RubyOnRails
[21:35:10] SteenJobs: pickandmix_: just to add, fryguy mentioned a service - i’d recommend using that type of OO model to contain any API calls - and it’ll be good practice too
[21:36:00] pickandmix_: SteenJobs: what do you mean 00 model?
[21:36:01] SteenJobs: pickandmix_: for example, in our platform we use stripe extensively, so I have a CreditCardService which handles all API related calls, and when any other part of the app needs to make an api call, it instantiates a new CreditCardService object and calls the relevant method
[21:36:05] SteenJobs: object oriented
[21:36:18] SteenJobs: using service is very object orienty haha if that makes any sense
[21:36:31] pickandmix_: Ah I see, pardon my noobiness :)
[21:36:59] pickandmix_: I'm kinda like diving into this, and it's pretty hard to 'walk straight' without some kind of guide.
[21:37:09] SteenJobs: no worries - big difference between lazy and nooby. last time i checked, no one left the womb already knowing how to code
[21:37:13] StevenXL: folks* what's the current best practice when doing an OR query in Rails 4?
[21:37:17] StevenXL: Is a query string fine?
[21:37:43] jenrzzz: has joined #RubyOnRails
[21:37:43] jenrzzz: has joined #RubyOnRails
[21:37:57] tubbo: stevenxl: yeah
[21:38:13] pickandmix_: SteenJobs: ;)
[21:38:20] StevenXL: tubbo: Thank you.
[21:38:25] tubbo: SteenJobs: looks like it
[21:38:29] tubbo: (re: poke-api)
[21:38:57] SteenJobs: yea that’s why i haven’t built an iOS app for it, pretty certain apple would never approve it if it was using a private api
[21:39:02] Jayson_Virissimo: has joined #RubyOnRails
[21:39:06] tubbo: SteenJobs: pickandmix_ linked pokevision.com earlier which is fun
[21:39:25] SteenJobs: ya that’s what i use, but it feels a bit clunky in safari when on my phone - would rather st native
[21:39:42] SteenJobs: not complainging though, they did a dope job with pokevision
[21:40:25] pickandmix_: yeah tbh they did a good job .
[21:40:56] pickandmix_: I just figured since my area is small, perhaps I can ping the whole area instead of being like pokevision where you have to search an area
[21:40:57] tubbo: i don't think the app client is the issue there
[21:41:08] tubbo: the issue is that it only fetches every 30 seconds and literally everyone is using this site haha
[21:41:35] arup_r: has joined #RubyOnRails
[21:42:17] pickandmix_: tubbo: yeahh ahhaha
[21:42:23] pickandmix_: tubbo: that's why they keep crashing
[21:42:41] SteenJobs: eh but with a native app, assuming iOS hasn’t terminated it, there wouldn’t be any initialization when switching back and forth between pokevision and the pokemon go app. when using safari, while safari is initialized, the web page still needs to load which is a bit annoying - but i’m being super picky
[21:42:59] Spami: has joined #RubyOnRails
[21:43:06] SteenJobs: pretty sure they keep crashing because of niantic’s api, no? i think they’ve been pretty good re managing the overwhelming reqs - at least based on their twitter updates
[21:43:26] pickandmix_: I just know that they are based on niantic's server
[21:43:44] SteenJobs: well considering they use Niantic’s api, that would make sense :D
[21:44:41] hannelita: has joined #RubyOnRails
[21:45:06] pickandmix_: so if poke go is down
[21:45:06] pickandmix_: they are down as well
[21:45:06] pickandmix_: and there are people who are piggybagging pokevision's server
[21:45:06] pickandmix_: using pokevision's api
[21:45:37] Uranio: has joined #RubyOnRails
[21:46:47] neanderslob: has joined #RubyOnRails
[21:46:54] A_Drone: has joined #RubyOnRails
[21:46:57] neanderslob_: has joined #RubyOnRails
[21:48:06] SteenJobs: aright, peace. pickandmix_, keep plugging away - building is the best way to learn
[21:50:55] Pumukel: has joined #RubyOnRails
[21:51:10] mikecmpbll: has joined #RubyOnRails
[21:51:36] nacsurte: has joined #RubyOnRails
[21:52:09] barhum2013: has joined #RubyOnRails
[21:52:54] neanderslob: has joined #RubyOnRails
[21:55:20] hannelita: has joined #RubyOnRails
[21:55:58] JamieD: has joined #RubyOnRails
[21:58:05] jenrzzz: has joined #RubyOnRails
[21:58:05] jenrzzz: has joined #RubyOnRails
[22:01:42] killerbunny: has joined #RubyOnRails
[22:07:36] jenrzzz: has joined #RubyOnRails
[22:07:36] jenrzzz: has joined #RubyOnRails
[22:12:40] neanderslob: has joined #RubyOnRails
[22:12:50] zpe: has joined #RubyOnRails
[22:17:46] voidDotClass_: has joined #RubyOnRails
[22:17:52] YourManCJ: has joined #RubyOnRails
[22:23:11] bios: has joined #RubyOnRails
[22:23:33] bios: hey *.. if I have a form that I want to input in a specific timezone, but I want to store UTC.. where do I go about doing that? Inside the controller and the view?
[22:24:37] adre: has joined #RubyOnRails
[22:24:51] hannelita: has joined #RubyOnRails
[22:28:38] mikecmpbll: has joined #RubyOnRails
[22:30:34] hannelita: has joined #RubyOnRails
[22:31:46] jenrzzz: has joined #RubyOnRails
[22:31:46] jenrzzz: has joined #RubyOnRails
[22:33:01] tris: has joined #RubyOnRails
[22:34:02] Palsson: has joined #RubyOnRails
[22:34:13] cnk: Rails automatically converts to UTC for storage - and back to server's local time for display
[22:34:19] cnk: bios: ^
[22:34:27] mostlybadfly: has joined #RubyOnRails
[22:37:01] dlite: has joined #RubyOnRails
[22:39:05] neanderslob: has joined #RubyOnRails
[22:42:25] Radar: protip: always always always always store time in UTC.
[22:44:08] neanderslob: has joined #RubyOnRails
[22:49:47] bios: Firstly, thanks for the response!
[22:50:18] bios: So, I've got my form and on my datetime field I've got <%= reading.sample_date.in_time_zone(current_user.time_zone) %>
[22:50:34] bios: but when it's submitted, it saves it as that is the UTC time
[22:50:54] Radar: bios: yes
[22:50:55] bios: what do I need to do to display in current_user.time_zone, but save in UTC?
[22:50:57] Radar: [08:42:24] <Radar> protip: always always always always store time in UTC.
[22:51:15] Radar: bios: Set Time.zone in a before_action in application_controller to your local timezone.
[22:51:24] bios: ahh.. that's what I need to do..
[22:51:28] bios: gotcha!!
[22:52:16] cnk: bios's timezone ? or current_user's timezone ?
[22:52:54] rickmasta: has joined #RubyOnRails
[22:54:13] bios: current_user's timezone
[22:59:58] bios: Awesome.. I got it.. thank you all very much!!
[23:00:05] bios: I appreciate the help!
[23:02:28] danostrowski: has joined #RubyOnRails
[23:10:03] jgoulah: has joined #RubyOnRails
[23:14:54] zpe: has joined #RubyOnRails
[23:18:52] rakm: has joined #RubyOnRails
[23:22:34] barhum2013: has joined #RubyOnRails
[23:23:02] jabbathehutt1234: has joined #RubyOnRails
[23:24:06] rickmasta: has joined #RubyOnRails
[23:25:58] Markhor1991: has joined #RubyOnRails
[23:28:24] jabbathehutt1234: On http://pastie.org/help it says there is a pastie bot on here...
[23:28:49] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[23:29:14] jabbathehutt1234: No, I know about gists.
[23:29:22] jabbathehutt1234: I just want to see this pastie bot xD
[23:29:46] jabbathehutt1234: Is there a command to list people on a free node server?
[23:33:32] bga57: has joined #RubyOnRails
[23:33:45] wd40s: has joined #RubyOnRails
[23:36:08] Radar: and they're gone
[23:41:59] zacts: has joined #RubyOnRails
[23:42:51] Oliphaunte: has joined #RubyOnRails
[23:43:10] dalbusch1t: has joined #RubyOnRails
[23:43:42] macsteps: has joined #RubyOnRails
[23:45:38] dunpeal: has joined #RubyOnRails
[23:45:50] dragon9783: has joined #RubyOnRails
[23:52:44] whathappens: has joined #RubyOnRails
[23:54:09] yoongkang: has joined #RubyOnRails
[23:55:59] jstransky: has joined #RubyOnRails