« Back to channel list

#RubyOnRails - 12 July 2015

« Back 1 day Forward 1 day »
[00:00:55] hotpancakes: has joined #RubyOnRails
[00:01:26] mloy: has joined #RubyOnRails
[00:02:38] mloy: Hi, Rails noob here. I was wondering, is there a difference between putting root 'welcome#index' and root to: 'welcome#index' in routes.rb?
[00:03:37] nothingmuch: has joined #RubyOnRails
[00:05:04] one_zero: has joined #RubyOnRails
[00:05:11] djbkd: has joined #RubyOnRails
[00:07:17] FernandoBasso: has joined #RubyOnRails
[00:07:17] duderonomy: has joined #RubyOnRails
[00:09:00] doodlehaus: has joined #RubyOnRails
[00:10:08] owenjones: has joined #RubyOnRails
[00:10:22] Lightsword: has joined #RubyOnRails
[00:11:10] duderonomy: has joined #RubyOnRails
[00:11:33] fatephd: has joined #RubyOnRails
[00:11:57] jamesrward: has joined #RubyOnRails
[00:13:16] pontiki: mloy: idk, have you noticed any difference?
[00:15:17] FCser: has joined #RubyOnRails
[00:15:25] jamesrward: Anyone have experience with a many to many relationship imported from csv? I'm trying to use active_admin_importable and I'm a bit lost of which way to go after I have my related field ids figured out. https://gist.github.com/anonymous/318f1c267366c83b6aa8
[00:16:24] jamesrward: I think I need to run something after model.create!(hash) to link those ids to the newly created record.
[00:21:05] Mweshi: has joined #RubyOnRails
[00:23:32] lele: has joined #RubyOnRails
[00:24:19] bmurt: has joined #RubyOnRails
[00:24:40] sonofdirt: has joined #RubyOnRails
[00:25:01] arooni-mobile: has joined #RubyOnRails
[00:31:27] chipotle: has joined #RubyOnRails
[00:33:09] Maletor: has joined #RubyOnRails
[00:33:12] fgo: has joined #RubyOnRails
[00:34:49] bonhoeffer: has joined #RubyOnRails
[00:35:37] rhizome: jamesrward: I use find_or_create/first_or_create with a block
[00:35:49] rhizome: actually i think it's first_or_initialize
[00:36:36] jamesrward: rhizome: I'll read up on that, thanks!
[00:37:31] creature: has joined #RubyOnRails
[00:38:18] SeanLazer: has joined #RubyOnRails
[00:38:59] chouhoulis: has joined #RubyOnRails
[00:40:07] hotpancakes: has joined #RubyOnRails
[00:44:02] cschneid: has joined #RubyOnRails
[00:44:55] acti0nman: has joined #RubyOnRails
[00:45:15] lethjakman: has joined #RubyOnRails
[00:45:41] eminencehc_: has joined #RubyOnRails
[00:50:01] iamse7en: has joined #RubyOnRails
[00:51:18] simplyianm: has joined #RubyOnRails
[00:57:36] lethjakman: so I used haskell platform to install haskell, but I don't have access to many libraries like 'Control.Monad.State'
[00:57:49] lethjakman: do I have to add anything to my path or something...?
[01:03:22] siemprefresco: has joined #RubyOnRails
[01:03:26] hd1: ethjakman: perhaps ask in #haskell?
[01:07:26] SteenJobs: has joined #RubyOnRails
[01:08:41] SteenJobs: has joined #RubyOnRails
[01:09:03] bonhoeffer: has joined #RubyOnRails
[01:09:16] girakrok: has joined #RubyOnRails
[01:10:25] sonofdirt: has joined #RubyOnRails
[01:10:33] seank_: has joined #RubyOnRails
[01:10:57] hotpancakes: has joined #RubyOnRails
[01:15:53] lethjakman: whoops, wrong channel lol
[01:16:30] viiralvx: has joined #RubyOnRails
[01:16:56] mloy: pontiki: Hah no I haven't noticed a difference but I'm always paranoid that some small difference will cause a bug in the future that's nearly impossible to trace back.
[01:18:27] pwnd_nfsw: So, I have Product, ProductSet, ProductSetsJoin tables, I have a field "position" in the join table, but I don't know how to create a form for it in activeadmin.
[01:19:23] jwalker14: has joined #RubyOnRails
[01:19:57] pwnd_nfsw: ProductSet form accepts several fields of Product (different types of products)
[01:21:14] beauby: has joined #RubyOnRails
[01:21:19] pwnd_nfsw: But Products are already defined, it's just different lists for each. https://gist.github.com/SirUncleCid/b31bc1b6ecf4be8c8c0e
[01:21:26] jamesrward: Possible stupid question but what is considered the correct way to declare a local variable at the start of a block for use within the scope of said block. I'm guessing something like myVar = nil
[01:21:27] girakrok: has joined #RubyOnRails
[01:22:12] pwnd_nfsw: jamesrward, that would work, I believe, but I'm hardly an expert
[01:22:39] pwnd_nfsw: Have you given it a try? :P
[01:23:39] jamesrward: pwnd_nfsw: Thanks I'm trying it now but it feels a little wrong so I thought I would ask. I need to set the var value inside an if and use it again outside the if so declaring it at the top of the calling block seems logical but maybe this is all foolishness.
[01:24:59] lele: has joined #RubyOnRails
[01:25:17] jamesrward: pwnd_nfsw: adding that myvar=nil definitely stopped my rubymine code checking complaints
[01:26:14] Guest71946: has joined #RubyOnRails
[01:28:06] SteenJobs: has left #RubyOnRails: ()
[01:28:40] SteenJobs: has joined #RubyOnRails
[01:29:38] hololeap: has joined #RubyOnRails
[01:32:20] pwnd_nfsw: jamesrward, I'm pretty sure that's how you'd do that. I see an example on SO of it
[01:33:18] jamesrward: pwnd_nfsw: yep it seems to be working well. Just didn't feel very Railsy for some reason. It's all new to me so I'm trying to form good habits. Thanks for your help.
[01:33:41] Creeves: has joined #RubyOnRails
[01:33:45] pwnd_nfsw: Still working on my rails saviness too. Best of luck to you!
[01:34:26] Guest71946: has joined #RubyOnRails
[01:35:20] girakrok: has joined #RubyOnRails
[01:39:00] beauby: has joined #RubyOnRails
[01:40:48] SeanLazer: has joined #RubyOnRails
[01:41:53] Etriaph: I turn off 50% of all inspections in RubyMine
[01:42:58] mike___1234: has joined #RubyOnRails
[01:44:15] lethjakman: has joined #RubyOnRails
[01:44:59] bricker: has joined #RubyOnRails
[01:46:06] ght: Question: In a form helper, I'm attempting to pull the id generated by a specific form element. Apparently you can use f.options[:html][:id], but I also need to pass it to JavaScript for processing.
[01:46:30] ght: Normally, we use the gon gem for passing Ruby / Rails variables to JS / CoffeeScript, and it works great, but it doens't appear to work if we set a variable in a view.
[01:46:34] ght: Only works in a controller.
[01:46:47] ght: I get the logic of doing so, but does anyone have any idea how we might do that?
[01:47:14] Etriaph: I use CSS selectors with jQuery to deal with anything in my forms.
[01:47:48] Etriaph: ght: I've never thought to do it any other way ght
[01:47:54] ght: Etriaph: Thank you, we appreciate the response. Would you mind providing a quick example?
[01:48:00] ght: Of any sort?
[01:48:07] Xiti: has joined #RubyOnRails
[01:48:15] ght: The issue being, we utilize the cocoon gem to provide the user a dynamic HTML table.
[01:48:18] ght: will do, thank you.
[01:48:58] jwalker14: has joined #RubyOnRails
[01:49:00] girakrok: has joined #RubyOnRails
[01:53:23] beauby: has joined #RubyOnRails
[01:55:32] PlasmaStar: has joined #RubyOnRails
[01:56:44] dopie: has joined #RubyOnRails
[02:00:06] girakrok: has joined #RubyOnRails
[02:00:37] hotpancakes: has joined #RubyOnRails
[02:03:52] ght: For what it's worth, Etriaph has been very helpful and should be commended by the resident elites.
[02:04:22] Etriaph: Thanks for sayin' ght.
[02:07:26] Oog: has joined #RubyOnRails
[02:07:43] kenndel: has joined #RubyOnRails
[02:07:43] Oog: i read rails 4 is thread safe by default. however it appears at least in development it only processes one http request at a time
[02:09:18] beauby: has joined #RubyOnRails
[02:11:21] Oog: im using puma
[02:13:13] wethu: has joined #RubyOnRails
[02:16:03] hotpancakes: has joined #RubyOnRails
[02:18:30] dopie: has joined #RubyOnRails
[02:23:23] FCser: has joined #RubyOnRails
[02:24:16] DoctorMonocular: has joined #RubyOnRails
[02:24:27] chipotle: has joined #RubyOnRails
[02:24:47] Etriaph: Oog: https://bearmetal.eu/theden/how-do-i-know-whether-my-rails-app-is-thread-safe-or-not/
[02:25:16] Etriaph: Your server will only ever report to you one access at a time, it's how it's logged, it doesn't mean it's not running thread safe.
[02:26:38] w0rd-driven: has joined #RubyOnRails
[02:29:05] strcmp1: has joined #RubyOnRails
[02:29:50] Etriaph: Unless you have evidence beyond server logs that it's not running thread safe.
[02:30:38] ejnahc: has joined #RubyOnRails
[02:31:18] dlitz: has joined #RubyOnRails
[02:31:30] Oog: has joined #RubyOnRails
[02:32:42] cleopatra: has joined #RubyOnRails
[02:33:21] artto: has joined #RubyOnRails
[02:33:43] Oog: i fixed it with config.allow_concurrency = true im using ActionController::Live to have a streaming method https://gist.github.com/anonymous/3b633e45e1bec93ce397
[02:33:55] surrealanalysis: has joined #RubyOnRails
[02:34:10] Oog: now i can have it streaming and non-streaming methods load quickly. the problem is if i try to open multiple streams there is a long delay but finally they do open
[02:34:36] ejnahc: has joined #RubyOnRails
[02:34:42] beauby: has joined #RubyOnRails
[02:34:55] Oog: how do i get rid of the delay?
[02:35:43] eggoez: has joined #RubyOnRails
[02:35:54] Oog: wait it might have been chrome doing some idiocy......
[02:36:24] Oog: it was chrome trash sorry. it seems to block future requets if one is loading how lame
[02:38:46] ejnahc: has joined #RubyOnRails
[02:39:17] dopie: has joined #RubyOnRails
[02:44:03] hotpancakes: has joined #RubyOnRails
[02:44:12] sharpmachine: has joined #RubyOnRails
[02:44:57] mary5030: has joined #RubyOnRails
[02:45:07] dcunit3d: has joined #RubyOnRails
[02:56:05] beauby: has joined #RubyOnRails
[02:57:50] hotpancakes: has joined #RubyOnRails
[02:58:31] ejnahc: has joined #RubyOnRails
[03:01:42] simplyianm: has joined #RubyOnRails
[03:03:08] djbkd_: has joined #RubyOnRails
[03:04:23] fgo: has joined #RubyOnRails
[03:06:54] teedex: has joined #RubyOnRails
[03:08:30] seank_: has joined #RubyOnRails
[03:09:17] beauby: has joined #RubyOnRails
[03:11:11] braincrash: has joined #RubyOnRails
[03:11:45] shyshy: has joined #RubyOnRails
[03:12:29] jasenc: has joined #RubyOnRails
[03:13:24] wasp__: has joined #RubyOnRails
[03:13:35] simplyianm: has joined #RubyOnRails
[03:13:35] jasenc_: has joined #RubyOnRails
[03:14:03] jasenc: It's so dead in here
[03:17:00] pwnd_nfsw: This project is kicking my ass, I have no idea what to do
[03:18:05] dideler: has joined #RubyOnRails
[03:20:58] startupality: has joined #RubyOnRails
[03:20:58] crdpink: has joined #RubyOnRails
[03:23:53] kahunaio: has joined #RubyOnRails
[03:24:58] simplyianm: has joined #RubyOnRails
[03:26:45] zz_timnovinger: has joined #RubyOnRails
[03:27:46] moeabdol: has joined #RubyOnRails
[03:28:05] Sehryn: has joined #RubyOnRails
[03:34:05] artto: has joined #RubyOnRails
[03:35:02] bronson: has joined #RubyOnRails
[03:36:26] simplyianm: has joined #RubyOnRails
[03:38:23] pwnd_nfsw: Annnnnnd figured it out. Damn that was brutal
[03:39:12] mary5030: has joined #RubyOnRails
[03:40:42] SteenJobs: has joined #RubyOnRails
[03:41:10] Lightsword: has joined #RubyOnRails
[03:44:08] rhizome: 20min from having "no idea." remember that.
[03:45:23] chouhoulis: has joined #RubyOnRails
[03:48:21] Maletor: has joined #RubyOnRails
[03:49:11] nickenchuggets_: has joined #RubyOnRails
[03:50:23] bhuvanaurora: has joined #RubyOnRails
[03:57:20] dan0034001: has joined #RubyOnRails
[03:58:17] tdy: has joined #RubyOnRails
[03:58:31] hotpancakes: has joined #RubyOnRails
[03:58:59] bonhoeffer: has joined #RubyOnRails
[04:00:52] rickmasta: has joined #RubyOnRails
[04:01:42] owenjones: has joined #RubyOnRails
[04:05:19] theery: has joined #RubyOnRails
[04:06:40] pwnd_nfsw: rhizome, haha, you're right. I wonder if I should become an alcoholic because it came to me after chugging 2 beers
[04:07:13] Oog: has joined #RubyOnRails
[04:08:13] lethjakman: has joined #RubyOnRails
[04:08:15] Oog: runnint into a bad bug with ActionController:Live https://gist.github.com/anonymous/ce253fb6f3a6ee31bcbd - crazy but database results seem to be cached and never update...
[04:10:14] zorak8: has joined #RubyOnRails
[04:11:51] bricker1: has joined #RubyOnRails
[04:13:11] chinmay_dd: has joined #RubyOnRails
[04:15:05] simplyianm: has joined #RubyOnRails
[04:15:50] konsolebox: has joined #RubyOnRails
[04:18:04] bricker: has joined #RubyOnRails
[04:18:31] dopie: has joined #RubyOnRails
[04:19:29] simplyianm: has joined #RubyOnRails
[04:20:31] crdpink2: has joined #RubyOnRails
[04:21:07] rhizome: pwnd_nfsw: it's called the ballmer peak
[04:21:17] pwnd_nfsw: haha yesssss
[04:21:23] Oog: i dont think rials live stream works it seems like a lot of bugs
[04:21:31] Scripore: has joined #RubyOnRails
[04:23:06] Oog: ok i realized ih ave to write once a sec for it to realize socket is closed so that problem is fixed but still the database caching... big problem - ideas?
[04:24:34] simplyianm: has joined #RubyOnRails
[04:25:58] erich: has joined #RubyOnRails
[04:27:55] crdpink: has joined #RubyOnRails
[04:29:10] erich: has joined #RubyOnRails
[04:31:33] dopie: has joined #RubyOnRails
[04:31:50] Guest97212: has joined #RubyOnRails
[04:32:37] one_zero: has joined #RubyOnRails
[04:33:51] simplyianm: has joined #RubyOnRails
[04:34:52] artto: has joined #RubyOnRails
[04:37:24] baweaver: has joined #RubyOnRails
[04:38:37] simplyianm: has joined #RubyOnRails
[04:38:53] simplyianm: has joined #RubyOnRails
[04:39:01] theery: has joined #RubyOnRails
[04:41:38] JDeen: has joined #RubyOnRails
[04:42:59] JDeen: Hi, I am confused with nested forms and linking up records. I appreciate any help on the matter. I opened a question on SO. Thanks in advance -> http://stackoverflow.com/questions/31364411/rails-nested-forms-create-links-in-has-to-many-through
[04:45:27] mike___1234: has joined #RubyOnRails
[04:49:05] puddy: has left #RubyOnRails: ()
[04:51:35] mary5030: has joined #RubyOnRails
[04:51:49] givanse: has joined #RubyOnRails
[04:52:41] bronson: has joined #RubyOnRails
[04:56:00] Surt_Q: has joined #RubyOnRails
[04:56:00] adavia: anyone familiar with bootstrap_forms gem
[04:56:46] teedex: has joined #RubyOnRails
[05:01:15] JDeen: adavia: If you ask the question, some one will answer
[05:01:33] zorak8: has joined #RubyOnRails
[05:02:21] natevick: has joined #RubyOnRails
[05:02:28] owenjones: has joined #RubyOnRails
[05:03:21] adavia: well just wondering why is im not able to display field errors with a form like <%= bootstrap_form_for([micropost, micropost.comments.build]) do |f| %>
[05:07:40] ejnahc: has joined #RubyOnRails
[05:08:20] nobitanobi: has joined #RubyOnRails
[05:09:29] JDeen: adavia: I haven't used it seriously. I think you still need to iterate through the errors hash and show the errors. But wait for some one with experience. I have written form builders to that do some thing similar and show errors as expected in the theme with the field like what Parsley would do.
[05:10:32] adavia: jdeen: actually the idea of bootstrap forms is that it handles that validation automatically
[05:11:59] arup_r: has joined #RubyOnRails
[05:12:24] JDeen: adavia: just checked, true. Never tried so not sure :)
[05:14:35] Guest71946: has joined #RubyOnRails
[05:18:18] riotjones: has joined #RubyOnRails
[05:18:52] charliesome: has joined #RubyOnRails
[05:20:51] teedex: has joined #RubyOnRails
[05:21:15] JDeen: adavia: Are you sure there are errors. Because in Sinatra and Datamapper once I had a wired error of not having any errors but it says there is an error and the errors hash is empty.
[05:21:23] nobitanobi: has joined #RubyOnRails
[05:22:41] bob14: has joined #RubyOnRails
[05:24:11] artto: has joined #RubyOnRails
[05:24:23] JDeen: adavia: Also some times css or js might be hiding it. Once I was started on a half baked project errors were not showing because some custom js removing/hiding '.error' s.
[05:24:58] artto: has joined #RubyOnRails
[05:26:36] Oog: has joined #RubyOnRails
[05:26:38] Oog: i fixed the ActionController::Live db caching problem by surrounding the inside of the loop in uncached. problem is it seems to be hogging a db connection... and causing other issues "Attempted to rename transaction to 'Middleware/Rack/ActionDispatch::Static/call' after transaction name was already frozen as 'Controller/dashboard/user_stream'."
[05:26:51] Oog: how can i close the connection at the end of the loop then reopen it...?
[05:30:53] ivanskie: has joined #RubyOnRails
[05:30:54] Oog: where is the log of this channell
[05:32:29] dlitz: has joined #RubyOnRails
[05:35:53] Creeves: has joined #RubyOnRails
[05:39:34] adevninja: has joined #RubyOnRails
[05:43:37] bricker: has joined #RubyOnRails
[05:45:47] simplyianm: has joined #RubyOnRails
[05:49:29] Oog: i think i fixed it by putting ActiveRecord::Base.clear_active_connections! right about the sleep - is that the bes way to release a db connection
[05:53:13] bricker1: has joined #RubyOnRails
[05:53:43] konsolebox: has joined #RubyOnRails
[05:54:20] theery: has joined #RubyOnRails
[05:55:32] artto: has joined #RubyOnRails
[05:57:17] stantonnet: has joined #RubyOnRails
[05:57:21] artto: has joined #RubyOnRails
[05:57:28] sung: has joined #RubyOnRails
[05:59:55] DoctorMonocular: has joined #RubyOnRails
[06:00:59] yardenbar: has joined #RubyOnRails
[06:03:16] owenjones: has joined #RubyOnRails
[06:05:03] roolo: has joined #RubyOnRails
[06:09:42] Maletor: has joined #RubyOnRails
[06:11:25] bricker: has joined #RubyOnRails
[06:12:58] kies^: has joined #RubyOnRails
[06:13:31] Maletor: has joined #RubyOnRails
[06:14:29] mingsheng: has joined #RubyOnRails
[06:18:03] vere: has joined #RubyOnRails
[06:22:00] DoctorMonocular: has joined #RubyOnRails
[06:26:22] sevenseacat: has joined #RubyOnRails
[06:28:09] shyshy: has joined #RubyOnRails
[06:30:10] drale2k: has joined #RubyOnRails
[06:31:12] hotpancakes: has joined #RubyOnRails
[06:31:59] nikhgupta: has joined #RubyOnRails
[06:34:15] ndrei: has joined #RubyOnRails
[06:34:22] hd1: has left #RubyOnRails: ()
[06:35:43] dc1: has joined #RubyOnRails
[06:36:03] bricker: has joined #RubyOnRails
[06:39:00] baweaver_: has joined #RubyOnRails
[06:39:39] baweaver_: has joined #RubyOnRails
[06:41:18] eminencehc_: has joined #RubyOnRails
[06:42:02] bricker: has joined #RubyOnRails
[06:45:23] Oog: im thinking there are some thread bug in activerecord
[06:45:32] Oog: Attempted to rename transaction to 'Middleware/Rack/Rack::Pjax/call' after transaction name was already frozen as 'Controller/dashboard/user_stream'.
[06:46:03] srinidhi: has joined #RubyOnRails
[06:48:23] sonofdirt: has joined #RubyOnRails
[06:49:19] Oog: i realized the thing to do is poll this is too buggy
[06:49:51] kham: has joined #RubyOnRails
[06:52:05] arooni-mobile: has joined #RubyOnRails
[06:55:43] cswelin: has joined #RubyOnRails
[06:58:03] artto: has joined #RubyOnRails
[06:58:30] hotpancakes: has joined #RubyOnRails
[07:00:11] simplyianm: has joined #RubyOnRails
[07:00:41] sonofdirt: has joined #RubyOnRails
[07:02:07] lxsameer: has joined #RubyOnRails
[07:03:02] nikhgupt: has joined #RubyOnRails
[07:04:01] owenjones: has joined #RubyOnRails
[07:04:56] riotjones: has joined #RubyOnRails
[07:07:08] RickJamesTheThir: has joined #RubyOnRails
[07:07:54] cornerma1: has joined #RubyOnRails
[07:09:36] RickJamesTheThir: I know this is more of a regex question and not so much of a rails question but here it goes
[07:11:18] RickJamesTheThir: I am looking through an html file and want to search and replace all the src links from "assets/images/file.jpeg" to "./file.jpeg"
[07:12:04] sevenseacat: i wouldnt even use regex for that
[07:12:08] RickJamesTheThir: I already have the regex to find the src=" " but I need to then get whats inside those quotes and run File.basename(path) on whats inside of the quotes
[07:12:16] sevenseacat: ctrl+F 'assets/images/' -> './'
[07:12:41] RickJamesTheThir: I need to automate it or I would just do a find and replace
[07:12:54] rhizome: what do you mean automate
[07:13:13] RickJamesTheThir: when the file gets uploaded its asset links get changed
[07:13:25] lapide_viridi: has joined #RubyOnRails
[07:13:31] RickJamesTheThir: rather than me manually doing ctrl + F everytime a file is uploaded
[07:13:48] rhizome: so what have you tried
[07:14:04] darutoko: has joined #RubyOnRails
[07:15:03] dici: has joined #RubyOnRails
[07:15:08] RickJamesTheThir: I haven't tried much I dont know how to proceed. I have the regex to find the src
[07:15:18] RickJamesTheThir: I just don't know how to capture whats inside the quotes and run a command on it
[07:15:45] rhizome: are there some instances of 'assets/images' that you want to keep?
[07:15:49] RickJamesTheThir: yeah I have gsub except heres the thing
[07:15:58] RickJamesTheThir: no I need to replace all asset/images
[07:16:05] rhizome: ok, so you don't need capture
[07:16:34] RickJamesTheThir: everything is all the a root directory and not in individual folders /css or /js or /images
[07:19:31] Creeves: rickjamesthethir: can you gist the logic for dealing with uploaded files
[07:19:36] teedex: has joined #RubyOnRails
[07:21:27] Creeves: i don't see why you can't just do something like the first answer here: http://stackoverflow.com/questions/1274605/ruby-search-file-text-for-a-pattern-and-replace-it-with-a-given-value
[07:22:09] Creeves: and do as the others were saying, gsub for assets/images/ to ./
[07:23:36] ledestin: has joined #RubyOnRails
[07:25:55] hotpancakes: has joined #RubyOnRails
[07:26:31] fighella: has joined #RubyOnRails
[07:32:08] matcouto: has joined #RubyOnRails
[07:34:22] krz: has joined #RubyOnRails
[07:35:58] pico-pete: has joined #RubyOnRails
[07:36:44] vere: has joined #RubyOnRails
[07:39:52] blackmesa: has joined #RubyOnRails
[07:41:05] sameerynho: has joined #RubyOnRails
[07:43:55] JDeen: Hi guys, how do you drop a model that is namespaced. I found on SO about some thing like `rails g migration DropYourModel`
[07:44:07] lxsameer_: has joined #RubyOnRails
[07:44:28] lethjakman: has joined #RubyOnRails
[07:44:54] sevenseacat: 'drop a model'?
[07:44:56] JDeen: never mind, 'edit your migration and then run' missed that part :D
[07:45:16] JDeen: i thought it will generate it auto,
[07:45:28] JDeen: sevenseacat: my mistake, sorry!
[07:50:47] arup_r: has joined #RubyOnRails
[07:54:02] hotpancakes: has joined #RubyOnRails
[07:58:48] artto: has joined #RubyOnRails
[08:02:36] bhuvanaurora: has joined #RubyOnRails
[08:02:45] sonofdirt: has joined #RubyOnRails
[08:04:57] jenrzzz: has joined #RubyOnRails
[08:04:57] owenjones: has joined #RubyOnRails
[08:12:26] MEATCHICKEN: has joined #RubyOnRails
[08:15:18] Lytol: has joined #RubyOnRails
[08:20:29] fgo: has joined #RubyOnRails
[08:21:18] bronson: has joined #RubyOnRails
[08:25:26] epistrephein: has joined #RubyOnRails
[08:28:12] ndrei: has joined #RubyOnRails
[08:29:13] Sylario: has joined #RubyOnRails
[08:29:23] mhib: has joined #RubyOnRails
[08:32:39] blackmesa: has joined #RubyOnRails
[08:37:46] hmnhf: has joined #RubyOnRails
[08:39:19] bhuvanaurora: has joined #RubyOnRails
[08:41:00] quazimodo: has joined #RubyOnRails
[08:41:05] quazimod1: has joined #RubyOnRails
[08:41:15] AzaToth: has joined #RubyOnRails
[08:41:27] creature: has joined #RubyOnRails
[08:44:11] bricker: has joined #RubyOnRails
[08:46:02] teedex: has joined #RubyOnRails
[08:50:49] bhuvanaurora: has joined #RubyOnRails
[08:52:12] kham: has joined #RubyOnRails
[08:53:14] bricker: has joined #RubyOnRails
[08:54:56] lethjakman: has joined #RubyOnRails
[08:55:32] hotpancakes: has joined #RubyOnRails
[08:56:27] skroon: has joined #RubyOnRails
[08:56:57] blackmes1: has joined #RubyOnRails
[08:57:01] DoubleMalt: has joined #RubyOnRails
[08:59:19] microdex: has joined #RubyOnRails
[08:59:34] artto: has joined #RubyOnRails
[08:59:46] bin_005_j_j_v: has joined #RubyOnRails
[09:04:45] Mweshi: has joined #RubyOnRails
[09:05:32] owenjones: has joined #RubyOnRails
[09:11:39] bhuvanaurora: has joined #RubyOnRails
[09:19:01] n008f4g_: has joined #RubyOnRails
[09:23:08] vickleton: has joined #RubyOnRails
[09:27:06] kham: has joined #RubyOnRails
[09:29:20] Schalla: has joined #RubyOnRails
[09:29:20] Schalla: has joined #RubyOnRails
[09:29:53] microdex: has joined #RubyOnRails
[09:30:03] ndrei: has joined #RubyOnRails
[09:32:34] toretore: has joined #RubyOnRails
[09:36:35] hotpancakes: has joined #RubyOnRails
[09:36:36] starfox_sf: has joined #RubyOnRails
[09:37:28] matthias_: has joined #RubyOnRails
[09:39:44] Mweshi_: has joined #RubyOnRails
[09:41:26] blackmes1: has joined #RubyOnRails
[09:46:29] simplyianm: has joined #RubyOnRails
[09:53:22] DEA7TH: has joined #RubyOnRails
[09:54:02] bruno-: has joined #RubyOnRails
[09:55:32] ndrei: has joined #RubyOnRails
[09:56:06] arBmind: has joined #RubyOnRails
[09:58:33] DoctorMonocular: has joined #RubyOnRails
[09:59:42] siemprefresco: has joined #RubyOnRails
[10:00:21] artto: has joined #RubyOnRails
[10:03:15] eGGsha: has joined #RubyOnRails
[10:06:26] owenjones: has joined #RubyOnRails
[10:09:05] jottr: has joined #RubyOnRails
[10:14:39] srinidhi: has joined #RubyOnRails
[10:18:57] wethu: has joined #RubyOnRails
[10:19:16] creature: has joined #RubyOnRails
[10:20:22] fgo: has joined #RubyOnRails
[10:29:13] allcentury: has joined #RubyOnRails
[10:30:26] DoubleMalt: has joined #RubyOnRails
[10:30:46] microdex: has joined #RubyOnRails
[10:31:12] Scripore: has joined #RubyOnRails
[10:33:45] blackmesa: has joined #RubyOnRails
[10:34:07] hotpancakes: has joined #RubyOnRails
[10:35:38] artto: has joined #RubyOnRails
[10:39:58] GarethAdams: has joined #RubyOnRails
[10:42:16] JDeen: has joined #RubyOnRails
[10:44:00] lethjakman: has joined #RubyOnRails
[10:46:09] kies^: has joined #RubyOnRails
[10:51:34] ndrei: has joined #RubyOnRails
[10:53:50] kham: has joined #RubyOnRails
[10:57:56] lapide_viridi: has joined #RubyOnRails
[11:02:23] dionysus69: has joined #RubyOnRails
[11:07:12] owenjones: has joined #RubyOnRails
[11:08:19] jottr_: has joined #RubyOnRails
[11:08:39] creature: has joined #RubyOnRails
[11:08:45] camonz: has joined #RubyOnRails
[11:09:20] MaDErroR123: has joined #RubyOnRails
[11:11:49] dionysus69: has joined #RubyOnRails
[11:13:42] Lytol: has joined #RubyOnRails
[11:14:14] dionysus69: has joined #RubyOnRails
[11:15:54] noodman: has joined #RubyOnRails
[11:16:16] krz: Mime::Type.register "application/vnd.api+json", :json, anything wrong with doing this?
[11:16:41] krz: apparently i get a warning with warning: already initialized constant Mime::JSON
[11:16:55] krz: can i register this mime type with json as well?
[11:20:44] riotjones: has joined #RubyOnRails
[11:23:32] shilon: has joined #RubyOnRails
[11:25:20] starfox_sf: has joined #RubyOnRails
[11:25:50] mrbubbles: has joined #RubyOnRails
[11:28:16] krz: i guess Mime.send(:remove_const, :json); Mime::Type.register "application/vnd.api+json", :json works
[11:29:50] Silox|: Why does (when developing locally) localhost:3000 works, but 127.0.0.1:3000 throws a connection refused?
[11:29:55] Silox|: 127.0.0.1 localhost is in my hosts file
[11:31:33] microdex: has joined #RubyOnRails
[11:33:14] bonhoeffer: has joined #RubyOnRails
[11:35:24] wasp__: has joined #RubyOnRails
[11:36:22] artto: has joined #RubyOnRails
[11:37:48] krz: Silox|: did you refresh etc host?
[11:38:06] Silox|: Yeah, found this in the meantime: https://github.com/rails/rails/issues/19815
[11:38:09] Silox|: seems like a webrick limitation?
[11:38:33] Silox|: Err, I'm using puma ><
[11:38:34] Papierkorb: has joined #RubyOnRails
[11:39:24] Silox|: Ah, it works if I pass `-b 127.0.0.1`
[11:44:03] MaDErroR123: has joined #RubyOnRails
[11:46:27] TheMonster: If I want to define a class that does some functions including calling methods inside some of the app models. Where should I put that class? lib folder? app/classes?
[11:48:35] Papierkorb: TheMonster: lib folder sounds reasonable. For app specific lib things, I have app/lib
[11:49:09] TheMonster: Papierkorb: Alright, Thanks :)
[11:50:47] nothingmuch: has joined #RubyOnRails
[11:51:31] creature: has joined #RubyOnRails
[11:54:11] lapide_viridi: has joined #RubyOnRails
[11:54:29] bonhoeffer: is there a scaffold generator for nested resources
[11:54:30] lethjakman: has joined #RubyOnRails
[11:55:28] bonhoeffer: not sure how standard this is: https://github.com/henrydjacob/rails-nested-scaffold
[11:55:30] hotpancakes: has joined #RubyOnRails
[11:55:54] bhuvanaurora: has joined #RubyOnRails
[11:57:09] edwinvdgraaf: has joined #RubyOnRails
[11:58:21] edwinvdg_: has joined #RubyOnRails
[12:01:57] eminencehc_: has joined #RubyOnRails
[12:03:29] wethu: has joined #RubyOnRails
[12:03:44] wethu: has joined #RubyOnRails
[12:07:51] owenjones: has joined #RubyOnRails
[12:07:53] FernandoBasso: has joined #RubyOnRails
[12:09:58] tomoyuki28jp: has joined #RubyOnRails
[12:11:33] MaDErroR123: has joined #RubyOnRails
[12:15:24] rtl: has joined #RubyOnRails
[12:17:36] mhib: has joined #RubyOnRails
[12:20:28] mr_foobar: has joined #RubyOnRails
[12:21:22] qejk: has joined #RubyOnRails
[12:22:46] dici: has joined #RubyOnRails
[12:23:00] DoctorMonocular: has joined #RubyOnRails
[12:24:00] Creeves: has joined #RubyOnRails
[12:24:44] asterisker: has joined #RubyOnRails
[12:24:49] FernandoBasso: has joined #RubyOnRails
[12:24:49] aderium: has joined #RubyOnRails
[12:25:03] asterisker: has left #RubyOnRails: ()
[12:25:17] mr_foobar: Hi, I am adding an alert system to my application. It's going to send alerts to "admin" users when some things happen e.g. incomplete data in the DB is detected during a routine scan, or errors appear in the logs. To seperate the types of alerts I am using tags. Currently each user has one AlertSubscription with the tag that the user subscribes to. Now I am not sure if I should store the tag as a String in the AlertSubscription model, (and in the
[12:25:18] mr_foobar: Alert model) or if I should rather create an AlertTag model as well and use only the tag_id in the former models.
[12:26:05] mr_foobar: Is it always considered bad practice to use Strings like that?
[12:28:42] Papierkorb: if you know the number of alerts in advance, I'd probably use a ENUM. Convenience of strings combined with the storage efficiency of integers
[12:29:40] bruno-: has joined #RubyOnRails
[12:29:57] Shidash: has joined #RubyOnRails
[12:32:09] mr_foobar: Papierkorb, how would you share the definition of the enum field in the models, instead of copy/pasting it? Using a concern?
[12:32:20] zorak8: has joined #RubyOnRails
[12:32:34] microdex: has joined #RubyOnRails
[12:33:03] mr_foobar: Since both the Alert and the AlertSubscription models have to have the same exact enum options in the same exact order to match.
[12:34:01] Papierkorb: mr_foobar: The ENUM is a database thing. I'm assuming Postgres, where I have something like execute("CREATE TYPE alert_tag AS ENUM('one', 'two', 'and so on')") in the migration. the models treat these as strings (At least in Rails4.2)
[12:34:27] Papierkorb: mr_foobar: Ah, yeah, it's a DB type, thus you can use the type in both models without issue
[12:34:58] mr_foobar: I used this in one of my other models: enum request_type: [ :direct, :manual, :redirect, :email ]
[12:35:05] mr_foobar: it is stored as an integer AFAIK
[12:35:34] Papierkorb: I think so too, but they're not database-level enums
[12:35:50] mr_foobar: That is correct.
[12:36:01] mr_foobar: Is there a disadvantage to that?
[12:36:47] Papierkorb: database enums look like they're strings, just that it forces the columns to only have the value of your defined ones, that they're stored internally as integer, and that you see a string when SELECTing them through rails or in a CLI tool making them easy to read
[12:37:08] artto: has joined #RubyOnRails
[12:37:12] Papierkorb: I've no clue what tag 5 is supposed to be, but "redirect" makes sense by reading it
[12:37:39] mr_foobar: That was from another model, not related to alerts.
[12:37:49] mr_foobar: It was to log Requests for a specific feature.
[12:37:59] Papierkorb: the concept stays the same
[12:38:28] Papierkorb: It all depends on your application, really. Do you need to quickly add and remove tags?
[12:39:01] Papierkorb: Enums are small, but you have to set them up inside the migration, you can only add values and never remove old values ever again.
[12:39:59] mr_foobar: Not necessarily, since they will only be added as I add new functionality for creating alerts when something happens. But I am wondering if maybe it would be better to create an AlertTag model so in the future I could add e.g. descriptions for the different types of tags, which users could read before subscribing to the alert tag/type.
[12:40:18] mr_foobar: But then again I could just put that in a static view as well...
[12:42:45] mr_foobar: Actually now that you point it out I wonder how one might go about disabling a certain enum value, e.g. an alert type that is not used anymore. Probably just raise an error before saving an Alert...
[12:42:55] Papierkorb: You can query the possible values of an enum to map them with a Hash or so for descriptions, though the SQL for that might not be perfectly obvious (and is highly RDBMS specific). And if you begin to maintain a hash of tag -> descriptions inside your app while having a similar structure in the DB, you're storing that stufff in two places for no real gain
[12:43:20] Papierkorb: mr_foobar: If you want to do that, I guess you should go with a Tag model instead
[12:43:46] Papierkorb: Then you can have DB level constraints. (I don't like app level constraints where I can do the same inside the DB..)
[12:44:20] G: has joined #RubyOnRails
[12:44:23] mr_foobar: Yeah I guess I'll do that. Thanks for helping me think that through.
[12:44:28] blackmesa: has joined #RubyOnRails
[12:45:04] startupality: has joined #RubyOnRails
[12:55:20] lethjakman: has joined #RubyOnRails
[12:59:42] eGGsha: has joined #RubyOnRails
[13:01:26] chouhoulis: has joined #RubyOnRails
[13:02:38] hotpancakes: has joined #RubyOnRails
[13:08:37] owenjones: has joined #RubyOnRails
[13:08:52] darrik: has joined #RubyOnRails
[13:09:40] jottr_: has joined #RubyOnRails
[13:10:48] surrealanalysis: has joined #RubyOnRails
[13:13:01] george2: has joined #RubyOnRails
[13:14:06] starfox_sf: has joined #RubyOnRails
[13:15:00] blackmesa: has joined #RubyOnRails
[13:15:37] chinmay_dd: has joined #RubyOnRails
[13:23:50] DoctorMonocular: has joined #RubyOnRails
[13:26:49] Scripore: has joined #RubyOnRails
[13:29:10] Papierkorb: has joined #RubyOnRails
[13:32:20] Papierkorb: has joined #RubyOnRails
[13:33:20] microdex: has joined #RubyOnRails
[13:36:58] hahuang65: has joined #RubyOnRails
[13:37:50] artto: has joined #RubyOnRails
[13:39:57] chinmay_dd: has joined #RubyOnRails
[13:43:39] varunwachaspati: has joined #RubyOnRails
[13:47:35] zorak8: has joined #RubyOnRails
[13:50:15] erich: has joined #RubyOnRails
[13:51:23] Pupeno: has joined #RubyOnRails
[13:51:33] blackmesa: has joined #RubyOnRails
[13:51:57] tlarevo: has joined #RubyOnRails
[13:54:12] stantona: has joined #RubyOnRails
[13:56:05] lethjakman: has joined #RubyOnRails
[13:57:45] konsolebox: has joined #RubyOnRails
[14:06:37] givanse: has joined #RubyOnRails
[14:09:23] owenjones: has joined #RubyOnRails
[14:13:52] gerep: has joined #RubyOnRails
[14:16:00] doodlehaus: has joined #RubyOnRails
[14:16:27] ruurd: has joined #RubyOnRails
[14:17:12] chouhoulis: has joined #RubyOnRails
[14:18:33] gerep: I have changed the timezone in my application.rb and I'm trying to test it. Loaded a record com my Companies table and changed the created_at column using Time.now, it show the correct Time (in the correct zone) but the record is still showing the old date. I have loaded the Company object again and it is not updated. https://gist.github.com/anonymous/8b3b9288fe1f1fa0b33d
[14:18:38] gerep: What am I doing wrong?
[14:18:51] krz: has joined #RubyOnRails
[14:19:39] gerep: It is possible to see in the gist, in the console, I have saved the object but the update command is still using the old date, not the new one
[14:22:14] sevenseacat: you set the created at, and then the created_at stays the same, and this is wrong>
[14:22:34] sevenseacat: the time in the database is always saved in UTC
[14:22:43] gerep: sevenseacat, I ahve the Company already created, and I'm trying to change the created_at column value with Time.now
[14:22:49] gerep: sevenseacat, it doesn't save my new date
[14:23:12] gerep: sevenseacat, so I can't see it here? What am I missing?
[14:23:30] sevenseacat: you're clearly setting the time to 2015-07-12 11:15:49 -0300
[14:23:31] gerep: sevenseacat, you can see that in the gist I sent, the console shows it is not updated
[14:23:34] sevenseacat: and it's staying that way
[14:23:46] sevenseacat: where is it not updating?
[14:23:58] sevenseacat: because it is being updated here https://gist.github.com/anonymous/8b3b9288fe1f1fa0b33d#file-gistfile1-txt-L11
[14:24:08] acovrig: has joined #RubyOnRails
[14:24:39] gerep: sevenseacat, see the update command values: ["created_at", "2015-07-12 14:15:49.611159"]
[14:24:49] sevenseacat: yes, thats the time you set, in UTC
[14:24:55] DoctorMonocular: has joined #RubyOnRails
[14:24:57] quazimodo: has joined #RubyOnRails
[14:24:58] sevenseacat: note it's three hours different from the time you set
[14:24:58] gerep: sevenseacat, and when I load the company again: c = Company.first, it is still with the old value
[14:25:06] sevenseacat: you have not shown that in the gist
[14:25:45] gerep: sevenseacat, https://gist.github.com/anonymous/8b3b9288fe1f1fa0b33d#file-gistfile1-txt-L17 you'll see the created_at is still with the old value
[14:25:56] gerep: sevenseacat, and yes, my time is three hours different
[14:26:34] blackmesa: has joined #RubyOnRails
[14:26:36] sevenseacat: now I'm very confused, because you're pointing out all the things that agree with what I'm saying
[14:26:39] gerep: sevenseacat, am I misunderstanding how it works? :)
[14:26:48] noodman: has joined #RubyOnRails
[14:26:55] sevenseacat: compare the value in that line to the value here https://gist.github.com/anonymous/8b3b9288fe1f1fa0b33d#file-gistfile1-txt-L4 - they are not the same.
[14:27:09] quazimod1: has joined #RubyOnRails
[14:27:15] lethjakman: has joined #RubyOnRails
[14:27:20] sevenseacat: because you changed it.
[14:27:53] benhuda: has joined #RubyOnRails
[14:29:30] gerep: sevenseacat, as in here: https://gist.github.com/anonymous/8b3b9288fe1f1fa0b33d#file-gistfile1-txt-L8 the hour should be 11:15:49 and not 14:15:49 as in here: https://gist.github.com/anonymous/8b3b9288fe1f1fa0b33d#file-gistfile1-txt-L17
[14:30:07] gerep: sevenseacat, The correct hour should be 11:15 and not 14:15
[14:30:49] sevenseacat: it is, when you check c.created_at.
[14:31:01] gerep: sevenseacat, but when I check c?
[14:31:07] gerep: sevenseacat, it shows 14:15
[14:31:18] sevenseacat: it shows 14:15 before you change it too
[14:31:23] sevenseacat: when it should say 11:15
[14:31:48] sevenseacat: have we now established that it is in fact updating it and can we move on?
[14:31:59] gerep: sevenseacat, no, sorry :)
[14:32:43] gerep: sevenseacat, in this line, when I print "c", it show the create_at with 14:15, which is wrong: https://gist.github.com/anonymous/8b3b9288fe1f1fa0b33d#file-gistfile1-txt-L17
[14:32:52] gerep: sevenseacat, it should be 11:15
[14:33:13] sevenseacat: thats nothing to do with you changing the time
[14:33:28] gerep: sevenseacat, I don't get it
[14:34:12] sevenseacat: the date it shows when you output c is the UTC time.
[14:34:17] microdex: has joined #RubyOnRails
[14:34:17] sevenseacat: I said that a couple of times now.
[14:34:38] Pupeno: has joined #RubyOnRails
[14:34:56] gerep: sevenseacat, so in the database it is "wrong" but it shows correctly when I use c.created_at?
[14:35:15] sevenseacat: the database is not wrong. the database stores times in UTC always, no matter what time zone your app is in.
[14:35:55] sevenseacat: 11:15 UTC -3 is exactly the same time as 14:15 UTC.
[14:35:57] owenjones: has joined #RubyOnRails
[14:36:36] yellow_face: has joined #RubyOnRails
[14:36:44] shock_one: has joined #RubyOnRails
[14:37:22] hotpancakes: has joined #RubyOnRails
[14:37:42] fwaokda: has joined #RubyOnRails
[14:38:33] artto: has joined #RubyOnRails
[14:38:44] bricker: has joined #RubyOnRails
[14:38:58] gerep_: has joined #RubyOnRails
[14:41:40] DLSteve: has joined #RubyOnRails
[14:46:03] gerep: sevenseacat, sorry, connection problem
[14:46:31] gerep: sevenseacat, Now I get it, you said that in the beginning of our conversation, sorry and thanks one more time for your patience :)
[14:47:25] gerep: sevenseacat, a question not related to Rails, where did you get that nickname from?
[14:47:41] sevenseacat: its a misheard song lyric from a song i like.
[14:48:07] gerep: sevenseacat, can you say the song name?
[14:48:14] sevenseacat: sure - wishmaster, by nightwish.
[14:48:22] Scripore: has joined #RubyOnRails
[14:48:25] gerep: sevenseacat, ;)
[14:49:04] davidbitton: has joined #RubyOnRails
[14:52:36] arup_r: has joined #RubyOnRails
[14:53:57] arup_r: I am trying to create an hash of attr/value pairs so that I can pass it to model directly... But I am getting error as unpermitted attributes.. What is the correct way of doing this ?
[14:54:06] arup_r: https://gist.github.com/aruprakshit/581b3974199433fe690b
[14:54:42] sevenseacat: you're not calling permit on the full_name and address attributes
[14:55:03] Scripore: has joined #RubyOnRails
[14:55:15] sevenseacat: your empty permit() does nothing
[14:55:28] arup_r: sevenseacat: Yes.. But they are not model attributes .. that's why I am trying to skip them..
[14:55:35] sevenseacat: doesnt matter
[14:55:41] bruno-: has joined #RubyOnRails
[14:55:53] arup_r: ok one min
[14:57:14] Shidash: has joined #RubyOnRails
[14:58:36] cool: has joined #RubyOnRails
[14:58:37] allcentury: has joined #RubyOnRails
[14:59:08] blackmesa: has joined #RubyOnRails
[14:59:30] Lytol: has joined #RubyOnRails
[14:59:37] arup_r: sevenseacat: https://gist.github.com/aruprakshit/581b3974199433fe690b same error
[14:59:48] arup_r: What's the correct way of doing this ?
[15:00:16] hotpancakes: has joined #RubyOnRails
[15:02:14] erich: has joined #RubyOnRails
[15:02:56] starfox_sf: has joined #RubyOnRails
[15:03:00] erich: has joined #RubyOnRails
[15:04:01] viiralvx: has joined #RubyOnRails
[15:04:31] shock_one: has joined #RubyOnRails
[15:05:28] sevenseacat: whats the return value of payment_request_params ? i dont actually know what that method would return
[15:06:45] arup_r: sevenseacat: https://gist.github.com/aruprakshit/581b3974199433fe690b#file-log-L7
[15:07:14] charliesome: has joined #RubyOnRails
[15:07:17] arup_r: error comes 2 times as the method `payment_request_params` getting called 2 ttimes..
[15:07:41] sevenseacat: in that case, I don't even know why you're using strong parameters at all
[15:07:41] arup_r: I inspected it using `puts` to see the output..
[15:07:47] elaptics: arup_r: what is it that you're trying to do?
[15:08:43] arup_r: I am trying to save some data to model payment ... those `udf1..N` fields are holding the billing address
[15:08:48] elaptics: if you use strong params and then pass that strong params array into the model then you'll get errors because it's the act of calling require and permit that causes the model to check
[15:09:09] sevenseacat: he's using strong params, then returning a completely different hash of data
[15:09:12] sevenseacat: so i dont know whats going on
[15:09:37] arup_r: sevenseacat: if I omit the extract! version I will get unknown attribute error
[15:09:59] microdex: has joined #RubyOnRails
[15:10:11] elaptics: arup_r: if you just want a few specific items from the params passed in, then just grab them and pass them in - forget strong params
[15:10:21] sevenseacat: like i said, i dont know why you're bothering with the strong params, the tap, and the permit
[15:10:23] arup_r: to prevent it .. I am trying to send the direct model attr/values but I don't see any other ways of using `permit` that's why I use `tap`
[15:10:27] sevenseacat: just build up a hash of the attributes you want
[15:10:39] elaptics: why are you getting loads of other stuff from the user and then throwing it away - why have it sent in the first place if you're not using it?
[15:11:23] tubbo: arup_r: strong parameters are mostly for filtering out params you don't want to deal with, it's really not for parsing params into a different data structure. for that, you should use some kind of PORO that sits between your controller and model
[15:12:18] Lightsword: has joined #RubyOnRails
[15:13:07] chipotle: has joined #RubyOnRails
[15:13:09] sevenseacat: i dont mind using the controller for doing it, but do it in a way that makes sense
[15:16:56] kitsuneyo: has joined #RubyOnRails
[15:17:08] hotpancakes: has joined #RubyOnRails
[15:17:26] tubbo: https://gist.github.com/tubbo/1727eb804ab15efae4db
[15:17:31] tubbo: arup_r: ^
[15:18:37] kitsuneyo: i'm adding a companies model to my database and i want a column for "headquarters_country" or something like that. what's the best way to deal with countries in rails? (i realise i can google this but looking for some good pointers :))
[15:19:04] kitsuneyo: do i use enum, a string with the name of each country, what's best
[15:19:23] arup_r: tubbo: wow... I was making it inside the controller only :) But where should this service class will go ? `/lib` ?
[15:19:26] sevenseacat: I'd use the carmen gem, and store the country code in the db
[15:20:17] sevenseacat: because it's never 'just' a country field
[15:23:09] arup_r: tubbo: where this class should go ideally ? lib/ or concern/ ?
[15:24:30] elaptics: arup_r: app/models is fine
[15:24:55] elaptics: arup_r: lib is for general library code, this is quite app specific
[15:25:06] elaptics: arup_r: and it's definitely not a concern
[15:25:20] arup_r: Humm.. makes sense
[15:25:40] arup_r: I never understood the philosophy of the concern although
[15:25:41] DoctorMonocular: has joined #RubyOnRails
[15:25:57] arup_r: I mean when to use it
[15:28:05] ruurd: has joined #RubyOnRails
[15:28:34] elaptics: arup_r: they're for shared code when you would otherwise duplicate it amongst several models. They should be used sparingly, not simply as a code junk drawer
[15:28:46] lethjakman: has joined #RubyOnRails
[15:29:14] shock_one: has joined #RubyOnRails
[15:32:16] shock_one: has joined #RubyOnRails
[15:32:27] shyshy: has joined #RubyOnRails
[15:32:58] arup_r: ok thanks elaptics sevenseacat and tubbo ... I never thought the code I got.. New way to arrange code I see now..
[15:34:49] Pupeno: has joined #RubyOnRails
[15:35:54] theery: has joined #RubyOnRails
[15:36:03] Pupeno: has joined #RubyOnRails
[15:36:33] Spami: has joined #RubyOnRails
[15:37:12] cleopatra: has joined #RubyOnRails
[15:38:43] Maletor: has joined #RubyOnRails
[15:39:21] artto: has joined #RubyOnRails
[15:40:20] Scripore: has joined #RubyOnRails
[15:42:24] bonhoeffer: has joined #RubyOnRails
[15:42:46] DEA7TH: has joined #RubyOnRails
[15:43:28] eggoez: has joined #RubyOnRails
[15:44:16] existensil: has joined #RubyOnRails
[15:44:52] l0oky: has joined #RubyOnRails
[15:47:53] MaDErroR123: has joined #RubyOnRails
[15:50:31] l0oky: has joined #RubyOnRails
[15:51:38] adavia: has joined #RubyOnRails
[15:55:56] hotpancakes: has joined #RubyOnRails
[15:56:45] l0oky: has joined #RubyOnRails
[16:01:21] DEA7TH: has joined #RubyOnRails
[16:01:54] noodman: has joined #RubyOnRails
[16:02:40] l0oky: has joined #RubyOnRails
[16:02:54] l0oky: Anyone online?
[16:02:59] chouhoulis: has joined #RubyOnRails
[16:03:13] l0oky: It sure seems quiet today in #rubyonrails
[16:04:46] shock_one: has joined #RubyOnRails
[16:05:20] fryguy: l0oky: you should just ask your question and hang out, maybe somebody driving by will see it and answer
[16:05:47] frido: has joined #RubyOnRails
[16:06:59] Papierkorb: has joined #RubyOnRails
[16:08:35] DEA7TH: has joined #RubyOnRails
[16:08:41] universa1: sshhh, don???t disturb anyone ;)
[16:09:02] l0oky: has joined #RubyOnRails
[16:09:33] frido: has joined #RubyOnRails
[16:12:16] blackmesa: has joined #RubyOnRails
[16:13:58] moeabdol: has joined #RubyOnRails
[16:15:28] frido: has joined #RubyOnRails
[16:19:34] jhack: has joined #RubyOnRails
[16:21:18] silverdust: It's Sunday. Always like this here on Weekends
[16:21:50] frido: i have a problem with rails3 .. maybe someone can halp me
[16:22:17] theery: has joined #RubyOnRails
[16:22:33] silverdust: frido: talk and someone who knows can help
[16:26:29] DoctorMonocular: has joined #RubyOnRails
[16:26:50] allcentury: has joined #RubyOnRails
[16:27:03] frido: i have an "Event"-model which should save a time-datatype, in my migration i used "add_column :events, :time, :time
[16:27:04] frido: after i save some "event" with 'time:10:00' and take a look at it, rails return's da datetime like "time: 2000-01-01 10:00:00"
[16:27:05] arup_r: it seems I know universa1 :
[16:27:08] x1337807x: has joined #RubyOnRails
[16:27:19] frido: i dont now why
[16:27:41] arup_r: I know silverdust too
[16:28:23] frido: anyone some suggestions ?
[16:28:29] universa1: frido: ruby has no time only datatype
[16:28:41] universa1: so rails will set some default date for it.
[16:29:41] universa1: frido: time and datetime are basically the same in ruby 2+ iirc
[16:30:50] arooni-mobile: has joined #RubyOnRails
[16:31:42] silverdust: frido: You can format the time by doing <%= time_from_db.strftime('%D') %>
[16:31:42] frido: ah ok ... thx ....
[16:31:43] frido: i was confused, because in my view it shows also an date and i dont want it
[16:32:05] silverdust: You can format the output to whatever you want with strftime
[16:32:21] universa1: if you want to format times i???d personally use the localization support from rails-i18n/i18n.
[16:32:22] frido: oh thx.... i will try it
[16:32:47] universa1: so just l(Time.now, format: :short) or alike.
[16:32:57] jdayvie: has joined #RubyOnRails
[16:33:10] universa1: this way you can define your format in one place, and nbot have it spread around your codebase in a lot of different places
[16:34:01] jdayvie: Good Morning =) Quick question: What would be the best way to have "pretty URLs"? Should I use something like friendly_id gem or is it better to manually achieve this? Thank you! =)
[16:34:06] moeabdol: has joined #RubyOnRails
[16:34:41] elaptics: jdayvie: depends how pretty they need to be?
[16:34:57] atrius: has joined #RubyOnRails
[16:35:14] jdayvie: I don't want the ID in the URL, because otherwise I know I could have id-name-needed.
[16:35:24] starfox_sf: has joined #RubyOnRails
[16:35:26] jdayvie: I have had that before but for what I want this time, I cannot have the ID in the URL.
[16:35:42] elaptics: jdayvie: so you want a slug field
[16:35:51] elaptics: that's unique for the urls
[16:36:01] jdayvie: Yes, I don't know a whole lot about them, but I know that is what will be needed.
[16:37:59] elaptics: jdayvie: friendly_id might be your easiest option. It doesn't take much to implement something basic though
[16:38:00] jdayvie: I just do not like to use Gems unless it really is a convenience to do so.
[16:38:18] jdayvie: IE: I use Devise to avoid creating that entire aspect from scratch.
[16:38:48] elaptics: jdayvie: depends how far you need to go. Why can't you just use id in this case?
[16:39:02] frido: thx. folks ... you are awesome ... now it works fine ;)
[16:39:11] jdayvie: Looking to have profile pages, so it would simply be best to have the username in the URL instead of their ID =P
[16:39:30] jdayvie: elaptics - Sorry, I keep forgetting to put your name =P
[16:39:37] shock_one: has joined #RubyOnRails
[16:40:05] elaptics: jdayvie: so username is already unique?
[16:40:08] artto: has joined #RubyOnRails
[16:40:15] Papierkorb: then just replace the "User.find id" with "User.find_by name: name" ?
[16:40:21] owenjones: has joined #RubyOnRails
[16:40:25] poli: has joined #RubyOnRails
[16:40:30] elaptics: jdayvie: ^ basically that :)
[16:40:45] elaptics: no need for anything else if it's just for that bit
[16:40:47] jdayvie: That makes perfect sense, since they are unique like IDs =P
[16:41:07] jdayvie: So wait...hmm, let me just try and make sure I do it correctly. *Goes to do it now*
[16:41:14] Papierkorb: maybe some sugar like case-insensitivity for the name if you like that
[16:41:31] jdayvie: Papierkorb: Not sure what that means?
[16:41:31] Papierkorb: easier to tell people about a profile as it lessens the fuck up potentional on their end
[16:41:40] Papierkorb: jdayvie: so that "foo" == "FOO"
[16:41:41] elaptics: assuming you're also making sure that they can only use urlsafe characters
[16:43:19] jdayvie: Oooh, so okay, just got confused with "sugar like" in that sentence but I understand what you mean =P
[16:43:50] jdayvie: So question, because I am having error either way...
[16:44:31] Oog: has joined #RubyOnRails
[16:44:38] Oog: in find_by_sql how can i escape a ? ?
[16:45:03] frido: has left #RubyOnRails: ()
[16:45:08] jdayvie: I tried @user = User.find(params[:user_name]) AND @user = User.find_by user_name: (params[:user_name]) but neither is working? I suppose I am confused still =P
[16:45:09] Papierkorb: Oog: please use placeholders
[16:45:42] Oog: ah literally put a ? and then '?' as the param?
[16:45:58] Papierkorb: Oog: Ah no, don't mind me, I may have misthought your question
[16:46:07] Oog: i think that will workthough...
[16:46:16] elaptics: jdayvie: unless you have changed your routes then the params will still be params[:id]
[16:46:21] Papierkorb: Oog: Why do you want to escape that character? Is it for a LIKE match?
[16:46:30] Oog: regex match
[16:46:39] Oog: sms_outter."body" !~ 'There (is|are) \\d* (?) orders? (?) in .+\\.'
[16:46:42] jdayvie: Oh, then where would I make the changes suggested?
[16:46:42] elaptics: jdayvie: @user = User.find_by(username: params[:id])
[16:46:48] Oog: the ? after orders is regex not a param
[16:46:54] jdayvie: Within the controller, right?
[16:47:00] matthias__: has joined #RubyOnRails
[16:47:03] elaptics: jdayvie: yes
[16:47:23] Papierkorb: Oog: So if that regex is fixed in the query, I'd try escaping the ? with \, so \?
[16:47:33] Oog: didnt fix it
[16:47:56] jdayvie: Elaptics: Hmm...that seems to cause an issue with another line in my controller...
[16:48:05] jdayvie: Should I make any changes elsewhere or should that one change work?
[16:48:14] elaptics: jdayvie: the only thing you'll need to do, is anywhere you're linking to the profile is specify the username instead of the id
[16:48:23] elaptics: jdayvie: what error? Gist what you got
[16:48:27] Papierkorb: Oog: The approach which will probably work is using a character group with only ?: [?]
[16:48:51] Papierkorb: Oog: Stupid solution though. Also try typing \\? if you haven't
[16:48:55] jdayvie: elaptics - Doing so now =)
[16:48:59] Oog: Papierkorb: i did that too
[16:49:16] Oog: and ?? and \?\? and \\?\\?
[16:49:25] jdayvie: https://gist.github.com/Jdayvie/c5f76c04d6e89efac39b
[16:49:45] Oog: this is terrible
[16:49:51] Oog: there must be a way
[16:49:51] elaptics: jdayvie: that's not finding the user
[16:49:53] Papierkorb: Oog: you want to match "??" ? Or what exactly?
[16:49:56] cleopatra: has joined #RubyOnRails
[16:50:15] Oog: but i cant escape it from find_by_sql it keeps want a parametr
[16:50:16] elaptics: jdayvie: if you're clicking a link to start that request then you need to fix the link like I mentioned
[16:50:54] jdayvie: Ah, duh! =P
[16:50:57] elaptics: jdayvie: i.e. the #find_by is returning nil - I imagine :id is still numeric
[16:50:57] jdayvie: Wonderful!!
[16:50:59] jdayvie: It works =)
[16:51:17] jdayvie: Thank you so much elaptics =)
[16:51:27] Papierkorb: Oog: could be that activerecord for whatever arcane reason tries to inject values into the queries by itself instead of letting the driver do that. You can try that by passing '?' as placeholder value ..
[16:51:47] jdayvie: Elaptics: Mind if I add one more add on question? =P
[16:52:43] jdayvie: Since I use Devise, all the profiles have /users in the URL. Would it actually work to adjust the route to remove the /users and just have the domain.com/user_name?
[16:53:01] universa1: jdayvie: so i
[16:53:08] universa1: jdayvie: it is possible.
[16:53:11] Oog: Papierkorb: didnt work
[16:53:24] jdayvie: With simple route altering then?
[16:53:31] surrealanalysis: has joined #RubyOnRails
[16:53:41] Papierkorb: Oog: What's the error you're getting? What does the code line look like?
[16:53:41] universa1: jdayvie: but then i???m an asshole user and name myself the same as one of your other routes ;)
[16:53:54] elaptics: jdayvie: personally I wouldn't bother. ^ otherwise you'll need to deal with that
[16:54:09] jdayvie: Good point :P
[16:54:16] jdayvie: Thank you for that! Will leave it as is =)
[16:54:21] tubbo: is https://github.com/rails/actioncable-examples working for anyone else?
[16:54:40] tubbo: doesn't seem to live refresh when a new message comes in from the other client on chrome...
[16:54:57] jdayvie: Elaptics & universa1 - Thank you =)
[16:55:05] Oog: ShortMessage.find_by_sql(["SELECT * FROM short_messages WHERE \"from\"='\?'"]).count
[16:55:14] Oog: ActiveRecord::PreparedStatementInvalid: wrong number of bind variables (0 for 1) in: SELECT * FROM short_messages WHERE "from"='?'
[16:55:16] Papierkorb: tubbo: Half OT, do you know if actioncable is supposed to be shipped with Rails5?
[16:55:39] universa1: tubbo: i???d be happy to try, but i???m in uganda currently and my internet is very slow :(
[16:56:31] Papierkorb: Oog: what about: ShortMessage.find_by_sql("SELECT * FROM short_messages WHERE \"from\"=?", ['?']).count # Stupid hack, the other should've already worked as placeholders are not supposed to be expanded inside strings
[16:56:42] Oog: no doesnt work
[16:56:59] theery: has joined #RubyOnRails
[16:57:10] Oog: PG::UndefinedFunction: ERROR: operator does not exist: text =?
[16:57:13] tubbo: Papierkorb: that is the intent, i believe.
[16:57:36] hotpancakes: has joined #RubyOnRails
[16:58:03] Oog: wait actually that does work but my situation is more complicated
[16:58:31] Oog: ShortMessage.find_by_sql(["SELECT * FROM short_messages WHERE \"from\"='hi ?'", '?']).count
[16:58:34] Papierkorb: tubbo: interesting, do you know when it's supposed to hit the shelves?
[16:58:37] giowong: has joined #RubyOnRails
[16:58:41] Oog: it generates this SELECT * FROM short_messages WHERE "from"='hi '?''
[16:58:45] Oog: puts in extra ' no good
[16:59:06] universa1: https://gist.github.com/anonymous/0f4ad3ce985838c60cf3
[16:59:06] universa1: so querying for a question mark works
[16:59:08] Papierkorb: Oog: try: ... "from" = CONCAT('hi ', ?)
[16:59:10] universa1: Oog: what are you actually trying to achieve?
[16:59:50] Papierkorb: Oog: Or, just prepend 'hi ' yourself to the variable in ruby. I think that's what I'd do do declutter the query a bit
[17:00:02] universa1: ShortMessage.where(from: ???hi ????)
[17:00:29] benhuda: has joined #RubyOnRails
[17:00:51] Oog: https://gist.github.com/anonymous/b10a2d36e560efe77bd9
[17:01:15] Oog: in the regex i need the s at end of order to be optional hence the ?
[17:01:57] adavia: is there something wong with simple form and bootstrap?
[17:02:21] jdayvie: Elaptics & universa1 - Is it possible to replace spaces with dashes simply or would that be the part for slugs?
[17:02:46] jdayvie: In the URL.
[17:02:53] elaptics: jdayvie: the username can have spaces?
[17:03:04] jdayvie: No, different project and was just curious =P
[17:03:11] universa1: jdayvie: not enough context.
[17:03:22] universa1: jdayvie: just url escape whatever you want in the url.
[17:03:33] universa1: %20 is a space iirc. but there should be a helper for that.
[17:03:34] elaptics: jdayvie: ah, I'd have an explicit slug field if you're wanting to use transformed content
[17:03:44] jdayvie: For an article title, where there spaces and a few words.
[17:03:55] elaptics: jdayvie: but there's other things to start thinking about that, like what happens when content changes
[17:03:55] Oog: i cant believe there is no way to escape the ?
[17:04:25] giowong: is there a way to write a one line active record query to access a relation defined in the mode?
[17:04:30] eminencehc_: has joined #RubyOnRails
[17:04:48] elaptics: giowong: ? model.association
[17:04:51] giowong: example query attempted
[17:04:52] giowong: puts Property.find_by(zip_code: "22405").user_id.User.find(agentid)
[17:05:06] jdayvie: Hmmm, alrighty then, I will hold off on that for the other idea.
[17:05:06] Papierkorb: giowong: puts Property.find_by(zip_code: "22405").user
[17:05:08] jdayvie: Thank you =)
[17:05:10] elaptics: giowong: what are you trying to do?
[17:06:07] giowong: Papierkorb: thanks mate that worked
[17:06:12] elaptics: giowong: !associations
[17:06:12] helpa: giowong: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[17:06:15] giowong: elaptics: just accessing attributes
[17:06:24] Papierkorb: giowong: I happily dropped the second find() though.
[17:06:32] giowong: yeah im new to rails
[17:06:40] giowong: i actually take that back
[17:06:44] giowong: still learning
[17:06:45] elaptics: giowong: I recommend you read through the guides then
[17:07:41] universa1: Oog: ShortMessage.where(from: cleanse_phone).where(???created_at > ????, 2.days.ago).where.not(body: cleanse_phone).where.not(body: whatever) ...
[17:08:03] Oog: universa1: https://gist.github.com/anonymous/b10a2d36e560efe77bd9
[17:08:11] Oog: too complicated
[17:08:19] Oog: just need to escape ?
[17:09:32] Maletor: has joined #RubyOnRails
[17:09:45] giowong: quick question
[17:09:47] Papierkorb: tubbo: The action cable example works for me in Chromium Version 43.0.2357.132 (64-bit), using the default profile and the private browsing one
[17:10:04] giowong: does it make sense to do a association if i just need one part of the associations attribute?
[17:10:13] giowong: while the rest doesnt matter?
[17:10:20] giowong: or should i do aa query instead
[17:10:27] srinidhi: has joined #RubyOnRails
[17:10:30] Papierkorb: I wonder though why we need a separate process just for websocket?
[17:10:41] universa1: Oog: where exactly do you need to escape the ?
[17:10:41] universa1: Oog: because right now you???re using the ? as the replacement parameter. you could be explicit and use :user_id, :from, etc....
[17:10:41] universa1: Oog: and supply a hash as the options for the query
[17:10:41] universa1: Oog: so where(???from = :from???, {from: ???hi ????})
[17:10:48] Oog: shit http://apidock.com/rails/v3.1.0/ActiveRecord/Base/replace_bind_variables/class no way to escape
[17:11:54] Oog: cool didnt know about that will try
[17:12:01] elaptics: giowong: what's the context?
[17:12:02] universa1: Oog: replace ? with {0,1}
[17:12:09] LJT: has joined #RubyOnRails
[17:12:15] elaptics: giowong: fwiw an association is doing a query anywhere
[17:12:17] Oog: universa1: genius that will work
[17:13:57] Oog: finally! fml that was terrible
[17:13:58] Oog: thank you
[17:16:09] giowong: im pulling some data using an api from mixpanel
[17:16:38] giowong: i have to do a look up for the some of the data pulled to get something specific
[17:16:54] rcosta_: has joined #RubyOnRails
[17:17:12] smathy: has joined #RubyOnRails
[17:17:22] theery: has joined #RubyOnRails
[17:17:46] lethjakman: has joined #RubyOnRails
[17:17:58] elaptics: giowong: if you literally just need a single attribute you could use #pluck but otherwise until performance is definitely an issue, just use the associations
[17:18:48] giowong: i think i need to consider performance
[17:19:02] giowong: because over time the data pulled will get significantly larger
[17:19:17] giowong: right now its less < 20
[17:19:36] giowong: maybe in a year or 2 it will get to as big as 1000
[17:20:34] chouhoulis: has joined #RubyOnRails
[17:21:24] dc1: has joined #RubyOnRails
[17:22:38] elaptics: giowong: Wait until then
[17:23:25] elaptics: giowong: prematurely optimizing things is just a waste of time
[17:23:44] elaptics: chances are the bottleneck won't be that at the time
[17:24:05] giowong: thank you kind sir
[17:27:11] DoctorMonocular: has joined #RubyOnRails
[17:29:04] arooni-mobile: has joined #RubyOnRails
[17:32:36] theery: has joined #RubyOnRails
[17:32:58] kham: has joined #RubyOnRails
[17:33:51] Maletor: has joined #RubyOnRails
[17:34:24] Cache_Money: has joined #RubyOnRails
[17:35:54] pontiki: "premature optimization is the root of all [programming] evil" - D. Knuth
[17:37:05] Pupeno: has joined #RubyOnRails
[17:39:57] Lytol: has joined #RubyOnRails
[17:40:13] charliesome: has joined #RubyOnRails
[17:40:52] artto: has joined #RubyOnRails
[17:41:11] bhuvanaurora: has joined #RubyOnRails
[17:41:27] owenjones: has joined #RubyOnRails
[17:42:11] yardenbar: has joined #RubyOnRails
[17:43:22] JulienTa_: has joined #RubyOnRails
[17:43:25] Franklin: has joined #RubyOnRails
[17:43:39] Franklin: Hi there, any idea how i could manage to get user submitted translations for my i18n?
[17:44:01] Franklin: I am looking for any simple platform/engine that users can simply add translations to.
[17:45:20] yardenbar: has joined #RubyOnRails
[17:45:23] JulienTa_: I'm trying RoR, and kinda discovering ruby. I noticed that there is a lot a way to do the thing like : function(parameter) or function parameter // hash['hey'] or hash[:key] or hash.key - And i'm like : working in a team context must be very hard. So, is there some kind of convention or good practice ?
[17:45:45] simplyianm: has joined #RubyOnRails
[17:46:07] fryguy: JulienTa_: can you explain a bit more? Having all of that as a single sentence doesn't really make sense to me
[17:46:11] simplyianm: has joined #RubyOnRails
[17:46:14] kham: has joined #RubyOnRails
[17:46:43] Franklin: No apps for user translations? :/
[17:46:56] kies^: has joined #RubyOnRails
[17:48:43] JulienTa_: My question is, does code style convention exists in ruby ? So that a newbie can easily choose which of those (hash['key'] or hash[:key] or hash.key) is the best way to go
[17:49:03] fryguy: well hash['key'] and hash[:key] are different things
[17:49:06] fryguy: and so is hash.key
[17:49:14] fryguy: they aren't directly interchangeable by default
[17:49:58] fryguy: and hash.key, if you are talking about a ruby Hash, isn't actually a thing
[17:50:15] JulienTa_: No it's just a var name
[17:50:31] fryguy: the type of that variable is pretty important
[17:50:47] Pupeno: has joined #RubyOnRails
[17:51:18] JulienTa_: https://cloudup.com/cTJov47YwZR < is that outdated ?
[17:51:40] JulienTa_: cause the guy is using the dot syntax
[17:51:45] Franklin: i am not aware of a dot syntax. lol
[17:51:52] fryguy: it depends on what type of object "t" is
[17:52:18] Franklin: does not work for me ether
[17:52:21] JulienTa_: it's a model i guess
[17:52:45] Franklin: but fryguy, best practice is clearly using symbols as in :symbol, because they dont get handled as string internally (AFAIK)
[17:53:05] fryguy: Franklin: yes, I'm aware of how symbols work
[17:53:36] Franklin: ah sorry, wrong tag i ment JulienTa_
[17:53:46] fryguy: JulienTa_: ActiveRecord::Base exposes model variables both via dot syntax and hash syntax, and they are generally interchangeable, with a few exceptions
[17:54:18] Franklin: ahh ok active record i a different boat, those are actual objects and not hashes so it makes sense
[17:54:19] fryguy: JulienTa_: it's extremely uncommon to reference a property on an AR::Base object using hash[] notation
[17:54:57] JulienTa_: ok thanks, some questions can be kinda dumb i'm a very beginner with Ruby & Rails (so far, i kinda like it)
[17:55:06] Coldblackice: has joined #RubyOnRails
[17:55:17] viiralvx: has joined #RubyOnRails
[17:56:30] JulienTa_: I'm reading a lot of tutorial, and my biggest issue is that some guys are using parenthesis around functions parameters, some not, same thing for the braces a hash is the last parameter of a function
[17:57:40] JulienTa_: About symbols, i was pretty sure it would be the best choice ;)
[17:57:50] fryguy: parenthesis are usually optional with function calls. maybe takes a little while to read it. Most people exclude them for simple expressions, and include them for anything more complex
[17:58:37] JulienTa_: so i better omit them by default, and use them for complex calls
[17:58:50] blackmesa: has joined #RubyOnRails
[17:59:20] fryguy: https://github.com/bbatsov/ruby-style-guide
[17:59:23] roolo: has joined #RubyOnRails
[17:59:29] fryguy: https://github.com/bbatsov/rubocop
[17:59:44] lxsameer: has joined #RubyOnRails
[18:01:57] mary5030: has joined #RubyOnRails
[18:02:07] netzfisch: has joined #RubyOnRails
[18:02:11] kitsuneyo: has joined #RubyOnRails
[18:02:56] kitsuneyo: hey again, had to leave last time. sevenseacat, thanks for your suggestion of the carmen gem, i'll look that up
[18:03:49] kitsuneyo: oh he's not here anymore
[18:04:17] jdayvie: has joined #RubyOnRails
[18:05:25] Franklin: has left #RubyOnRails: ()
[18:05:41] noodman: has joined #RubyOnRails
[18:09:07] erich: has joined #RubyOnRails
[18:10:05] lapide_viridi: has joined #RubyOnRails
[18:16:32] hotpancakes: has joined #RubyOnRails
[18:19:10] balr0g: has joined #RubyOnRails
[18:20:19] jdayvie: Howdy =) Could anyone tell me the regular expression format for only all symbols (not letters and not numbers)?
[18:20:36] jdayvie: I've been reading through a really good regular expression guide but its tough to wrap my head around it. Still trying =P
[18:21:20] WeiJunLi: has joined #RubyOnRails
[18:21:54] jdayvie: I was thinking \W (non word characters) but then that excludes numbers too.
[18:22:12] jdayvie: Unless I do \W || \D?
[18:22:38] jdayvie: Well, I guess I would do and, not or.
[18:23:52] girakrok: has joined #RubyOnRails
[18:23:56] tubbo: jdayvie: you could try \W|\d
[18:24:06] tubbo: jdayvie: http://rubular.com/r/fa0p14JXgn
[18:24:17] JulienTa_: wow, so many things to fix with default code provided by RoR
[18:24:29] JulienTa_: robucop doesn't like it
[18:24:58] bob14: has joined #RubyOnRails
[18:25:12] tubbo: rubocop is a little strict for my tastes too
[18:25:31] jdayvie: Thank you Tubbo - That expression would then block out numbers too?
[18:25:31] vigintas999: has joined #RubyOnRails
[18:25:55] tubbo: for example, here's my .rubocop.yml from a project i just finished https://gist.github.com/3d72614b84ff91be4889
[18:26:09] fryguy: we are currently working on our rubocop.yml at work
[18:26:12] tubbo: jdayvie: the expression matches on non-word characters OR numbers.
[18:26:16] fryguy: started from bbatsov's, trying to change as little as possible
[18:26:47] tubbo: a few things i disagree with:
[18:26:58] tubbo: 1.) single-quoted strings. it's a bullshit argument and a bullshit reason
[18:27:08] jdayvie: Tubbo - I like that site, thank you! The characters highlighted are what would be excluded or included?
[18:27:09] fryguy: yah we changed that one
[18:27:13] tubbo: 2.) the way YARD processes top-level module documentation is incompatible with Rubocop's rules on the matter.
[18:27:20] fryguy: yah we changed that one
[18:27:27] fryguy: DO YOU WORK WITH ME?!
[18:27:51] tubbo: fryguy: haha probably not...we actually don't use rubocop at work as a standard
[18:27:58] DoctorMonocular: has joined #RubyOnRails
[18:28:15] tubbo: i use rubocop on my own, and on the projects i lead
[18:28:29] pontiki: oh , you mean you don't install rubocop as a pre-commit hook?
[18:28:39] JulienTa_: Rubocop is like "You comment like is too long"
[18:28:42] JulienTa_: fuck you man xD
[18:30:00] tubbo: pontiki: well i have it installed globally so syntastic will still work with style-checking as well as syntax-checking in ruby
[18:30:17] tubbo: pontiki: but we also run Tailor on the bamboo CI server as part of our testing process
[18:30:27] pontiki: i was being sarcastic
[18:32:04] bob14: has joined #RubyOnRails
[18:32:25] J4R0D: has joined #RubyOnRails
[18:32:44] eggoez: has joined #RubyOnRails
[18:36:06] JulienTa_: tubbo : this is mine : https://gist.github.com/JulienTant/349b33a7f52a229482af
[18:36:50] bob14: does anyone know how to get the image_id for an ec2 instance for rubber? I want to use t2.micro and my image_id: is "ami-92f569fa" but it says its unsupported
[18:37:47] bruno-: has joined #RubyOnRails
[18:39:29] kitsuneyo: has joined #RubyOnRails
[18:39:47] tubbo: JulienTa_: if you use Vim, set up word wrapping to 80 characters so your comments won't go past that.
[18:39:53] tubbo: if that's your thing
[18:40:39] JulienTa_: tubbo : That's not my comments, that's the default RoR comments ^^ (those you get after a rails new app
[18:41:13] JulienTa_: It's quite rare that i comment my code
[18:41:35] artto: has joined #RubyOnRails
[18:41:43] alphaatom: has joined #RubyOnRails
[18:42:15] tubbo: oh righ t:)
[18:42:27] tubbo: yeah i end up deleting most of those
[18:42:46] owenjones: has joined #RubyOnRails
[18:42:50] kitsuneyo: so is carmen-rails still safe to use? it was written for rails 3 and isn't maintained anymore...
[18:44:36] tubbo: kitsuneyo: check the issues, https://github.com/jim/carmen-rails/issues
[18:44:41] tubbo: doesn't look too promising
[18:45:10] tubbo: you could still use Carmen and just implement the rails integrations yourself
[18:45:39] kitsuneyo: you mean write the methods that carmen provides myself?
[18:46:41] tubbo: kitsuneyo: no, that would not be using Carmen :D
[18:46:41] kitsuneyo: oh i guess carmen is something separate from the gem?
[18:46:50] tubbo: carmen-rails is just the rails integration
[18:46:55] kitsuneyo: ok i need to look that up
[18:47:17] tubbo: kitsuneyo: it's made by the same author https://github.com/jim/carmen
[18:48:31] kitsuneyo: i see, thanks tubbo
[18:48:52] kitsuneyo: have you used this before? is it easy?
[18:49:38] kitsuneyo: tbh i don't think i can do rails integrations for this, i wouldn't know where to start
[18:51:06] ss2: has joined #RubyOnRails
[18:52:43] givanse: has joined #RubyOnRails
[18:54:13] SeanLazer: has joined #RubyOnRails
[18:54:51] DoctorMonocular: has joined #RubyOnRails
[18:55:33] kitsuneyo: what is the difference between carmen and carmen-rails anyway?
[18:55:52] creature: has joined #RubyOnRails
[18:56:37] eggoez: has joined #RubyOnRails
[18:57:15] smathy: has joined #RubyOnRails
[18:58:18] theery: has joined #RubyOnRails
[18:58:20] RegulationD: has joined #RubyOnRails
[18:59:14] shyshy: has joined #RubyOnRails
[19:00:16] seank_: has joined #RubyOnRails
[19:03:03] ruurd: has joined #RubyOnRails
[19:04:18] yfeldblum: has joined #RubyOnRails
[19:05:25] arooni-mobile: has joined #RubyOnRails
[19:06:31] lethjakman: has joined #RubyOnRails
[19:07:52] cornerma1: has joined #RubyOnRails
[19:08:59] eminencehc_: has joined #RubyOnRails
[19:09:37] cleopatra: has joined #RubyOnRails
[19:14:00] marr: has joined #RubyOnRails
[19:14:37] netzfisch: has joined #RubyOnRails
[19:14:42] arooni-mobile__: has joined #RubyOnRails
[19:15:06] arooni-mobile__: has joined #RubyOnRails
[19:15:39] arooni-mobile__: has left #RubyOnRails: ()
[19:16:16] alphaatom: has joined #RubyOnRails
[19:16:33] arooni-mobile__: has joined #RubyOnRails
[19:18:09] theery: has joined #RubyOnRails
[19:20:15] tsvenson: has joined #RubyOnRails
[19:20:45] acovrig: has joined #RubyOnRails
[19:20:52] Lightsword: has joined #RubyOnRails
[19:20:53] jhack: has joined #RubyOnRails
[19:20:53] jhack: has joined #RubyOnRails
[19:22:51] joedayvie: has joined #RubyOnRails
[19:23:58] toretore: has joined #RubyOnRails
[19:27:03] Lightsword_: has joined #RubyOnRails
[19:27:11] bronson: has joined #RubyOnRails
[19:28:53] towski_: has joined #RubyOnRails
[19:32:08] startupality: has joined #RubyOnRails
[19:33:18] cleopatra: has joined #RubyOnRails
[19:33:19] viiralvx: has joined #RubyOnRails
[19:42:20] artto: has joined #RubyOnRails
[19:42:44] nya: has joined #RubyOnRails
[19:43:29] owenjones: has joined #RubyOnRails
[19:44:13] roolo_: has joined #RubyOnRails
[19:47:00] nya: has joined #RubyOnRails
[19:47:01] theery: has joined #RubyOnRails
[19:48:02] wasp__: has joined #RubyOnRails
[19:48:18] erich: has joined #RubyOnRails
[19:48:33] theery: has joined #RubyOnRails
[19:50:01] Jasaka: has joined #RubyOnRails
[19:52:59] nya: has joined #RubyOnRails
[19:53:08] joedayvie: has joined #RubyOnRails
[19:55:29] ght: Question: Can anyone explain why the following code in my routes.rb is creating the update route as "account" instead of "accounts"?
[19:55:32] ght: https://gist.github.com/anonymous/e3ce2138c8df4595a8e4
[19:56:16] bhuvanaurora: has joined #RubyOnRails
[19:56:57] jdayvie: has joined #RubyOnRails
[19:57:47] jdayvie: Howdy - I seem to be having an issue with authentication to allow a gust to view a user profile. It seems to cause errors due to not unknown methods which are all the columns of the table.
[19:58:11] jdayvie: to allow a guest**
[19:59:20] Lytol: has joined #RubyOnRails
[19:59:23] Lightsword: has joined #RubyOnRails
[19:59:30] cleopatra: has joined #RubyOnRails
[20:01:03] seank_: has joined #RubyOnRails
[20:01:20] Lightsword: has joined #RubyOnRails
[20:02:00] rhizome: are you going to tell us what that issue is?
[20:03:14] DoctorMonocular: has joined #RubyOnRails
[20:04:10] ellisTAA: has joined #RubyOnRails
[20:04:31] jdayvie: rhizome: Do you mean me?
[20:04:38] doodlehaus: has joined #RubyOnRails
[20:04:58] adavia: lets say i have multiple comment forms in my post index page. how can i make sure in my create.js.erb im rendering the correct form https://gist.github.com/adavia/1f5bfa849de0c863373b
[20:05:16] ellisTAA: i am trying to set up a mailer that emails people when they sign up for my site. when i test it out the email is generated and i can see the content in the server log but when i check my email i dont get the email, is this because i???m in development mode?
[20:05:40] cooldman224: has joined #RubyOnRails
[20:06:18] chouhoulis: has joined #RubyOnRails
[20:06:27] jdayvie: Hmm...for some reason it started working...
[20:06:57] jdayvie: Nevermind, not sure what I had wrong but its up and running now.
[20:07:52] mrbubbles: has joined #RubyOnRails
[20:08:26] bin_005: has joined #RubyOnRails
[20:09:13] mary5030: has joined #RubyOnRails
[20:11:04] Maletor: has joined #RubyOnRails
[20:11:28] rhizome: EllisTAA: most likely
[20:11:47] ellisTAA: rhizome: thank you :)
[20:13:41] lapide_viridi: has joined #RubyOnRails
[20:18:25] ellisTAA: my rails app uses sqlite3, is there an easy way to change it to postgres?
[20:19:10] Jasaka: has joined #RubyOnRails
[20:19:12] rhizome: think it through. what do you think could go wrong?
[20:20:38] ellisTAA: activerecord stuff can get messed up?
[20:20:53] rhizome: what do you mean?
[20:20:54] ellisTAA: well but maybe not since the database is empty ...
[20:21:32] ellisTAA: i dont think anything would go wrong since my db is empty
[20:24:27] benhuda: has joined #RubyOnRails
[20:24:42] x-light: has joined #RubyOnRails
[20:26:22] cleopatra: has joined #RubyOnRails
[20:27:07] mrbubbles: has joined #RubyOnRails
[20:27:53] seank_: has joined #RubyOnRails
[20:28:19] tsvenson: has joined #RubyOnRails
[20:29:51] jottr: has joined #RubyOnRails
[20:31:53] Lightsword: has joined #RubyOnRails
[20:33:34] siemprefresco: has joined #RubyOnRails
[20:33:54] yardenbar: has joined #RubyOnRails
[20:35:09] war_pigs: has joined #RubyOnRails
[20:35:19] elaptics: EllisTAA: if you're in development still then switching to postgres is simply a matter of changing the database adaptor, etc in the database config
[20:35:34] josh: has joined #RubyOnRails
[20:35:38] ellisTAA: elaptics: cool thank you
[20:35:42] elaptics: EllisTAA: assuming you haven't done any database specific stuff anywhere
[20:36:11] elaptics: if you have only done vanilla activerecord stuff then probably not
[20:36:45] war_pigs: has joined #RubyOnRails
[20:38:13] kitsuneyo: has joined #RubyOnRails
[20:40:28] josh1: has joined #RubyOnRails
[20:40:29] vickleton_: has joined #RubyOnRails
[20:43:09] artto: has joined #RubyOnRails
[20:44:14] owenjones: has joined #RubyOnRails
[20:44:23] viiralvx: has joined #RubyOnRails
[20:44:26] josh2: has joined #RubyOnRails
[20:45:23] eggoez: has joined #RubyOnRails
[20:45:30] meoblast001: has joined #RubyOnRails
[20:47:06] RegulationD: has joined #RubyOnRails
[20:50:11] allcentury: has joined #RubyOnRails
[20:52:39] charliesome: has joined #RubyOnRails
[20:54:33] ellisTAA: im trying to deploy to heroku so i switched my db to postgres and changed my db yml file to have postgres configred, then i deleted sqlitre3 from my gem file but when i try to push up to heroku i get an error message https://gist.github.com/ellismarte/9e62185a5c1181e0b2b9 anyone run into this problem?
[20:55:25] lethjakman: has joined #RubyOnRails
[20:55:59] fryguy: did you run bundle after deleting the entry
[20:56:40] jdayvie: Also, not sure if it would help, but also you may have to push the DB onto heroku too?
[20:56:58] jdayvie: Anytime I alter the database locally, I used to always forget to push it onto heroku as well.
[20:57:11] meoblast001: has joined #RubyOnRails
[20:58:48] ellisTAA: i thought i ran bundle but ill try it again
[20:59:48] ellisTAA: nope that didn???t work
[21:00:03] fryguy: paste your gemfile.lock
[21:00:09] Lytol: has joined #RubyOnRails
[21:02:01] ellisTAA: https://gist.github.com/ellismarte/2a5f8b367ed87b5249e5
[21:03:55] elaptics: EllisTAA: is postgres actually working for you in development?
[21:04:03] elaptics: EllisTAA: can you just paste your Gemfile
[21:04:07] ellisTAA: it???s working on localhost
[21:04:34] ellisTAA: https://gist.github.com/ellismarte/11360359b95463406a60
[21:04:59] elaptics: EllisTAA: I suspect you still have the sqlite gem listed somewhere. What's in your database.yml file?
[21:05:22] ellisTAA: sqlite3 isn???t in the db yml file
[21:05:36] ellisTAA: its all pg in there
[21:05:47] elaptics: EllisTAA: you'll also want to just list the pg gem once in the Gemfile - take it out the development/test group
[21:05:59] elaptics: EllisTAA: what adaptor have you specified in the database.yml?
[21:06:30] ellisTAA: so this app was initialized with sqlite3
[21:06:43] ellisTAA: i siwtched to post
[21:06:53] elaptics: EllisTAA: are you sure you have committed everything - clearly there's still a reference to sqlite somewhere
[21:07:06] chouhoulis: has joined #RubyOnRails
[21:07:17] fryguy: is your database.yml even in version control?
[21:08:00] creature: has joined #RubyOnRails
[21:08:14] ellisTAA: fryguy??? i should check .gitignore right?
[21:08:42] simplyianm: has joined #RubyOnRails
[21:08:47] stef1a: has joined #RubyOnRails
[21:09:25] ellisTAA: it looks like sqlite3 shows up in tmp folder ??? but i can???t find that ??? anyone know where it is, i think ill just go in and delete it
[21:09:32] ellisTAA: the reference to sqlite3
[21:10:43] stef1a: i'm using rspec, capybara, warden, and rails 4. i'm trying to log in a user in a spec, but login_as does nothing, and raises no error. how can i figure out why it's not logging the user in? does `login_as!` exist?
[21:12:04] elaptics: EllisTAA: you're talking about the references in the error? That's just where heroku is trying to build the gem. It shouldn't even be doing that unless you have some reference to the sqlite gem still?
[21:12:12] giowong: has joined #RubyOnRails
[21:12:24] hanss: has joined #RubyOnRails
[21:13:09] ellisTAA: oh snap i think i figured it out
[21:13:32] ellisTAA: so i think the problem was is i made changed and didn???t push up to github
[21:14:02] LJT: has joined #RubyOnRails
[21:14:21] DoctorMonocular: has joined #RubyOnRails
[21:17:10] simplyianm: has joined #RubyOnRails
[21:17:27] owenjones: has joined #RubyOnRails
[21:21:44] Pupeno: has joined #RubyOnRails
[21:24:28] lucha: has joined #RubyOnRails
[21:25:38] cmhobbs: has joined #RubyOnRails
[21:25:44] Lightsword_: has joined #RubyOnRails
[21:27:43] cmhobbs: i've got a situation where i'm not sure what sort of association to use. i've got events that can be accepted by a user. a user has many events ("hosting" an event) but i'm not sure the best way to associate other users with those events as attening the event
[21:28:06] cmhobbs: seems like a simple problem, any ideas on the best associations for the job?
[21:29:03] elaptics: cmhobbs: so a user can attend many events?
[21:29:05] dclo: has joined #RubyOnRails
[21:29:16] cmhobbs: elaptics, yes
[21:29:21] cmhobbs: and a user can create many events
[21:30:18] elaptics: cmhobbs: an event can be hosted by one user?
[21:30:32] cmhobbs: yeah, only a single user can create an event
[21:30:43] cmhobbs: an event wouldn't have multiple hosts
[21:31:06] elaptics: cmhobbs: so an Event belongs_to :host, class_name: "User"
[21:31:36] Pupeno: has joined #RubyOnRails
[21:31:47] cmhobbs: elaptics, right now it's set up as an event belongs_to :user, and a user has_many :events
[21:32:17] elaptics: cmhobbs: I would change the names so it's clear what the relationship means
[21:32:31] cmhobbs: sure. this is pretty nascent so that should be easy
[21:32:49] elaptics: cmhobbs: You could then have an attendance model and associate the other users through that for the attendees
[21:32:57] cmhobbs: ah, great idea
[21:33:41] simplyianm: has joined #RubyOnRails
[21:36:25] TheShaun: has joined #RubyOnRails
[21:36:54] tsvenson: has joined #RubyOnRails
[21:37:25] TheShaun: has joined #RubyOnRails
[21:38:40] dopie: has joined #RubyOnRails
[21:39:37] JarekTkaczyk: has joined #RubyOnRails
[21:39:48] simplyianm: has joined #RubyOnRails
[21:39:58] JarekTkaczyk: has left #RubyOnRails: ()
[21:40:53] jottr: has joined #RubyOnRails
[21:41:04] eminencehc_: has joined #RubyOnRails
[21:43:41] gerep: has joined #RubyOnRails
[21:43:48] artto: has joined #RubyOnRails
[21:45:26] simplyianm: has joined #RubyOnRails
[21:45:57] josh2: has joined #RubyOnRails
[21:47:17] j4d: has joined #RubyOnRails
[21:47:21] startupality: has joined #RubyOnRails
[21:50:18] calgaryeng: has joined #RubyOnRails
[21:50:53] gerep: I have this table on Heroku and a defined timezone for my application. When I save a record or update it, it is always saving with the time 21:00:00
[21:50:54] gerep: https://gist.github.com/anonymous/3b3e07b3308b02566e93
[21:51:00] gerep: What am I doing wrong here?
[21:51:27] calgaryeng: has left #RubyOnRails: ()
[21:51:57] gerep: When I test on my console it works as expected but I can't show it properly.
[21:52:26] baweaver: has joined #RubyOnRails
[21:53:11] baweaver_: has joined #RubyOnRails
[21:53:41] svkurowski: has joined #RubyOnRails
[21:53:51] calgaryeng: has joined #RubyOnRails
[21:54:54] gerep: Found it: Time.zone.now when saving my dates =)
[21:55:27] svkurowski: In production I am running ruby with rbenv and the thin server globally installed via gem install thin. However rails has stronger dependencies than thin (rack >= 1.6.4 or something) and thus I have to manually install rack globally using gem install rack -v 1.6.4. How do you solve this problem?
[21:59:32] VTLob: has joined #RubyOnRails
[22:00:48] cleopatra: has joined #RubyOnRails
[22:00:52] Lytol: has joined #RubyOnRails
[22:03:13] VeryBewitching: has joined #RubyOnRails
[22:03:26] platzhirsch: has joined #RubyOnRails
[22:04:50] JeramyRR: has joined #RubyOnRails
[22:05:15] bricker: has joined #RubyOnRails
[22:06:46] Lightsword_: has joined #RubyOnRails
[22:07:48] viiralvx: has joined #RubyOnRails
[22:08:06] VeryBewitching: has joined #RubyOnRails
[22:08:42] Scripore: has joined #RubyOnRails
[22:09:07] Radar: GIID NIRBUBG
[22:09:11] Radar: Whoops :)
[22:09:13] Radar: GOOD MORNING!!
[22:10:04] gnagno: has joined #RubyOnRails
[22:10:07] gnagno: hello all
[22:10:20] VeryBewitching: <-- was Etriaph, FYI
[22:10:56] VeryBewitching: Etriaph is a gaming identity, wasn't really applicable to work, so
[22:12:54] nfk: has joined #RubyOnRails
[22:13:08] brianpWins: has joined #RubyOnRails
[22:15:00] simplyianm: has joined #RubyOnRails
[22:15:04] zorak8: has joined #RubyOnRails
[22:15:11] Lightsword_: has joined #RubyOnRails
[22:15:26] Pupeno: has joined #RubyOnRails
[22:15:26] Pupeno: has joined #RubyOnRails
[22:16:56] arBmind: has joined #RubyOnRails
[22:17:51] jottr: has joined #RubyOnRails
[22:18:25] l0oky: has joined #RubyOnRails
[22:18:55] Signum: has joined #RubyOnRails
[22:18:55] Signum: has joined #RubyOnRails
[22:19:11] simplyianm: has joined #RubyOnRails
[22:20:44] l0oky: Is anyone on?
[22:21:00] Radar: l0oky: yes
[22:21:22] l0oky: few hours ago this room was quiet
[22:21:36] Radar: probably due to the overlap between US + AU
[22:21:40] l0oky: guess It's just sunday
[22:21:41] Radar: Few hours ago I was asleep :)
[22:21:51] Radar: And yeah, Sundays are really quiet for this channel
[22:24:27] l0oky: How can I do debugging in Ruby with Rails?
[22:25:00] VeryBewitching: http://guides.rubyonrails.org/debugging_rails_applications.html
[22:25:19] VeryBewitching: Have you read that first l0oky?
[22:25:35] l0oky: yes i see the link
[22:25:39] jottr: has joined #RubyOnRails
[22:25:58] Lytol: has joined #RubyOnRails
[22:30:37] l0oky: I am currently on a limited mobile internet connection running on a wifi hotspot haha
[22:31:21] l0oky: Thankfully, atleast IRC works
[22:31:58] cleopatra: has joined #RubyOnRails
[22:36:00] ecksit: has joined #RubyOnRails
[22:39:30] Radar: l0oky: You're going to have to be more specific as to what you want to deubg.
[22:39:32] simplyianm: has joined #RubyOnRails
[22:39:38] tsvenson: has joined #RubyOnRails
[22:40:05] fighella: has joined #RubyOnRails
[22:41:04] lethjakman: has joined #RubyOnRails
[22:42:32] Pupeno: has joined #RubyOnRails
[22:42:32] Pupeno: has joined #RubyOnRails
[22:43:21] chouhoulis: has joined #RubyOnRails
[22:43:39] bronson: has joined #RubyOnRails
[22:44:36] r_baron: has joined #RubyOnRails
[22:44:36] artto: has joined #RubyOnRails
[22:45:47] ellisTAA: i???ve uploaded my rails app to heroku bc i thought actionmailer wasn???t working bc i was in development, but my mailer still isn???t emailing people when they sign up, does anyone have any ideas on why my actionmailer isn???t emailing me?
[22:46:26] zorak8: has joined #RubyOnRails
[22:47:15] simplyianm: has joined #RubyOnRails
[22:47:30] r_baron: has joined #RubyOnRails
[22:47:49] cmhobbs: has left #RubyOnRails: ("Leaving")
[22:47:57] nfk: has joined #RubyOnRails
[22:48:35] jottr: has joined #RubyOnRails
[22:49:18] fryguy: EllisTAA: logs?
[22:49:42] VeryBewitching: EllisTAA: Were you getting emails in development? And how is ActionMailer configured?
[22:50:54] ellisTAA: in the logs all i see is the user being created, i dont see anything about email
[22:50:55] Radar: EllisTAA: how did you configure Rails to send emails?
[22:51:02] ellisTAA: i wasn???t getting emails in development
[22:51:07] Radar: ActionMailer::Base.config?
[22:52:53] Lightsword_: has joined #RubyOnRails
[22:53:03] l0oky: Say that I have 2 models; model1 and model2, model2 belongs_to model1 what does the following line mean `@methodvar = model1.model2.build`
[22:53:10] platzhirsch: has left #RubyOnRails: ()
[22:53:10] ellisTAA: heres what i had in my dev file, i???m going to move it into my productio file now https://gist.github.com/ellismarte/51e2e23a88b8200e9b72
[22:53:59] x-light: good morning radar (a little late, but hey :)
[22:54:08] Radar: l0oky: !fake
[22:54:08] helpa: l0oky: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[22:54:17] Radar: l0oky: !associations
[22:54:17] helpa: l0oky: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[22:54:46] Radar: EllisTAA: If you don't have something like that in config/environments/production.rb already then ActionMailer won't be configured to send anything.
[22:54:57] l0oky: Radar: OK, i'll try to get a real scenario on going just a sec.
[22:55:01] gerep: has joined #RubyOnRails
[22:55:10] Radar: l0oky: look at the associations guide first :)
[22:55:32] Lightsword_: has joined #RubyOnRails
[22:56:30] l0oky: Yeah as soon as my page loads o_O
[22:57:28] arBmind1: has joined #RubyOnRails
[22:57:32] l0oky: I am back to stone age.. It could've been worse, I could be brought back to dinosaur age :D
[22:57:54] shock_one: has joined #RubyOnRails
[22:58:42] s2013: has joined #RubyOnRails
[22:59:39] fighella: has joined #RubyOnRails
[23:00:17] josh2: has joined #RubyOnRails
[23:00:18] l0oky: Radar: https://gist.github.com/l0oky/9fe93fc721ad02a65821 here sorry for using fake values
[23:00:46] VeryBewitching: l0oky: Radar opened my eyes to devdocs.io, helpful resource for offline documentation browsing.
[23:01:33] theery: has joined #RubyOnRails
[23:02:17] VeryBewitching: l0oky: collection.build(attributes = {}, ???) Returns one or more new objects of the collection type that have been instantiated with attributes and linked to this object through a foreign key, but have not yet been saved. Note: This only works if an associated object already exists, not if it???s nil!
[23:03:05] smathy: has joined #RubyOnRails
[23:03:24] erich: has joined #RubyOnRails
[23:03:38] gerep: I have configured my config.time_zone to "Brasilia" which is -03:00. I save like this: @user.invitation_sent_at = Time.now I want to display the created_at column but it always shows as "2015-07-11 21:00:00 -0300" The hour is always 21:00:00, what am I missing?
[23:04:17] VeryBewitching: gerep: created_at.localtime.strftime(format)
[23:04:54] l0oky: VeryBewitching: Thanks for the devdocs.io heads up, now to figure out what does that mean hehe( collection.build )
[23:05:25] l0oky: sry wanted to type /clear command
[23:06:36] JeramyRR: has joined #RubyOnRails
[23:06:42] l0oky: brb IRSSI bugged
[23:07:02] gerep: VeryBewitching, created_at.localtime.strftime("%d/%m%Y %H:%M") = 11/072015 21:00 I just created this record and now it should display: 20:05
[23:07:10] gerep: As the hour, the date is correct
[23:07:13] l0oky: has joined #RubyOnRails
[23:07:54] VeryBewitching: gerep: Which database are you using?
[23:08:02] gerep: VeryBewitching, PostgreSQL
[23:08:59] Radar: gerep: Times are saved to the database in UTC.
[23:09:17] Radar: gerep: Change this behaviour with a before_filter that sets Time.zone to your local timezone for each request.
[23:10:00] shyshy: has joined #RubyOnRails
[23:10:08] nfk: has joined #RubyOnRails
[23:10:24] gerep: Radar, but the config.time_zone = 'Brasilia' isn't enough?
[23:10:58] Radar: gerep: ArgumentError: Invalid Timezone: Brasilla
[23:12:38] gerep: Radar, VeryBewitching https://gist.github.com/anonymous/9db59897528f76f105ed
[23:12:54] gerep: Radar, I have Brasilia listed with rake -D time
[23:13:08] gerep: actually with rake time:zones:all
[23:13:17] Radar: Sorry, I read what timezone you had as Brasillia
[23:13:42] gerep: no no :) Just one
[23:13:49] Radar: I think config.time_zone changes ActiveRecord's time store as well
[23:13:53] Radar: ACTION confirms
[23:14:00] VeryBewitching: Radar: it does.
[23:14:11] VeryBewitching: It shouldn't be set away from the default, UTC, imo
[23:14:30] mary5030: has joined #RubyOnRails
[23:14:35] ellisTAA: would anyone w/ free time mind taking a look @ my app, my users controller create method should be sending new users an email using actionmailer and sidekiq but for some reason i???m not getting an email https://github.com/ellismarte/dbc-overflow
[23:14:51] Radar: Doesn't look like it does actually change ActiveRecord's time zone
[23:14:53] Radar: AR still stores in UTC
[23:15:05] Radar: I'm seeing correct settings in my app with config.time_zone or a Time.zone before_action.
[23:15:06] wwalker: has joined #RubyOnRails
[23:15:14] gerep: Radar, that's what I was going to ask because it is still saving as UTC on PostgreSQL
[23:15:14] Radar: gerep: steps to reproduce the problem in a new app please
[23:15:25] gerep: Radar, ok
[23:16:15] wwalker: if I define a route as: get :controller/:action/:id and go to /dashboard/home/1234 , shouldn't home_dashboard_path() be an existent method?
[23:18:03] owenjones: has joined #RubyOnRails
[23:18:19] VeryBewitching: wwalker: What does rake routes say?
[23:19:21] gerep: Radar, It is really simple, I have added some columns to my database and in my controller I have an action called "activate" which will be called via GET and update the attribute invitation_sent_at like this: @user.invitation_sent_at = Time.now; @user.save; This is the migration: https://gist.github.com/anonymous/27f1be5f048a1fa4bc38
[23:19:33] Radar: wwalker: no, Rails doesn't automatically define routes like that.
[23:19:39] newguy: has joined #RubyOnRails
[23:19:41] prereflect: has joined #RubyOnRails
[23:19:42] Radar: gerep: Time.now or Time.current?
[23:20:19] Radar: gerep: provide us with an app which reproduces this issue
[23:20:21] cleopatra: has joined #RubyOnRails
[23:20:43] jesterfraud: has joined #RubyOnRails
[23:21:07] dc1: has joined #RubyOnRails
[23:21:50] george2: has joined #RubyOnRails
[23:22:13] wwalker: VeryBewitching: interesting... There are no dashbaord routes (but the routes do match and go where they should). But there are apprently no dashboard_<action>_path or <action>_dashboard_path helper methods
[23:22:15] allcentury: has joined #RubyOnRails
[23:23:04] Scripore: has joined #RubyOnRails
[23:23:21] Axy: has joined #RubyOnRails
[23:23:22] wwalker: I had been creating each route as : get 'dashboard/home' and it was both routing and creating dashboard_home_path()
[23:24:02] wwalker: I got lazy and wanted to not have to create a line for every new action in routes. That worked for creating routes, just not the helper methods.
[23:24:33] ne09: has joined #RubyOnRails
[23:25:34] Lightsword: has joined #RubyOnRails
[23:26:45] gerep: Radar, both options work the same way, I'll create the app and share the link
[23:26:55] Radar: gerep: thanks :)
[23:27:11] dps: has joined #RubyOnRails
[23:27:57] baweaver: has joined #RubyOnRails
[23:28:09] badeball: has joined #RubyOnRails
[23:28:26] confact: has joined #RubyOnRails
[23:28:54] AntiSpamMeta: has joined #RubyOnRails
[23:29:16] VeryBewitching: wwalker: I believe you can name them as you wish using as:
[23:29:18] jdayvie: has joined #RubyOnRails
[23:29:43] VeryBewitching: wwalker: get '/my/route/:id', as: 'my_route'
[23:29:50] alexblom: has joined #RubyOnRails
[23:29:56] VeryBewitching: You should have my_route_path
[23:30:00] microdex: has joined #RubyOnRails
[23:30:16] VeryBewitching: Just stepping out to grab something at the store, brb
[23:30:19] TDJACR: has joined #RubyOnRails
[23:31:40] eklo: has joined #RubyOnRails
[23:32:34] AntiSpamMeta: has joined #RubyOnRails
[23:32:45] Radar: +1 VeryBewitching
[23:32:56] Radar: It's better to hand-generate the routes than to have a `get` route that matches all actions in your controller
[23:33:33] Radar: for instance, you don't want a GET route for `:controller/destroy` because someone could do <img src='http://yoursite.com/very_important_resource/1/destroy' /> and blammo it's gone
[23:33:57] theery: has joined #RubyOnRails
[23:34:03] eklo: hello all, i was given a rails web app and told to find the bug and fix it without anything else, is this possible with zero context
[23:34:46] Radar: eklo: can't tell if trolling or serious
[23:34:52] Radar: eklo: Does it have tests?
[23:35:03] eklo: serious, want to know if im wasting my time or not
[23:35:18] Radar: eklo: You're looking for a black cat in a room with no light and the cat may or may not exist in the first place.
[23:35:43] Guest25091: has joined #RubyOnRails
[23:35:55] Axsuul: has joined #RubyOnRails
[23:36:08] Takumo: has joined #RubyOnRails
[23:36:08] Takumo: has joined #RubyOnRails
[23:36:31] kaspergrubbe: has joined #RubyOnRails
[23:37:02] AntiSpamMeta: has joined #RubyOnRails
[23:37:16] uranther: has joined #RubyOnRails
[23:38:12] vircung|afk: has joined #RubyOnRails
[23:38:14] shyshy: has joined #RubyOnRails
[23:38:17] fumduq: has joined #RubyOnRails
[23:39:36] jesterfraud: I made a middleware class in this app, but randomly when I modify files, it causes the following error: ArgumentError (A copy of <middleware> has been removed from the module tree but is still active!)
[23:39:44] jesterfraud: I have it in app/middleware
[23:39:57] jesterfraud: should I shift it elsewhere, or add it to some kind of autoload path, or?
[23:40:04] jesterfraud: (I'm not modifying that file itself any more)
[23:41:03] Axsuul: In one of my methods, an attribute is updated multiple times. How can I test this in rspec to see that the attribute has been updated multiple times?
[23:41:50] lethjakman: has joined #RubyOnRails
[23:42:20] Radar: jesterfraud: How are you requiring that dependency?
[23:42:24] Radar: that file*
[23:42:54] jesterfraud: application.rb: config.middleware.use 'middleware_name_as_string'
[23:43:03] AntiSpamMeta: has joined #RubyOnRails
[23:43:38] Radar: Strange. It should be handled by the autoloading stuff in Rails just fine.
[23:43:41] Radar: Can you reproduce it in a new app?
[23:44:40] jesterfraud: I think it would be frowned upon me taking that kind of time
[23:44:55] jesterfraud: just making sure I'm not doing something _obviously_ wrong
[23:44:55] Radar: Seems to be a little thing
[23:45:10] Radar: Distilling it down to a reproducible example would help in debugging the problem
[23:45:17] moeabdol: has joined #RubyOnRails
[23:45:18] artto: has joined #RubyOnRails
[23:45:23] clamstar: has joined #RubyOnRails
[23:45:36] jesterfraud: but it's not something holding up release, because it wouldn't happen in production
[23:45:52] jdayvie: has joined #RubyOnRails
[23:46:42] AntiSpamMeta: has joined #RubyOnRails
[23:46:43] Radar: The error typically happens when the middleware file isn't being required again and re-defining the constnat.
[23:46:49] Radar: It's Rails autoloading which is breaking this
[23:47:03] Radar: I don't know how exactly, which is why I am asking if you can reproduce the issue in a new app
[23:47:48] carpeliam: has joined #RubyOnRails
[23:48:38] wethu: has joined #RubyOnRails
[23:48:44] wethu: has joined #RubyOnRails
[23:50:22] jesterfraud: alright Radar, when I get a chance, I will
[23:50:56] Aeyrix: You breaking shit again, jesterfraud?
[23:51:11] jesterfraud: move fast and break things
[23:51:17] jesterfraud: never said anything about fixing them
[23:51:19] zedbourbaki: has joined #RubyOnRails
[23:52:06] erich: has joined #RubyOnRails
[23:52:40] Aeyrix: https://xkcd.com/1428/
[23:53:05] quazimodo: has joined #RubyOnRails
[23:53:08] quazimod1: has joined #RubyOnRails
[23:54:35] theery: has joined #RubyOnRails
[23:55:03] jesterfraud: always a relevant
[23:56:45] carpeliam: has left #RubyOnRails: ()
[23:56:51] ellisTAA: has joined #RubyOnRails
[23:57:47] JeramyRR: has joined #RubyOnRails
[23:59:12] dclo: has joined #RubyOnRails
[23:59:33] nicken: has joined #RubyOnRails