« Back to channel list

#RubyOnRails - 12 July 2016

« Back 1 day Forward 1 day »
[00:00:01] Darmani: Radar: Do I have to change the way I setup my db though? Cause I have it set as User has_one :order
[00:00:57] Rodya_: has joined #RubyOnRails
[00:07:22] Radar: Darmani: That should has_many
[00:08:07] Darmani: Radar: roger that.
[00:14:26] Oliphaunte: has joined #RubyOnRails
[00:15:48] flashpoint9: has joined #RubyOnRails
[00:19:13] pur3eval: has joined #RubyOnRails
[00:22:46] bbrowning: has joined #RubyOnRails
[00:26:35] triangles: has left #RubyOnRails: ("Leaving")
[00:27:47] djbkd: has joined #RubyOnRails
[00:29:51] Ropeney: has joined #RubyOnRails
[00:32:10] whathappens: has joined #RubyOnRails
[00:32:48] whathappens: has joined #RubyOnRails
[00:32:57] jeromelanteri: someone allready had problem with catch ajax success event ? i do remote: true on a link_to and then try to catch ajax:success trriger from asset/javascript/article.coffee
[00:33:53] jeromelanteri: failed to handle this event, but event occur (i can see it in firebug: GET http://localhost:3000/articles/9/edit 200 OK 336ms
[00:34:00] Velizar: has joined #RubyOnRails
[00:34:15] jeromelanteri: only ajax:complete catch the event... but why ?
[00:34:41] superlou: has joined #RubyOnRails
[00:36:14] weaksauce: has joined #RubyOnRails
[00:36:14] jeromelanteri: also, if i put this code inside edit.coffee then yes, it works... but the idea is to let rails use a _form html page (not print it in the view), then catch the ajax:success, then do job between the show view and the form for put input from form in place of datas in show view.
[00:36:21] jstransky: has joined #RubyOnRails
[00:36:26] jeromelanteri: Radar... no idea ?
[00:40:30] quazimodo: has joined #RubyOnRails
[00:41:17] flashpoint9: has joined #RubyOnRails
[00:41:33] roamingdog: has joined #RubyOnRails
[00:41:34] flashpoint9: has joined #RubyOnRails
[00:42:45] roamingdog: has joined #RubyOnRails
[00:45:54] flashpoint9: has joined #RubyOnRails
[00:46:15] flashpoint9: has joined #RubyOnRails
[00:47:30] ekinmur: has joined #RubyOnRails
[00:49:08] whathappens: has joined #RubyOnRails
[00:54:21] Guest76251: has joined #RubyOnRails
[00:54:35] dminuoso: has joined #RubyOnRails
[00:55:05] AndrewIsHere: has joined #RubyOnRails
[01:00:03] macsteps: has joined #RubyOnRails
[01:00:19] blackmesa: has joined #RubyOnRails
[01:02:52] edwinvdg_: has joined #RubyOnRails
[01:08:26] sevenseacat: has joined #RubyOnRails
[01:09:02] Ropeney: has joined #RubyOnRails
[01:12:08] crystal77: has joined #RubyOnRails
[01:13:27] flashpoint9: has joined #RubyOnRails
[01:14:04] flashpoi_: has joined #RubyOnRails
[01:19:24] macsteps: has joined #RubyOnRails
[01:21:18] zacts: has joined #RubyOnRails
[01:21:46] stardiviner: has joined #RubyOnRails
[01:21:48] pawnbox: has joined #RubyOnRails
[01:32:23] Ebok: has joined #RubyOnRails
[01:40:23] Cozzie: has joined #RubyOnRails
[01:42:23] Guest76251: has joined #RubyOnRails
[01:42:28] p8m: has joined #RubyOnRails
[01:46:59] mr-spoon: has joined #RubyOnRails
[01:53:01] Oliphaunte: has joined #RubyOnRails
[01:54:58] kevr: has joined #RubyOnRails
[01:55:21] dminuoso: has joined #RubyOnRails
[01:56:29] upsell5: has joined #RubyOnRails
[01:59:45] Dudlac: has joined #RubyOnRails
[01:59:58] Dudlac: guys whats up?
[02:02:15] roamingdog: has joined #RubyOnRails
[02:02:32] blackmesa: has joined #RubyOnRails
[02:02:47] jheathco: has joined #RubyOnRails
[02:09:43] pawnbox: has joined #RubyOnRails
[02:10:09] mr-spoon: has joined #RubyOnRails
[02:11:59] kevr: has joined #RubyOnRails
[02:12:41] lxsameer: has joined #RubyOnRails
[02:13:06] Radar: Nintendo's stock price
[02:16:20] Guest: has joined #RubyOnRails
[02:20:11] flashpoint9: has joined #RubyOnRails
[02:22:47] ElFerna: has joined #RubyOnRails
[02:22:55] phredus_: has joined #RubyOnRails
[02:24:44] jlyndon_: has joined #RubyOnRails
[02:25:00] jahbrewski: has joined #RubyOnRails
[02:26:01] SteenJobs: has joined #RubyOnRails
[02:26:29] benlieb: has joined #RubyOnRails
[02:32:41] eljimmy: has joined #RubyOnRails
[02:32:52] pvertenten: has joined #RubyOnRails
[02:34:28] travisxcode: has joined #RubyOnRails
[02:40:45] Axsuul: has joined #RubyOnRails
[02:41:12] kanev: has joined #RubyOnRails
[02:41:20] kanev: rails is awesome
[02:42:29] Guest76251: has joined #RubyOnRails
[02:47:25] Monolithe: has joined #RubyOnRails
[02:47:32] sevenseacat: fun times in #rubyonrails
[02:47:53] jhass: has joined #RubyOnRails
[02:48:33] crystal77: has joined #RubyOnRails
[02:49:15] sumobob: has joined #RubyOnRails
[02:50:30] jenrzzz: has joined #RubyOnRails
[02:56:07] dminuoso: has joined #RubyOnRails
[02:56:19] zacts: has joined #RubyOnRails
[02:57:07] eserror: has joined #RubyOnRails
[02:58:30] Ebok: has joined #RubyOnRails
[03:00:02] AmiMoench: has joined #RubyOnRails
[03:02:40] zacts: has joined #RubyOnRails
[03:03:25] kevr: So, I'm trying to implement some fulltext searches in two of my models. One is an Ingredient model, which has a name. the other is a Recipe model, which has many ingredients. I'd like to fulltext search recipes with a list of ingredients and return recipes that have at least the list provided in their ingredients collection
[03:03:47] kevr: I've done it without fulltext searching, but i haven't been able to find fulltext implementations of this
[03:03:54] kevr: maybe i'm just looking with the wrong criteria on google
[03:04:15] Coldblackice: has joined #RubyOnRails
[03:05:35] blackmesa: has joined #RubyOnRails
[03:07:41] pawnbox: has joined #RubyOnRails
[03:18:26] Oliphaunte: has joined #RubyOnRails
[03:18:43] treaki_: has joined #RubyOnRails
[03:21:47] flashpoint9: has joined #RubyOnRails
[03:21:52] fryguy: kevr: you'll want to use an external full text indexing database, like solr or elasticsearch
[03:23:56] pontiki: has joined #RubyOnRails
[03:24:08] Dimik--: has joined #RubyOnRails
[03:24:34] Dimik--: how can i pass a variable from cli .rb script to .erb views
[03:28:09] dezull: has joined #RubyOnRails
[03:30:23] kevr: has joined #RubyOnRails
[03:30:52] Spami: has joined #RubyOnRails
[03:31:54] Spami: has joined #RubyOnRails
[03:31:54] jenrzzz: has joined #RubyOnRails
[03:39:24] travisxcode: has joined #RubyOnRails
[03:41:34] crystal77: has joined #RubyOnRails
[03:44:28] Spami: has joined #RubyOnRails
[03:45:20] agent_white: has joined #RubyOnRails
[03:45:52] pur3eval: has joined #RubyOnRails
[03:48:50] jeromelanteri: Dimik--, declare it as global variable (from controller): @my_var = "hello", then ask on view: <%= @my_var %> or <%= "text with #{@my_var} inside" %>, or if not from controller, need to use a function member declared on helper class of object, then use it with arguments passed through this method helper created.
[03:49:19] pontiki: instance vars are not global vars
[03:49:24] jeromelanteri: if you need this for many objects, you can go by applicatio helper method
[03:49:49] jeromelanteri: pontiki, yes... i think i do wrong explication. Just do correct the sentence should help.
[03:50:03] pontiki: s/global/instance/
[03:50:37] jeromelanteri: pontiki, do you know how to use parseHTML DOMnodes in jquery ?
[03:50:40] pontiki: Dimik--: i'm a bit unclear about your use of the term "cli", however
[03:50:45] pontiki: command line interface?
[03:50:46] jeromelanteri: i'm locked with this
[03:51:22] pontiki: i might, jeromelanteri, but i don't recognize those terms specifically
[03:54:31] jeromelanteri: pontiki, i do use it from a form partial file (html content text) then: form = $.parseHTML(xhr.responseText) from these form html text (call back from ajax:complete)... now i would like to take designed id input content (like: var target = form.??? ; $("#view_id").html(target);)
[03:55:00] jeromelanteri: but how to have this targeted element from DOMnodes "target" ?
[03:56:52] dminuoso: has joined #RubyOnRails
[03:57:03] pontiki: i can't even parse what you're asking
[03:58:46] jeromelanteri: i'm asking how to use DOmnodes from parseHTML return. does this make sens ?
[03:59:17] pontiki: you search them, sort them, replace them with other DOM nodes, etc
[03:59:37] pontiki: if you don't know what to do with them, why did you think you should use them?
[03:59:41] pontiki: i'm just confused
[04:00:14] pontiki: http://api.jquery.com/category/manipulation/
[04:00:30] pontiki: that talks about all the methods for DOM manipulation in jQuery
[04:01:37] jeromelanteri: when i do form.get('#target"')... it tell me that get is note a function for form. form = $.parseHTML(xhr.responseText)
[04:02:47] jeromelanteri: so... return from parseHTML function can not be manipulate from these functions. If you know, please, just tell me or show me an example about how to use return object from $.parseHTML(text_html) ?
[04:04:32] pontiki: i can't even follow you
[04:04:40] jeromelanteri: pontiki, also, i think i should use them because rails has no plan for put input form helpers element in place of datas on show view... instead, rails CoC force dev to call a full partial view. So if i just want to be free to replace datas from show view by input element and then submit edited datas... i can not with usual rails methods form.
[04:05:13] pontiki: just write a spa and use rails as an api only
[04:05:44] jeromelanteri: i can not undestand "spa"
[04:05:46] pontiki: single page app
[04:05:50] pontiki: in javascript
[04:05:57] Radar: ACTION checks logs; sees that pontiki isn't talking to the air
[04:06:16] pontiki: i'm so confused right now
[04:06:33] jeromelanteri: i'm confuse to.
[04:06:38] pawnbox: has joined #RubyOnRails
[04:06:42] pontiki: look, jeromelanteri, rails cannot do everything everyone wants it to
[04:06:54] pontiki: stop trashing it and flailing yourself
[04:08:07] SteenJobs: has joined #RubyOnRails
[04:08:08] jeromelanteri: yesterday, i was asking for a solution for do that, someone help me here and tell me to go by this way: do a form partial view, then remote: true on and do use jquery event listner to catch ajax:success and then, do replace input form helper on the current show view for do that.
[04:08:31] pontiki: great. find them and ask them again.
[04:08:37] blackmesa: has joined #RubyOnRails
[04:08:40] jeromelanteri: pontiki, flailing ? what is this word signification ?
[04:08:55] pontiki: use a dictionary
[04:09:00] pontiki: i'm tired of this
[04:09:31] jeromelanteri: ho my God... it's kind of judgment... thank you, this help me a lot. lol
[04:10:02] pontiki: very much a judgement
[04:10:57] jeromelanteri: serve nothing... if you don't know, or you don't like someone, just ignore me as i will now ignore you. bye
[04:11:10] sevenseacat: ACTION waves bye
[04:11:50] jeromelanteri: pwnd_nsfw`, is it a question ?
[04:12:01] helpa: http://i.imgur.com/tyViD.gif
[04:12:24] Radar: jeromelanteri: !rule8
[04:12:24] helpa: jeromelanteri: Treat people in a considerate manner, as they are volunteering their time to help you. If you're helping, do so in a kind and considerate manner; you were a newbie once too. If you're being annoying or rude you may be muted by one of the channel ops.
[04:12:32] Radar: !ban jeromelanteri
[04:12:42] rails45: has joined #RubyOnRails
[04:12:49] Radar: oh yeah that doesn't work in this channel.
[04:12:53] jeromelanteri: Radar, i tried... just this has to be same for every one here or just against me ?
[04:13:23] rails45: Can partials be rendered from js files? I'm trying to do something like -- ('.postindex').after('<%= j render 'masonry' %>);
[04:13:54] jeromelanteri: ok... very good relationship thinking here... you can choose to ignore me instead of search for virtual fight on public chan Radar...
[04:13:55] Radar: Radar kicked jeromelanteri: week ban for being rude
[04:14:55] rails45: or do i need to change it to .js.erb?
[04:15:04] Radar: rails45: yes I think so
[04:15:09] Radar: js is the format, erb is the templating language
[04:16:50] rails45: @Radar So when I have a test.js.erb file inside /javascripts folder from where I'm trying to render the partial, I need to specify the path of the partial too right?
[04:17:11] Radar: rails45: Oh I didn't realise this was in /javascripts. Asset pipeline files cannot render partials.
[04:18:22] matthewd: You probably could in 5.0, using the new render-anywhere thing
[04:18:22] kevr: has joined #RubyOnRails
[04:18:35] matthewd: .. which is not to say you *should* ;)
[04:19:14] pontiki: "render-anywhere" ??? really?
[04:19:49] sevenseacat: what render-anywhere thing?
[04:19:52] matthewd: http://blog.bigbinary.com/2016/01/08/rendering-views-outside-of-controllers-in-rails-5.html
[04:20:58] matthewd: It's for things like rendering inside an actioncable/activejob class, but in theory you would be able to call it from an asset, I guess
[04:22:05] pontiki: yeah, i'm reading it now on the rails blog
[04:24:24] djbkd: has joined #RubyOnRails
[04:24:27] rails45: @matthewd thanks for the link! what's the best way to tackle this now then?
[04:29:51] roamingdog: has joined #RubyOnRails
[04:31:59] brunto: has joined #RubyOnRails
[04:40:56] dminuoso: has joined #RubyOnRails
[04:43:05] srinidhi: has joined #RubyOnRails
[04:44:02] KnownSyntax_: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[04:45:45] greghoggard: has joined #RubyOnRails
[04:46:10] greghogg_: has joined #RubyOnRails
[04:46:49] greghogg_: has joined #RubyOnRails
[04:47:39] pawnbox: has joined #RubyOnRails
[04:51:33] atomx: has joined #RubyOnRails
[04:53:18] greghogg_: I am having a little trouble with my shopping cart on my application. It adds everything to the cart, but if i click to add the same item twice it creates two separate entries in the shopping cart instead of updating the first one. I'm not quite sure how to accomplish this. https://gist.github.com/greghoggard/f1761b26c3fbf9a540de9270db8b0666
[04:55:38] pontiki: greghogg_: what goes into order items?
[04:56:07] greghogg_: what do you mean?
[04:56:23] greghogg_: cards goes into order items
[04:57:13] pontiki: so you could look if a card is already in there, then?
[04:57:37] greghogg_: not quite sure what the best way to make that validation would be
[04:58:03] pontiki: don't use a validation to perform a calculation
[04:58:21] moeabdol: has joined #RubyOnRails
[04:58:34] greghogg_: not sure im following
[04:58:52] edwinvdgraaf: has joined #RubyOnRails
[04:59:29] Radar: greghogg_: Hi. This action: https://gist.github.com/greghoggard/f1761b26c3fbf9a540de9270db8b0666#file-order_items_controller-rb-L2-L7 seems like it could do with a rethink.
[04:59:43] Radar: greghogg_: You're not necessarily ALWAYS creating cart items. You might be adding an item to the cart that is already there.
[05:00:20] Radar: greghogg_: I would suggest renaming that action to add, and it has a dual purpose: 1) it finds an item and if it exists then it adds one to its quantity. 2) if the item doesn't exist from the find, then you should create it exactly as you're doing here.
[05:00:32] Radar: Also: session[:order_id] should only be set once, likely when the order itself is created.
[05:00:46] Radar: https://gist.github.com/greghoggard/f1761b26c3fbf9a540de9270db8b0666#file-application_controller-rb-L8-L14
[05:01:01] Radar: That method should find or create the order. If you're creating the order, then it should set session[:order_id]
[05:01:19] dminuoso: has joined #RubyOnRails
[05:01:50] kevr: has joined #RubyOnRails
[05:02:03] greghogg_: so should i make a method in the vein of "def add_item(card_id)
[05:02:42] Radar: greghogg_: yes, on your Order model.
[05:02:58] greghogg_: not the orderitem model?
[05:03:16] Radar: greghogg_: You'd be adding an item to an order.
[05:03:42] SteenJobs: has joined #RubyOnRails
[05:04:36] travisxcode: has joined #RubyOnRails
[05:05:52] greghogg_: so after i create that method in the order model, would i change the create method in the orderitems controller to add and redefine it completely?
[05:07:38] pur3eval: has joined #RubyOnRails
[05:07:48] tego101: has joined #RubyOnRails
[05:09:36] Radar: greghogg_: yes
[05:11:37] blackmesa: has joined #RubyOnRails
[05:11:57] conta: has joined #RubyOnRails
[05:15:58] akira616: has joined #RubyOnRails
[05:16:40] Rodya_: has joined #RubyOnRails
[05:16:58] akira616: has joined #RubyOnRails
[05:19:16] spyder55: has joined #RubyOnRails
[05:21:38] kevr: has joined #RubyOnRails
[05:26:23] abhvl: has joined #RubyOnRails
[05:26:40] abhvl: whats the correct way to duplicate paperclip objects to new record?
[05:38:48] davidklsn: has joined #RubyOnRails
[05:40:59] tvw: has joined #RubyOnRails
[05:41:35] liquid-silence: has joined #RubyOnRails
[05:41:45] daumie: has joined #RubyOnRails
[05:42:13] liquid-silence: whats the standard to split a rails app into parts, same DB, and multiple sidekiq workers
[05:42:40] liquid-silence: we have around 8 workers currently and horizontal scaling is not the best idea here\
[05:42:56] achamian: has joined #RubyOnRails
[05:44:06] arathald: abhvl: there seems to be lots of information about it readily available: https://www.google.com/search?q=paperclip+duplicating+object&ie=utf-8&oe=utf-8
[05:47:58] dminuoso: has joined #RubyOnRails
[05:49:17] moeabdol: has joined #RubyOnRails
[05:51:54] futilegames: has joined #RubyOnRails
[05:52:15] hastur: has joined #RubyOnRails
[05:55:54] cd-rum: has joined #RubyOnRails
[05:57:32] zacts: has joined #RubyOnRails
[05:58:15] yfeldblum: has joined #RubyOnRails
[05:58:54] pawnbox: has joined #RubyOnRails
[05:59:03] yfeldblum: has joined #RubyOnRails
[06:00:20] xlegoman: has joined #RubyOnRails
[06:01:08] cd-rum_: has joined #RubyOnRails
[06:03:22] naftilos76: has joined #RubyOnRails
[06:08:25] pur3eval: has joined #RubyOnRails
[06:09:10] abhvl: has joined #RubyOnRails
[06:09:54] abhvl: has joined #RubyOnRails
[06:12:33] edwinvdgraaf: has joined #RubyOnRails
[06:12:37] Radar: liquid-silence: !xy
[06:12:37] helpa: liquid-silence: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[06:13:26] blackmesa: has joined #RubyOnRails
[06:15:06] solars: has joined #RubyOnRails
[06:17:03] pur3eval: has joined #RubyOnRails
[06:17:39] liquid-silence: Radar we are hitting performance issues
[06:18:13] liquid-silence: so we have for instance 8 workers that use a lot of CPU and memory, we would like to know if there is a way to run each sidekiq worker on its own machine
[06:18:16] Radar: liquid-silence: and splitting it up is the only answer?
[06:18:38] liquid-silence: well we could scale it horizontally but currently the machines need tons of CPU and Ram
[06:18:58] liquid-silence: and thats not ideal, so instead of scaling just one worker we scale the entire app, which makes it least cost effective
[06:19:03] Radar: liquid-silence: yes it is possible to run a sidekiq on a different machine. All that would be required is to point that Sidekiq instance at the right REDIS_URL / database
[06:19:35] liquid-silence: yeah but that still requires the entire rails stack to be loaded and not just AR + Redis drivers etc..
[06:19:47] liquid-silence: which means the machine will need to be heavy in resources
[06:20:25] Oliphaunte: has joined #RubyOnRails
[06:20:40] sevenseacat: sidekiq always needs to use the entire rails stack, no matter what machine its on
[06:21:02] crystal77: has joined #RubyOnRails
[06:21:12] Dimik--: is there a way to pass a variable from one page to another
[06:22:13] Dimik--: for example a session id
[06:22:34] Macaveli: has joined #RubyOnRails
[06:22:41] rails45: has joined #RubyOnRails
[06:22:54] Dimik--: maybe with a temp cookie or something
[06:23:08] sevenseacat: what are you trying to do and why
[06:23:17] Macaveli: has joined #RubyOnRails
[06:23:18] sevenseacat: because your question doesnt make a lot of sense
[06:23:29] Radar: Dimik--: !xy
[06:23:29] helpa: Dimik--: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[06:23:33] Dimik--: yeah english isn't my first language i'm sorry let me rephrase that
[06:23:41] Radar: liquid-silence: Have you heard of AWS?
[06:23:55] liquid-silence: haha yea we are using AWS
[06:24:01] Macaveli: has joined #RubyOnRails
[06:24:37] Radar: Sooooo you want to run a sidekiq worker. On a separate machine. To run jobs for your Rails app. But you don't want to load the entire Rails stack?
[06:24:48] dminuoso: has joined #RubyOnRails
[06:24:50] Dimik--: i want to assign each visitor a certain new session id each time they visit, and i want that session id to be passed on from page to page
[06:24:51] tvw: has joined #RubyOnRails
[06:24:58] Dimik--: does that make sense?
[06:25:38] rails45: @Radar About the thing I asked earlier; I'm trying a different approach. Can you call a .js file from a .js.erb file locating in the views folder?
[06:25:41] Radar: Dimik--: session[:user_id] = SecureRandom.hex(32)
[06:25:42] helpa: Next question, please!
[06:25:43] rails45: @Radar I tried $.getScript("test.js"), where test.js is a file in /javascripts, but it's not working
[06:25:53] Radar: rails45: I don't know, sorry.
[06:27:03] Radar: Dimik--: !xyt
[06:27:04] Radar: Dimik--: !xy
[06:27:04] helpa: Dimik--: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[06:27:09] Radar: Dimik--: Please read that and ask your question again.
[06:27:11] liquid-silence: in essence yes,
[06:27:12] Radar: liquid-silence
[06:27:14] Macaveli_: has joined #RubyOnRails
[06:27:23] liquid-silence: unless we move to EB, I dont think we will get decent scalling
[06:27:52] Radar: liquid-silence: it is an unreasonable requirement. You cannot run the Sidekiq worker which runs jobs which touch your Rails app's models without loading the Rails stack OR without a lot of madness-inducing configuration
[06:28:05] conta: has joined #RubyOnRails
[06:28:19] Radar: liquid-silence: I would recommend moving the Sidekiq workers out to their own box which DOES load the entire Rails stack. That will at least mean that your main app box won't be under load from the Sidekiq workers.
[06:28:31] liquid-silence: so just a worker box?
[06:28:52] futilegames: has joined #RubyOnRails
[06:30:28] rvanlieshout: has joined #RubyOnRails
[06:31:18] arBmind: has joined #RubyOnRails
[06:31:27] jishankai: has joined #RubyOnRails
[06:33:21] Radar: liquid-silence: I assume you've investigated how to make these jobs as fast as possible already, yeah?
[06:34:26] dminuoso: rails45: Don't use js.erb - let's consider this the end of whatever you trying to do.
[06:34:31] dminuoso: Use unobstrusive JavaScript.
[06:35:25] mark_66: has joined #RubyOnRails
[06:36:15] DevMagpie: has joined #RubyOnRails
[06:36:25] jeyraof: has joined #RubyOnRails
[06:36:44] jeyraof: /join #python
[06:36:52] moeabdol: has joined #RubyOnRails
[06:37:05] pontiki: run, jeyraof
[06:37:09] abhvl: right. use ruby.
[06:39:00] jstransky: has joined #RubyOnRails
[06:39:10] qejk: has joined #RubyOnRails
[06:39:14] aganov: has joined #RubyOnRails
[06:40:34] zacts: has joined #RubyOnRails
[06:40:54] jeyraof: i'm in trouble with preload: when i preload scope specific association, it spend time so much.
[06:41:08] jeyraof: what can i check for this?
[06:41:27] dminuoso: jeyraof: The log?
[06:42:04] jeyraof: I think SQL queries are correct.
[06:42:40] dionysus69: has joined #RubyOnRails
[06:43:12] jeyraof: I try to send queries in native client like sequel pro, it works well
[06:43:21] deecross: has joined #RubyOnRails
[06:43:35] dminuoso: jeyraof: What is your question? Gist your logs please.
[06:43:53] the_drow: has joined #RubyOnRails
[06:43:59] jeyraof: ok give me a seconds
[06:44:21] dminuoso: Note I will be leaving the train in a minute, but Im sure chuck norris wlil be happy to work with you.
[06:44:48] liquid-silence: Radar, I would like to scale each worker on its own
[06:45:09] liquid-silence: the issue is its super long running processes, imagemagick etc...
[06:45:40] travisxcode: has joined #RubyOnRails
[06:47:37] jeyraof: https://gist.github.com/jeyraof/ed2220f8f9108e021dc6a94f1b4a0e2c
[06:47:45] Radar: liquid-silence: You could run multiple worker boxes and have a limited number of those workers per bog.
[06:48:05] liquid-silence: yeah but now we need to scale the entire worker stack
[06:48:09] liquid-silence: and not just one worker
[06:48:19] jeyraof: '== debug ==' text was printed after preload items with 3 sec terms
[06:48:36] liquid-silence: for instance, one of the workers we have is a resource hog, so why can't we just scale that worker out over 3 machines
[06:48:46] jeyraof: But that query operate during just 27.3ms
[06:49:12] jeyraof: what is 3 sec between `debug` text and sql log?
[06:50:18] Radar: what is this function trying to do
[06:50:22] Radar: why are you not using includes?
[06:51:02] jeyraof: that is (my purpose but not yet) preload + includes function interface
[06:51:31] jeyraof: but when i use incudes
[06:51:50] jeyraof: includes, also takes 3 seconds
[06:52:29] pontiki: stupid question: is the database warmed up?
[06:53:17] jeyraof: yes. and Funny thing is that it happened with puma.
[06:53:29] jeyraof: when i use webrick, not happened.
[06:53:44] pontiki: might not be warmed up then
[06:54:28] quazimodo: has joined #RubyOnRails
[06:54:36] jeyraof: What is 'warm up' you meant?
[06:54:58] Spami: has joined #RubyOnRails
[06:55:12] pontiki: the connection to the dbsm takes a bit to get warmed up, once it's running it's a lot faster
[06:55:18] deecross: has joined #RubyOnRails
[06:55:23] pontiki: new connection is "cold"
[06:55:54] pontiki: webrick is using the same connection over and over since it's a single thread in a single process
[06:56:22] jeyraof: But my application take a connection with database at the same time running self.
[06:56:46] Ayey_: has joined #RubyOnRails
[06:56:59] raunicolae: has joined #RubyOnRails
[06:57:22] pontiki: the application sits atop the web server; sitting atop webrick it's only got to warm up once
[06:57:34] Spami: has joined #RubyOnRails
[06:57:51] pontiki: sitting atop puma, it could need to warm up each time a thread is launched, which might happen on each request
[06:57:53] kevr: has joined #RubyOnRails
[06:57:56] exadeci: has joined #RubyOnRails
[06:58:17] jeyraof: ah.. i got it. I will check this
[06:58:20] pontiki: i know that happens with unicorn workers, anyway
[06:58:30] jeyraof: pontiki, thank you
[06:58:35] pontiki: just do several tests in the same thread and see if it drops
[06:58:58] pontiki: i could very well be talking bullshit, too
[06:59:23] pontiki: it's what i see when i look at such things
[07:00:15] pontiki: then again, again, i have no idea how you're making these measurements either
[07:01:40] blackmesa: has joined #RubyOnRails
[07:02:24] dblessing: has joined #RubyOnRails
[07:02:29] Pazician: has joined #RubyOnRails
[07:05:22] qejk: has joined #RubyOnRails
[07:05:44] GoranPavlovic: has joined #RubyOnRails
[07:07:12] Palsson: has joined #RubyOnRails
[07:08:50] artto: has joined #RubyOnRails
[07:09:06] linnal: has joined #RubyOnRails
[07:10:40] jenrzzz: has joined #RubyOnRails
[07:12:44] darutoko: has joined #RubyOnRails
[07:13:40] antgel: has joined #RubyOnRails
[07:14:01] fraktalize: has joined #RubyOnRails
[07:14:35] Oliphaunte: has joined #RubyOnRails
[07:14:38] davidklsn: has joined #RubyOnRails
[07:15:15] brianpWins_: has joined #RubyOnRails
[07:15:50] blackmesa: has joined #RubyOnRails
[07:20:44] deecross: has joined #RubyOnRails
[07:23:40] dminuoso: has joined #RubyOnRails
[07:23:44] deecross: has joined #RubyOnRails
[07:24:01] kevr: has joined #RubyOnRails
[07:24:07] flashpoint9: has joined #RubyOnRails
[07:24:09] feignt: has joined #RubyOnRails
[07:25:44] hahuang62: has joined #RubyOnRails
[07:25:51] max3: has joined #RubyOnRails
[07:28:43] ur5us: has joined #RubyOnRails
[07:29:49] dminuoso: has joined #RubyOnRails
[07:30:37] pwnd_nsfw: has joined #RubyOnRails
[07:32:14] pawnbox: has joined #RubyOnRails
[07:32:16] achamian_: has joined #RubyOnRails
[07:32:25] Kedare: has joined #RubyOnRails
[07:33:13] moeabdol: has joined #RubyOnRails
[07:36:32] dionysus69: has joined #RubyOnRails
[07:42:44] edwinvdgraaf: has joined #RubyOnRails
[07:43:02] crova: has joined #RubyOnRails
[07:44:43] crova: greetings ! I'm trying to set the amount of days within the current month, but i'm always getting 30 days from my code, if anyone could share some thoughts?! https://gist.github.com/crova/a496376c979ca422e7791cc1cd82b4b0
[07:45:12] sevenseacat: crova: your code is month == (4 || 6 || 9 || 11)
[07:45:15] pawnbox: has joined #RubyOnRails
[07:45:16] sevenseacat: which I don't think is what you want
[07:45:47] edwinvdg_: has joined #RubyOnRails
[07:46:05] Hyuk: has joined #RubyOnRails
[07:46:21] crova: what I wanted was to set the current month (month = Time.current.month) and run the if / elsif / else statement
[07:46:51] sevenseacat: because (4||6||9||11) will always be true
[07:47:12] sevenseacat: or it might even be if (month == 4) || 6 || 9 || 11
[07:47:15] sevenseacat: which is also always true
[07:48:09] crova: isn't || the same as or?
[07:48:55] sevenseacat: well, with different precedence, but same idea
[07:49:01] travisxcode: has joined #RubyOnRails
[07:49:20] dminuoso: crova: Generally use || for expressions and or for control flow.
[07:49:36] crova: I feel dumb, because I don't get it. We're in July, so month = 7. month == 4 or 6 or 9 or 11 is not true I was guessing?!
[07:50:04] edwinvdgraaf: has joined #RubyOnRails
[07:50:15] sevenseacat: if (month == 4) || 6 || 9 || 11
[07:50:26] deecross: has joined #RubyOnRails
[07:50:26] dminuoso: crova: Boolean operators don't work the way you think they do.
[07:50:31] sevenseacat: 6, 9 and 11 are truthy values, so it will always be true.
[07:50:47] rocketsurgeon: has joined #RubyOnRails
[07:51:24] dminuoso: crova: The only operator in Ruby that allows for something like what you are doing, is the so called flip-flop operator - and I bet good money there is only 3 people in this channel who even know that it exists in Ruby.
[07:51:41] dminuoso: Use a case statement.
[07:51:59] crova: should I make the comparison one by one?
[07:52:15] dminuoso: crova: Use a case statement.
[07:52:16] crova: ok, I'll try with case
[07:52:26] dminuoso: Or compare with each, yeah.
[07:52:26] sevenseacat: or do something like if [4,6,9,11].includes? monmth
[07:52:55] dminuoso: ^- which is the elegant ruby way of comparing with each. :)
[07:55:18] crova: yeah +1 on the suggestion sevenseacat
[07:55:41] crova: it works nicely
[07:55:47] crova: thank you also dminuoso
[07:59:26] artto: has joined #RubyOnRails
[08:02:40] roshanavand: has joined #RubyOnRails
[08:03:30] artto: has joined #RubyOnRails
[08:04:14] Rodya_: has joined #RubyOnRails
[08:05:45] tvw: has joined #RubyOnRails
[08:06:21] Rodya_: has joined #RubyOnRails
[08:08:24] Macaveli: has joined #RubyOnRails
[08:10:45] ngw: has joined #RubyOnRails
[08:12:44] atomx: has joined #RubyOnRails
[08:15:20] artto: has joined #RubyOnRails
[08:15:22] futilegames: has joined #RubyOnRails
[08:15:54] der-landgraf: has joined #RubyOnRails
[08:16:20] Smol: has joined #RubyOnRails
[08:18:33] AmiMoench: has joined #RubyOnRails
[08:22:18] zacts: has joined #RubyOnRails
[08:24:56] snowy: has joined #RubyOnRails
[08:27:00] kevr: has joined #RubyOnRails
[08:27:08] vedu: Guys, any thoughts on this: https://www.reddit.com/r/rails/comments/4sfyxy/polymer_vs_bootstrap_vs/
[08:27:12] artto: has joined #RubyOnRails
[08:30:13] AzaToth: has joined #RubyOnRails
[08:30:53] crova: has joined #RubyOnRails
[08:31:39] dminca: has joined #RubyOnRails
[08:32:36] jsrn: has joined #RubyOnRails
[08:33:17] lupine: has joined #RubyOnRails
[08:36:13] futilegames: has left #RubyOnRails: ()
[08:36:31] watersoul: has joined #RubyOnRails
[08:41:14] arBmind: has joined #RubyOnRails
[08:41:28] lexileo: has joined #RubyOnRails
[08:44:53] zworks: has joined #RubyOnRails
[08:45:20] zworks: I am running rails 5.0, in local host it runs with Puma
[08:45:43] zworks: unlike never before i am expereincing a cache issue, my changes are no longer reflecting
[08:45:51] pawnbox: has joined #RubyOnRails
[08:46:00] zworks: what ever change i make i see the old page
[08:46:17] zworks: any idea pls ?
[08:47:18] dminuoso: zworks: What environment are you running in?
[08:47:34] zworks: os x el cpaitan
[08:47:44] der-landgraf: has joined #RubyOnRails
[08:47:53] dminuoso: zworks: I meant what Rails environment.
[08:48:07] zworks: how can i check that pls?
[08:48:14] dminuoso: zworks: How did you start rails?
[08:48:14] zworks: i assume development
[08:48:25] zworks: but is there any way to confirm it?
[08:48:26] alaing: has joined #RubyOnRails
[08:48:28] dminuoso: zworks: What changes did you make, that you feel should be reflected?
[08:48:37] zworks: rails s -p 3001
[08:48:39] dminuoso: zworks: What is the output of your command that you started the server in?
[08:48:41] dminuoso: It should tell you.
[08:49:08] hck89: has joined #RubyOnRails
[08:49:10] zworks: Rails 5.0.0 application starting in development on http://localhost:3001
[08:49:21] zworks: thanks for your time man:)
[08:49:25] dminuoso: Great, so we are in development mode. Now what change did you make, that you feel should be reflected immediately?
[08:49:43] zworks: i changed the view . so far i have one view
[08:49:54] zworks: but it shows an old html in the browser
[08:50:09] dminuoso: zworks: Which browser
[08:50:14] zworks: i even tried to change the routes.rb file, but still no effect
[08:50:27] zworks: checked on chrome and safari
[08:50:55] dminuoso: zworks: Make sure you reload bypassing your cache (Shift + Reload button in safari, Cmd+Shift+R for chrome)
[08:51:17] dminuoso: zworks: If that does not help, please gist your config/application.rb and config/environments/development.rb
[08:51:26] jeyraof: has joined #RubyOnRails
[08:52:44] zworks: https://gist.github.com/anonymous/c9b313abf7aaf8b8f167f0c8cf00a8c8
[08:53:06] dminuoso: zworks: In fact, when working with Webdevelopment, it's a wise thing to always have the developer tools enabled, with "Disable cache" activated. That will always protect you from your Browser doing silly things.
[08:53:08] zworks: https://gist.github.com/anonymous/c7e6460046b9562cdd5dca6acf67ec64
[08:53:21] dminuoso: zworks: You can add multiple files to a single gist, just use the "Add file" button at the bottom :)
[08:53:36] zworks: hehe :) thanks dr!
[08:54:38] dminuoso: zworks: https://gist.github.com/anonymous/c7e6460046b9562cdd5dca6acf67ec64#file-development-rb-L17-L22
[08:54:50] abhvl: zworks: you have to delete index.html and other in your public folder
[08:55:01] blackmesa: has joined #RubyOnRails
[08:55:12] Niandalu: has joined #RubyOnRails
[08:55:13] zworks: other in public folder means?
[08:55:26] sevenseacat: abhvl: no, that doesnt exist
[08:55:48] abhvl: it exists for me when i create a new rails app. there is a public folder with index.html
[08:55:51] dminuoso: zworks: You can use "rails dev:cache" to enable/disable the development cache in Rails 5.
[08:55:54] zworks: ahh sevenseacat, after long time!
[08:55:59] dminuoso: zworks: But please make sure you try the bypassing cache methods I mentioned in the beginning.
[08:56:00] sevenseacat: abhvl: not in rails 5.
[08:56:08] dminuoso: 10:50 < dminuoso> zworks: Make sure you reload bypassing your cache (Shift + Reload button in safari, Cmd+Shift+R for chrome)
[08:56:10] abhvl: ACTION backs away
[08:56:28] zworks: dminuoso: yep, reload bypass didn't work
[08:56:46] dminuoso: zworks: Interesting. What happens if you disable the cache using the command I mentioned before?
[08:56:55] dminuoso: (You can use this in a different shell without restarting the server)
[08:57:35] zworks: ok ok ok !
[08:57:41] zworks: it's my silly mistak :)
[08:57:59] zworks: i put a index.html file in public folder, that's what the browser shows :)
[08:58:04] zworks: thanks guys !!!
[08:58:54] crdpink: has joined #RubyOnRails
[09:01:42] Axsuul: has joined #RubyOnRails
[09:01:59] sevenseacat: well if you *put* one there
[09:02:09] pawnbox: has joined #RubyOnRails
[09:02:29] Oliphaunte: has joined #RubyOnRails
[09:02:31] yfeldblum: has joined #RubyOnRails
[09:03:05] marr: has joined #RubyOnRails
[09:06:48] Niandalu: has joined #RubyOnRails
[09:17:52] abhvl: how can i loop through all associatations?
[09:18:14] dminuoso: Aherin: Model.reflections
[09:20:53] Axsuul: has joined #RubyOnRails
[09:21:22] benlieb: has joined #RubyOnRails
[09:22:29] ur5us: has joined #RubyOnRails
[09:24:00] antgel: has joined #RubyOnRails
[09:24:52] Pumukel: has joined #RubyOnRails
[09:28:50] nettoweb: has joined #RubyOnRails
[09:29:10] armyriad: has joined #RubyOnRails
[09:30:44] GorillaApe: has joined #RubyOnRails
[09:30:59] GorillaApe: how can i determine why rake defaults in test environemt?
[09:31:32] Guest55331: has joined #RubyOnRails
[09:31:48] upsell5: has joined #RubyOnRails
[09:32:32] artto: has joined #RubyOnRails
[09:39:54] vedu: GorillaApe: did you try `echo $RAILS_ENV`
[09:40:27] GorillaApe: i am on openbsdm though
[09:41:11] vedu: hmmm. hard to say
[09:41:28] abhvl: its empty then shouldnt he set it to dev?
[09:47:15] GorillaApe: rails s starts in dev
[09:47:42] GorillaApe: does rake db:reset reset test and dev maybe ?
[09:47:47] GorillaApe: cause it failed at test
[09:48:21] jhass: GorillaApe: rake --trace
[09:50:18] ur5us: has joined #RubyOnRails
[09:54:04] srinidhi: has joined #RubyOnRails
[09:57:45] blackmesa: has joined #RubyOnRails
[09:58:34] dionysus69: hello everyone, I have a polymorphic image model shared between 3 models. I am using paperclip to handle image uploads. I want to use a distinct style on one of the models but I dont want to make futile uploads on all three models just for that one model. is it possible to enable that style only for a certain model ?
[09:58:59] jarred: has joined #RubyOnRails
[10:00:18] jarred: I'm having an issue where Sidekiq is silently failing to enqueue all jobs (in production only). It returns a jobid but the queues are all empty.
[10:00:30] jarred: anyone have thoughts on what the issue could be?
[10:01:36] jhass: wrong redis db connected? redis-namespace in use and different namespaces?
[10:02:41] jarred: not using redis-namespace, using the default redis settings (and the redis instance is running locally on the server)
[10:02:59] jarred: although the server is running multiple rails apps that are using sidekiq
[10:03:28] Circuit8: has joined #RubyOnRails
[10:07:28] workmad3: has joined #RubyOnRails
[10:08:46] jarred: i'll try using redis-namespace
[10:08:55] artto: has joined #RubyOnRails
[10:10:09] artto: has joined #RubyOnRails
[10:10:22] srinidhi: has joined #RubyOnRails
[10:12:17] edwinvdgraaf: has joined #RubyOnRails
[10:12:34] jarred: yep that fixed it
[10:12:45] bauruine: has joined #RubyOnRails
[10:12:46] jarred: your suggestion jhass pointed me in the right direction! thanks
[10:14:31] edwinvdgraaf: has joined #RubyOnRails
[10:19:43] defsdoor: has joined #RubyOnRails
[10:20:11] flashpoint9: has joined #RubyOnRails
[10:20:33] rickmasta: has joined #RubyOnRails
[10:22:21] alfiemax: has joined #RubyOnRails
[10:22:51] Guest76251: has joined #RubyOnRails
[10:23:07] rubyonrails578: has joined #RubyOnRails
[10:24:51] rubyonrails578: i just realized embed is deprecated for active model serializer...but i can seem to find a similar implementation in the later version....that is if you want to side load/include an object's association
[10:24:57] flashpoint9: has joined #RubyOnRails
[10:25:40] flashpoi_: has joined #RubyOnRails
[10:25:52] rubyonrails578: like if i want user with id 1 i also get all user 1's associated products
[10:28:08] vedu: rubyonrails578: has_many /?
[10:31:27] rubyonrails578: has_many :products, belongs_to :user
[10:31:47] artto: has joined #RubyOnRails
[10:32:08] vedu: rubyonrails578: I mean I use has_many: inside your serializer. for has_one/belongs_to just use attributes:
[10:36:54] rocketsurgeon: Hi guys. Question. I'm trying to call an action in my controller, from the view. I have done this by using a "link_to 'Action', action_path"
[10:37:16] rocketsurgeon: but now i want to pass parameters to that action
[10:38:01] solars: has joined #RubyOnRails
[10:39:43] rocketsurgeon: nvm solved it ;p
[10:42:37] bbrowning: has joined #RubyOnRails
[10:49:47] daumie254: has joined #RubyOnRails
[10:54:04] rodfersou: has joined #RubyOnRails
[10:56:34] dionysus69: has joined #RubyOnRails
[10:59:48] alfiemax: has joined #RubyOnRails
[11:00:46] blackmesa: has joined #RubyOnRails
[11:05:18] abhvl: how can i .dup except(columns)
[11:08:26] jsrn: has joined #RubyOnRails
[11:09:50] marahin: Hello. I have a simple_form that is rendered when imports#new is requested, and that form should be sent to imports#create. However, as imports controller is under Admin namespace, I am not really sure how to _point_ simple_form_for(@imports...) to imports#create.
[11:10:17] marahin: As "url: new_admin_imports_path" throws an error (it points to 'new' action of 'imports' controller), I need to do send it to action 'create'
[11:10:51] marahin: What's the good approach? Should I just create a named path for 'create' action (if so, how do I scope resources :imports, so 'create' has it's own named path)?
[11:14:45] tbuehlmann: marahin: try simple_form_for([:admin, @import])
[11:14:52] marahin: tbuehlmann, I just got it working
[11:15:15] marahin: instead of simple_form_for(@import, action: 'create') or simple_form_for(@import, url: new_admin_import_path)
[11:15:17] marahin: it's just:
[11:15:44] marahin: simple_form_for(@import, url: admin_imports_path)
[11:15:47] marahin: and it works like a charm (:
[11:16:39] tbuehlmann: right, or just [:admin, @import] :)
[11:19:31] Ebok: has joined #RubyOnRails
[11:19:36] Ropeney: has joined #RubyOnRails
[11:23:28] abhvl: how to check if model has column mycolumn?
[11:25:55] the_drow: has joined #RubyOnRails
[11:25:57] jhass: why are you uncertain about it?
[11:27:39] abhvl: looping through associations. not all associations has that column. jhass
[11:28:44] jhass: do you need to differentiate between "not there" and "null/nil"?
[11:28:57] abhvl: if its there i have to make it nil
[11:29:52] jhass: oh there's http://devdocs.io/rails~4.2/activerecord/attributemethods#method-i-has_attribute-3F even
[11:30:03] jhass: still smells like a design issue though tbh
[11:30:26] artto: has joined #RubyOnRails
[11:32:04] watersoul_: has joined #RubyOnRails
[11:33:28] abhvl: not available in 3
[11:35:38] jhass: well 3 is EOL now, isn't it?
[11:36:44] abhvl: company policy.
[11:36:59] Niandalu: has joined #RubyOnRails
[11:38:21] dminuoso: abhvl: Then try and make it obvious to your company that you are using a version that a) has only received severey security fixes in the past few years, and b) has completely no support and patches anymore.
[11:38:25] dminuoso: abhvl: http://guides.rubyonrails.org/maintenance_policy.html
[11:38:33] dminuoso: Rails 3 is now officially unsupported.
[11:38:39] abhvl: i need the job. period.
[11:38:45] railsss: has joined #RubyOnRails
[11:38:58] GorillaApe: I have this [a-zA-Z\d\s\-_]+ regexp
[11:39:03] dminuoso: abhvl: That does not invalidate the issue at hand.
[11:39:07] railsss: How to DRY up controller methods that share the same exact code?
[11:39:22] GorillaApe: if there a way to force that it has at least [a-zA-Z\d\s-_] ?
[11:39:28] GorillaApe: if there a way to force that it has at least [a-zA-Z\d] ?
[11:39:33] dminuoso: abhvl: If your company refuses to upgrade Rails version, then you may not be getting useful experience since its probably a crappy company - which in the long run can make getting a good job harder.
[11:39:34] ldnunes: has joined #RubyOnRails
[11:39:41] abhvl: last time i heard that they tried to upgrade to 4, but not everything can be ported because of some issues. its big and complex app they have. i am newly joined.
[11:39:57] abhvl: dminuoso: dont scare me.
[11:42:13] jhass: railsss: let me reformulate the question for you: "how to DRY up two methods in a class sharing the same exact code?"
[11:42:23] jhass: do you know the answer to that?
[11:42:35] railsss: @jhass nope
[11:42:53] jhass: well just extract their common code to a private method
[11:54:12] hck89: has joined #RubyOnRails
[11:54:57] mdw: has joined #RubyOnRails
[11:57:08] AimlessRAven: has joined #RubyOnRails
[11:57:21] AimlessRAven: if this params session['x-request-ss-msisdn'] return me phone number - example: 951111111
[11:57:32] AimlessRAven: how to update this params to exclude first 2 numbers
[11:57:37] AimlessRAven: and return me only 1111111
[11:58:40] dminuoso: AimlessRaven: How about you read a basic Ruby tutorial?
[11:58:45] Scient: http://ruby-doc.org/core-2.2.0/String.html#method-i-slice
[11:58:53] dminuoso: Scient: Don't spoonfeed please.
[11:59:08] dminuoso: AimlessRaven is a regular who keeps refusing to read any tutorials, manuals or guides.
[11:59:10] Scient: giving links to documentation isnt exactly spoonfeeding
[11:59:12] Scient: he can figure it out
[11:59:37] dminuoso: Scient: He shouldn't be asking this in the first place after being here for what, a year now?
[11:59:39] artto: has joined #RubyOnRails
[11:59:48] Scient: well... if he refuses to read that link then its his problem :P
[12:00:04] Scient: idk i havent noticed him before personally
[12:01:36] roshanavand: has joined #RubyOnRails
[12:01:58] Ropeney: has joined #RubyOnRails
[12:03:47] blackmesa: has joined #RubyOnRails
[12:06:23] jhass: ACTION slaps helpa
[12:07:08] dminuoso: Close enough. You can expect someone who has been fiddling around with Ruby/Rails for 9 months to know basic string manipulation - or send him off to a basic tutorial instead. Wouldn't you agree jhass?
[12:09:23] FCser: has joined #RubyOnRails
[12:09:59] Scient: shhiiiieeet
[12:10:03] Scient: thats a long time :P
[12:13:56] edwinvdgraaf: has joined #RubyOnRails
[12:14:42] kedare1: has joined #RubyOnRails
[12:14:51] jsrn: has joined #RubyOnRails
[12:19:02] edwinvdgraaf: has joined #RubyOnRails
[12:19:34] workmad3: still so annoyed that I happened to not be online when helpa started logging :(
[12:19:57] workmad3: ACTION wonders if he can bribe Radar to manually update a timestamp
[12:20:24] rvanlieshout: when did helpa start logging?
[12:21:38] rvanlieshout: i'm sure radar is open to some donations
[12:21:43] marahin: Is there any way to see if .update has rolled back?
[12:21:59] marahin: I mean, something like: @import.update(stuff); if @import.updated? ... else ... end
[12:22:09] marahin: .changed? seems cool, but it throws true even though the change has rolled bakc
[12:22:57] Scient: update returns false if it doesnt complete successfully
[12:23:02] marahin: http://hastebin.com/wijivejoqa.coffee
[12:23:12] marahin: Scient, so: 'updated = import.update(stuff)... if updated ...'?
[12:23:14] marahin: That's kinda sad.
[12:23:28] workmad3: marahin: or just `if @import.update(stuff); ...`
[12:23:37] Scient: no thats actually the simple and elegant solution
[12:23:40] marahin: yeah, same thing
[12:23:48] Scient: you are overthinking it
[12:23:52] marahin: Scient, maybe :)
[12:24:03] Scient: if record.update(...) = if the record updated successfully
[12:24:05] marahin: Can you explain however why import.changed? throws true, even though the object didn't change?
[12:24:07] Scient: how much simpler can i get :D
[12:24:09] marahin: Or, record*
[12:24:21] Scient: changed? tracks attribute changes independently from persistence, or well almost
[12:24:28] Scient: persisting them wipes the changed state
[12:24:34] marahin: ah, I see.
[12:24:37] workmad3: marahin: because a rollback on the save doesn't cause the in-memory changes to be rolled back, and dirty-tracking is done on in-memory changes
[12:24:57] marahin: Scient, workmad3 that's what I wanted to know, if changed operates on the memory object I have, or actually checks the database data.
[12:25:09] marahin: Thank you, gentlemen (or ladies)!
[12:25:11] workmad3: marahin: in fact, if update *does* succeed, `.changed?` will go back to `false` (as the changes are now persisted)
[12:25:41] marahin: workmad3, haha, so I actually *CAN* use .changed :) except that would be terrible for another developer to read I suppose
[12:25:49] marahin: thank you again!
[12:26:01] workmad3: marahin: yeah... if you want to check changes after `update`, you want to grab previous_changes :) http://apidock.com/rails/ActiveModel/Dirty/previous_changes
[12:26:23] roshanavand: has joined #RubyOnRails
[12:27:48] marahin: workmad3, I will just stick to if model.update(params)
[12:28:05] workmad3: sounds good (and idiomatic rails) :)
[12:28:15] ElFerna: has joined #RubyOnRails
[12:29:32] flashpoint9: has joined #RubyOnRails
[12:29:43] dionysus69: has joined #RubyOnRails
[12:32:00] rodferso1: has joined #RubyOnRails
[12:33:47] Oliphaunte: has joined #RubyOnRails
[12:36:58] pvertenten: has joined #RubyOnRails
[12:38:11] davidklsn: has joined #RubyOnRails
[12:39:12] Ropeney: has joined #RubyOnRails
[12:39:34] benlieb: has joined #RubyOnRails
[12:39:36] pawnbox: has joined #RubyOnRails
[12:40:23] pawnbox: has joined #RubyOnRails
[12:41:35] AimlessRAven: has joined #RubyOnRails
[12:41:50] AimlessRAven: what is the best way to send one email content to different recipient in mailer method
[12:42:05] AimlessRAven: can i call mailer method twice just with different recipient
[12:42:48] blackmesa: has joined #RubyOnRails
[12:44:03] crystal77: has joined #RubyOnRails
[12:45:28] lupine: has joined #RubyOnRails
[12:45:34] elaptics: AimlessRaven: use cc or bcc if it's the same email. Or do you mean you want to personalise the content for each recipient?
[12:46:22] l4v2: has joined #RubyOnRails
[12:46:46] AimlessRAven: elaptics: i want to send one email to 2 recipient but in 2 mails no one email to 2 recipient
[12:47:09] AimlessRAven: if i coppy the mailer action and send different recipients .. mailer just send to last recipient
[12:47:22] jjwright: has joined #RubyOnRails
[12:48:58] rafaelfranca: has joined #RubyOnRails
[12:49:02] yottanami: has joined #RubyOnRails
[12:49:41] yottanami: This is my yml dump from a model how can I use it as seed data?
[12:49:42] yottanami: http://dpaste.com/3T10NCZ
[12:50:53] greghoggard: has joined #RubyOnRails
[12:52:03] orolo: has joined #RubyOnRails
[12:53:37] blackhuey: has joined #RubyOnRails
[12:55:07] xpl0iter: has joined #RubyOnRails
[12:55:23] Kbcrooms: has joined #RubyOnRails
[12:56:05] jjwright_: has joined #RubyOnRails
[12:56:17] ekinmur: has joined #RubyOnRails
[12:57:09] xpl0iter: Hi, I have a active record query which returns the way I expected it to. Now I need to change it so that it displays the only records where one more condition is met. The condition is the application_profiles.id shouldn't exist in profile_segments.application_profile_id. Here is my current statement. http://pastie.org/private/vy6bp9mpez8y9goavos6ya
[12:57:28] xpl0iter: How do I add the "doesn't exist" condition along with this?
[12:57:54] elaptics: AimlessRaven: http://guides.rubyonrails.org/action_mailer_basics.html#sending-email-to-multiple-recipients
[12:58:12] roshanavand: has joined #RubyOnRails
[12:58:12] rvanlieshout: xpl0iter: don't use variables directly in your sql
[12:58:52] rvanlieshout: .where("application_profiles.application_id = '#{@application_id}'") => .where(application_profiles: { application_id : @application_id })
[12:59:16] ekinmur: has joined #RubyOnRails
[12:59:36] xpl0iter: rvanlieshout, Ok. but how do I write it without the variables?
[13:00:06] rvanlieshout: and you might want to add a .where('application_profiles.id NOT IN (SELECT application_profile_id FROM profile_segments)')
[13:00:15] elaptics: xpl0iter: read the guides http://guides.rubyonrails.org/active_record_querying.html#array-conditions
[13:00:16] rvanlieshout: xpl0iter: 14:58 < rvanlieshout> .where("application_profiles.application_id = '#{@application_id}'") => .where(application_profiles: { application_id : @application_id })
[13:00:42] elaptics: xpl0iter: read the part about placeholder conditions
[13:01:16] snowy: has joined #RubyOnRails
[13:01:33] xpl0iter: rvanlieshout, thanks, elaptics thanks. Will check it out.
[13:02:43] ramortegui: has joined #RubyOnRails
[13:05:48] blackmesa: has joined #RubyOnRails
[13:10:13] visionary: has joined #RubyOnRails
[13:15:34] artto_: has joined #RubyOnRails
[13:16:14] iwada: has joined #RubyOnRails
[13:18:22] pvertenten: has joined #RubyOnRails
[13:18:26] iwada: With this
[13:18:36] iwada: resources :reports, :concerns => :paginatable
[13:18:44] iwada: How do i achieve that with a single route
[13:19:00] iwada: get 'my/subscriptions/' => "subscriptions#index", :concerns => :paginatable
[13:19:21] iwada: That does not seem to work as i thought it would...
[13:19:23] jjwright: has joined #RubyOnRails
[13:19:29] rvanlieshout: use resource?
[13:19:35] rvanlieshout: resource :subscription, ...
[13:19:52] rvanlieshout: http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-resource
[13:20:02] iwada: Using resources works as expected...
[13:20:11] rvanlieshout: resource, singular
[13:20:48] jhass: what's concerns anyway, I don't see it documented?
[13:20:52] iwada: Was asking if there's a way to use it on a sngular route,
[13:21:16] iwada: jhass, introduced in rails 4
[13:21:25] rvanlieshout: http://guides.rubyonrails.org/routing.html#routing-concerns
[13:21:40] jhass: awesome, so nobody bothered to update the API docs for years...
[13:21:43] edwinvdg_: has joined #RubyOnRails
[13:21:56] Malgorath: has joined #RubyOnRails
[13:22:15] Malgorath: Hey everyone. How is life going in RoR Land
[13:22:45] jhass: iwada: well, how does that make any sense on a singular route anyway, there's no nesting defined there
[13:23:05] rvanlieshout: jhass: it's not wrong. it just lacks what that option does
[13:23:21] visionary: I created a rails 5 api using api-only = true. Now I would like to serve one dynamic html page. How do I go about doing that or reversing api-only…?
[13:23:22] jhass: I didn't say it's wrong, confusing still though
[13:24:02] iwada: Jhass, by singular Route i meant this kidda of ussage
[13:24:03] iwada: get 'my/subscriptions/' => "subscriptions#index", :concerns => :paginatable
[13:24:14] jhass: yes, I was using your term there
[13:24:34] jhass: iwada: you don't expect get "foo" => "bar" do ... end to work either, right?
[13:25:30] iwada: Jhass, Yea,in this scenerio,
[13:25:37] jjwright: has joined #RubyOnRails
[13:29:36] davidklsn: has joined #RubyOnRails
[13:32:07] ekinmur: has joined #RubyOnRails
[13:32:25] M-shine: has joined #RubyOnRails
[13:32:49] finnnnnnnnnnn: has joined #RubyOnRails
[13:33:49] pawnbox: has joined #RubyOnRails
[13:34:41] finnnnnnnnnnn: if I do myModel.all I get an arreay of all myModels. Is there a way to obtain an array of all models between two ids? Something like myModel.all(from_id: 6, to_id: 10)
[13:35:04] marahin: Is there a way to create simple_form's input field that is a collection from existing data, with option to enter user input?
[13:35:28] marahin: e.g. tags inheriting from collection's item, but giving an option to edit those?
[13:36:11] jhass: finnnnnnnnnnn: .where(id: 6..10) should work
[13:36:15] bruce_lee: has joined #RubyOnRails
[13:36:23] finnnnnnnnnnn: jhass: I’ll try that thanks
[13:37:22] finnnnnnnnnnn: jhass: that works great with IDs, I’m hoping it does with dates too
[13:38:00] jhass: anything your DB can compare I would expect
[13:38:16] aegis3121: has joined #RubyOnRails
[13:39:01] snowy: has joined #RubyOnRails
[13:39:35] someish: has joined #RubyOnRails
[13:40:22] SteenJobs: has joined #RubyOnRails
[13:43:05] dminuoso: jhass: Assuming your driver supports for it, yes.
[13:43:54] jjwright: has joined #RubyOnRails
[13:44:48] edwinvdgraaf: has joined #RubyOnRails
[13:48:02] edwinvdgraaf: has joined #RubyOnRails
[13:50:08] sergey_makagon: has joined #RubyOnRails
[13:50:43] rbr: has joined #RubyOnRails
[13:51:13] Macaveli: has joined #RubyOnRails
[13:51:18] eljimmy: has joined #RubyOnRails
[13:53:34] artto: has joined #RubyOnRails
[13:55:34] dminca: has joined #RubyOnRails
[13:55:56] dminca: has joined #RubyOnRails
[13:58:26] pawnbox: has joined #RubyOnRails
[13:59:44] solars: has joined #RubyOnRails
[14:00:45] ekinmur: has joined #RubyOnRails
[14:01:44] cpruitt: has joined #RubyOnRails
[14:02:19] Kbcrooms: has joined #RubyOnRails
[14:03:41] jjwright: has joined #RubyOnRails
[14:07:23] artto_: has joined #RubyOnRails
[14:07:41] Spami: has joined #RubyOnRails
[14:07:49] finnnnnnnnnnn_: has joined #RubyOnRails
[14:09:23] Spami_: has joined #RubyOnRails
[14:13:06] AnoHito_: has joined #RubyOnRails
[14:13:18] rvanlieshout: good afternoon
[14:14:59] Oliphaunte: has joined #RubyOnRails
[14:15:10] davidcelis_: has joined #RubyOnRails
[14:15:43] artto: has joined #RubyOnRails
[14:15:47] modran_: has joined #RubyOnRails
[14:16:06] maxmanders: has joined #RubyOnRails
[14:16:26] webnanners: has joined #RubyOnRails
[14:16:49] jsrn: has joined #RubyOnRails
[14:17:21] dionysus69: news1 = News.create(news_title: "news title 1",
[14:17:21] dionysus69: news_body: "news body 1",
[14:17:21] dionysus69: images_attributes: newsImages)
[14:17:26] dionysus69: newsImages is an array
[14:17:39] dionysus69: but this doesn't work in console. gives undefined method [] error
[14:17:54] pawnbox: has joined #RubyOnRails
[14:18:07] djbkd: has joined #RubyOnRails
[14:18:08] dionysus69: images_attributes are nested, and it works through form upload. how can I do this through console?
[14:18:17] stardiviner: has joined #RubyOnRails
[14:18:54] D9: has joined #RubyOnRails
[14:19:30] rvanlieshout: dionysus69: start with a full trace for that error, the code it uses and an inspect of newsImages
[14:20:50] Kbcrooms: has joined #RubyOnRails
[14:21:37] dionysus69: I think array is wrong
[14:21:47] dionysus69: I ll try modify it and I ll see if I still get error
[14:21:51] dminuoso: dionysus69: Dont.
[14:21:54] dminuoso: Stop what you are doing, and listen to rvanlieshout.
[14:22:15] dminuoso: Changing code to silence errors sucks. Understanding error messages and stack traces is what makes for good developers.
[14:22:22] vedu: but I agree
[14:22:51] yottanami: Is any way to dump a table and add it to seeds?
[14:23:31] dionysus69: ok I fixed it, https://gist.github.com/webzorg/20fa946922db99d8f4b96f3aa0eef83d
[14:23:41] dionysus69: I had array of just files
[14:25:58] djbkd: has joined #RubyOnRails
[14:26:04] finnnnnnnnnnn: has joined #RubyOnRails
[14:26:07] Kbcrooms: has joined #RubyOnRails
[14:28:08] someish: has joined #RubyOnRails
[14:28:52] flashpoint9: I want to get into contributing to rails, I've googled some videos on youtube and noted that rails guides has a section on it (havent started reading it yet). What is the best way to start? How should I approach this?
[14:30:09] jjwright: has joined #RubyOnRails
[14:30:19] vedu: yottanami: you could do a yaml dump. (there is a gem for it). and then load the yaml back in seeds.rb
[14:32:15] asheinfeld: has joined #RubyOnRails
[14:33:54] yottanami: vedu, I have this yaml file http://dpaste.com/3T10NCZ is it ok to load in seed file?
[14:34:05] asheinfeld: has joined #RubyOnRails
[14:35:05] vedu: yottanami: doesn't look like a database dump. This is a ruby object dump
[14:35:49] finnnnnnnnnnn: has joined #RubyOnRails
[14:36:08] vedu: yottanami: check this out: https://github.com/yamldb/yaml_db . for loading from the seeds.rb just invoke the required rake task
[14:38:16] pvertenten: has joined #RubyOnRails
[14:41:45] lupine: has joined #RubyOnRails
[14:42:15] yottanami: vedu, Is any way to use yaml_db output in seeds?
[14:44:29] evansbee: has joined #RubyOnRails
[14:46:02] arooni: has joined #RubyOnRails
[14:46:02] finnnnnnnnnnn: has joined #RubyOnRails
[14:46:13] arooni: has left #RubyOnRails: ()
[14:46:22] vedu: yottanami: yes, I just told you. ^^
[14:46:59] jjwright: has joined #RubyOnRails
[14:47:00] justplaykid: has joined #RubyOnRails
[14:47:09] dminuoso: has joined #RubyOnRails
[14:47:20] fmcgeough: has joined #RubyOnRails
[14:47:53] banisterfiend: has joined #RubyOnRails
[14:50:09] artto_: has joined #RubyOnRails
[14:50:16] justplaykid: i have a doubt regarding 2.3.3 exercise "Edit the user show page to display the content of the user’s first micropost."
[14:51:31] justplaykid: i have edited the show view page with <p> <strong>First Post:</strong> <%= @user.microposts.first.content %> </p> to display current user first post
[14:52:15] lupine: has joined #RubyOnRails
[14:52:31] justplaykid: it is working good if already user is having microposts otherwise it is throwing error
[14:52:43] Guest: has joined #RubyOnRails
[14:53:12] upsell5: has joined #RubyOnRails
[14:53:40] agent_white: has joined #RubyOnRails
[14:54:29] diegoviola: has joined #RubyOnRails
[14:55:15] daumie: has joined #RubyOnRails
[14:55:32] finnnnnnnnnnn: has joined #RubyOnRails
[14:55:33] orolo: has joined #RubyOnRails
[14:56:41] Axilla: has joined #RubyOnRails
[14:57:14] kuroro: has joined #RubyOnRails
[14:58:36] rails145: has joined #RubyOnRails
[14:59:35] kuroro: anyone have experience on running rails migrations on docker based deployments (i.e. deploying 4 docker containers each containg same rails app, how to prevent running migrations at same time and conflicting with each other)
[15:00:14] rails145: I want a button such that when it's clicked, it will fire up a bootstrap modal if javascript is enabled in the browser, else, it will redirect to new_post_path if javascript is disabled
[15:00:20] rails145: Here's the button -- %button.btn.btn-primary.btn-lg{"data-target" => "#myModal", "data-toggle" => "modal", :type => "button"}
[15:00:34] rails145: How do I edit it to reflect what I want?
[15:00:53] dminuoso: rails145: Have a JavaScript asset that fiddles around with the events...
[15:01:04] dminuoso: rails145: If you don't know how that works, you probably don't want to mess with modals just yet.
[15:01:08] dminuoso: And read basic JavaScript tutorials first.
[15:02:17] Macaveli: has joined #RubyOnRails
[15:02:32] pawnbox: has joined #RubyOnRails
[15:02:38] prithaj: has joined #RubyOnRails
[15:02:48] jhass: rails145: you want a normal link styled as a button
[15:03:13] shinnya: has joined #RubyOnRails
[15:03:32] rails145: @jhass alright. so how would i proceed after that?
[15:04:00] jhass: see above. Doesn't bootstrap also already ship magic to do it?
[15:04:30] pawnbox: has joined #RubyOnRails
[15:05:01] GodFather: has joined #RubyOnRails
[15:06:13] aegis3121: has joined #RubyOnRails
[15:07:35] bga57: has joined #RubyOnRails
[15:09:12] blackmesa: has joined #RubyOnRails
[15:10:35] jjwright: has joined #RubyOnRails
[15:12:13] Palsson: has joined #RubyOnRails
[15:14:23] jtong: has joined #RubyOnRails
[15:15:02] bbrowning: has joined #RubyOnRails
[15:17:21] erlend: has joined #RubyOnRails
[15:17:25] the_drow: has joined #RubyOnRails
[15:17:58] the_drow: has joined #RubyOnRails
[15:20:03] one_zero: has joined #RubyOnRails
[15:21:54] dminuoso: has joined #RubyOnRails
[15:22:10] uranther: has joined #RubyOnRails
[15:24:05] finnnnnnnnnnn: has joined #RubyOnRails
[15:24:28] hck89: has joined #RubyOnRails
[15:25:09] macsteps: has joined #RubyOnRails
[15:25:37] dionysus69: has joined #RubyOnRails
[15:28:05] artto: has joined #RubyOnRails
[15:31:02] arifba: has joined #RubyOnRails
[15:31:20] arifba: could someone take a look? https://stackoverflow.com/questions/38328690/masonry-with-ajax-infinite-scrolling-not-working-rails
[15:31:30] jjwright: has joined #RubyOnRails
[15:31:53] flashpoint9: has joined #RubyOnRails
[15:31:53] dvinciguerra: has joined #RubyOnRails
[15:40:02] snowy: has joined #RubyOnRails
[15:40:06] Terens: I want to perform some kind of equality check before saving a model on its associations.
[15:40:31] Terens: it is somewhat easy with a bit arel etc
[15:40:39] Terens: no more than 20 lines of code
[15:40:49] Terens: however the problem is that currently I have implemented it as validator
[15:40:56] Terens: which isnt safe.
[15:41:11] Terens: Should I move it to before save ?
[15:41:14] Terens: callback?
[15:45:03] jmignault: has joined #RubyOnRails
[15:47:53] rafaelfranca: has joined #RubyOnRails
[15:48:37] disgrntld: has joined #RubyOnRails
[15:48:42] Macaveli: has joined #RubyOnRails
[15:48:43] fryguy: why isn't the validator safe
[15:49:25] Macaveli: has joined #RubyOnRails
[15:50:05] Macaveli: has joined #RubyOnRails
[15:50:10] jjwright: has joined #RubyOnRails
[15:50:45] Macaveli: has joined #RubyOnRails
[15:51:25] Macaveli: has joined #RubyOnRails
[15:52:05] Macaveli: has joined #RubyOnRails
[15:52:29] [Butch]: has joined #RubyOnRails
[15:53:05] Macaveli: has joined #RubyOnRails
[15:53:15] lupine: race conditions, presumably
[15:54:01] Axilla: has joined #RubyOnRails
[15:54:06] Macaveli_: has joined #RubyOnRails
[15:57:57] aegis3121: has joined #RubyOnRails
[16:00:51] macsteps: has joined #RubyOnRails
[16:01:40] tjohnson: has joined #RubyOnRails
[16:02:56] shinnya: has joined #RubyOnRails
[16:04:24] jjwright: has joined #RubyOnRails
[16:05:38] Terens: yeah that
[16:06:55] bbrowning_: has joined #RubyOnRails
[16:07:09] moep: has joined #RubyOnRails
[16:07:10] roshanavand: has joined #RubyOnRails
[16:08:17] sypheren: has joined #RubyOnRails
[16:08:49] elaptics: has joined #RubyOnRails
[16:10:21] whathappens: has joined #RubyOnRails
[16:11:50] whathapp_: has joined #RubyOnRails
[16:11:52] barhum2013: has joined #RubyOnRails
[16:11:54] camonz: has joined #RubyOnRails
[16:12:09] jjwright: has joined #RubyOnRails
[16:12:16] meoblast001: has joined #RubyOnRails
[16:12:51] blackmesa: has joined #RubyOnRails
[16:13:30] webnanners: has joined #RubyOnRails
[16:13:42] camonz: how can I set the values of a habtm relation without having the entire instance of the associated object
[16:14:13] webnanners: has joined #RubyOnRails
[16:14:14] webnanners: has joined #RubyOnRails
[16:14:19] camonz: because I have a very large object with a GIS geography that I don't need loaded, I just need the id so I can set the habtm
[16:14:38] srinidhi: has joined #RubyOnRails
[16:15:12] jhass: so the question is how to just fetch the id?
[16:15:15] jhass: .select or .pluck
[16:15:32] camonz: no, how to set them on the habtm
[16:15:40] cschneid_: has joined #RubyOnRails
[16:15:51] jhass: .select then
[16:15:52] camonz: if I do .association << models with the partially loaded models then I get validation errors on the associated models
[16:16:04] jhass: ah well, yes
[16:16:25] jhass: you could switch your habtm to has_many :through
[16:16:34] jhass: with an explicit join model
[16:16:44] jhass: which you can just set ids on or whatever
[16:17:05] camonz: fair enough
[16:17:14] camonz: feels like overkill though
[16:17:39] jhass: not really, in fact the community consensus seems to be to prefer has_many through: over habtm anyway
[16:17:50] FCser: has joined #RubyOnRails
[16:18:05] jhass: for example rubocop has a cop to enforce it
[16:18:29] camonz: why though, it's just a join table, the rule of thumb is to use hm:t if you plan on manipulating the join table
[16:18:40] camonz: that is, if you have something other than FKs in there
[16:19:20] jhass: and experience of most people seem to show that you don't yet know more often than not whether you're going to, so hm:t is future proofing
[16:20:35] camonz: fair enough, thanks
[16:20:43] camonz: I'll switch to hm:t
[16:21:10] AndrewIsHere: has joined #RubyOnRails
[16:21:25] dminuoso: has joined #RubyOnRails
[16:25:12] moeabdol: has joined #RubyOnRails
[16:26:09] FCser: has joined #RubyOnRails
[16:26:28] Pumukel: has joined #RubyOnRails
[16:26:50] edwinvdgraaf: has joined #RubyOnRails
[16:28:13] daumie: has joined #RubyOnRails
[16:28:26] eljimmy: has joined #RubyOnRails
[16:28:30] mello: has joined #RubyOnRails
[16:32:26] blackmesa: has joined #RubyOnRails
[16:34:56] jjwright: has joined #RubyOnRails
[16:35:24] Jon30: has joined #RubyOnRails
[16:35:24] Jon30: has joined #RubyOnRails
[16:35:35] Axsuul: has joined #RubyOnRails
[16:36:28] finnnnnnnnnnn: has joined #RubyOnRails
[16:37:06] wd40s: has joined #RubyOnRails
[16:37:48] hck89: has joined #RubyOnRails
[16:38:50] macsteps: has joined #RubyOnRails
[16:39:59] n90b0jjf: has joined #RubyOnRails
[16:40:34] polishdub: has joined #RubyOnRails
[16:42:13] DoctorMonocular: has joined #RubyOnRails
[16:42:44] pur3eval: has joined #RubyOnRails
[16:43:56] manfrin: has joined #RubyOnRails
[16:45:20] Monolithe: has joined #RubyOnRails
[16:47:28] umdstu: has joined #RubyOnRails
[16:48:54] sergey_makagon: has joined #RubyOnRails
[16:49:24] Kbcrooms: has joined #RubyOnRails
[16:50:02] Coldblackice: has joined #RubyOnRails
[16:51:39] adavia: has joined #RubyOnRails
[16:52:14] hck89: has joined #RubyOnRails
[16:53:57] marr: has joined #RubyOnRails
[16:58:31] eljimmy: has joined #RubyOnRails
[16:58:40] frem_: has joined #RubyOnRails
[17:00:52] hahuang61: has joined #RubyOnRails
[17:01:21] greghoggard: has joined #RubyOnRails
[17:01:34] pur3eval: has joined #RubyOnRails
[17:02:17] barhum2013: has joined #RubyOnRails
[17:02:29] aegis3121: has joined #RubyOnRails
[17:02:51] daumie: has joined #RubyOnRails
[17:03:00] d5sx43: has joined #RubyOnRails
[17:03:46] benlieb: has joined #RubyOnRails
[17:03:47] dragon9783: has joined #RubyOnRails
[17:05:50] SteenJobs: has joined #RubyOnRails
[17:07:31] tribals: has joined #RubyOnRails
[17:08:31] pawnbox: has joined #RubyOnRails
[17:08:33] jjwright: has joined #RubyOnRails
[17:10:12] tribals: i'm trying to deploy my app to heroku, when i run `rake db:setup`, i'm getting error `Excon::Errors::SocketError: getaddrinfo: Name or service not known (SocketError)`, which is relied to fog configuration for S3 bucket. i specify correct aws access and secret keys, region
[17:11:39] blackmesa: has joined #RubyOnRails
[17:11:56] pawnbox: has joined #RubyOnRails
[17:13:14] daumie: has joined #RubyOnRails
[17:14:08] n1lo: has joined #RubyOnRails
[17:14:33] eljimmy: has joined #RubyOnRails
[17:15:01] fryguy: getaddrinfo has to do with hostname, not access keys
[17:15:12] daumie: has joined #RubyOnRails
[17:15:12] d5sx43: has joined #RubyOnRails
[17:16:16] d5sx43: has joined #RubyOnRails
[17:16:28] aegis3121: has joined #RubyOnRails
[17:17:05] mrbubbles: has joined #RubyOnRails
[17:19:35] d5sx43: has joined #RubyOnRails
[17:22:20] Maletor: has joined #RubyOnRails
[17:22:50] Maletor: has joined #RubyOnRails
[17:23:25] daumie: has joined #RubyOnRails
[17:23:27] [Butch]: has joined #RubyOnRails
[17:25:26] shinnya: has joined #RubyOnRails
[17:26:05] jtong: has joined #RubyOnRails
[17:26:27] dopamean_: has joined #RubyOnRails
[17:26:59] Andr3as_: http://stackoverflow.com/questions/12100909/rails-carrierwave-fog-s3-socket-error
[17:28:09] hahuang61: has joined #RubyOnRails
[17:28:26] tribals: the answer by link is recommend to set region correctly, i already do it
[17:29:04] dminuoso: tribals: Can you include a full stacktrace of your error?
[17:29:15] tribals: yes, second
[17:30:07] inkyoto: has joined #RubyOnRails
[17:30:33] jhwhite: has joined #RubyOnRails
[17:30:51] eljimmy: has joined #RubyOnRails
[17:31:36] dionysus69: has joined #RubyOnRails
[17:32:19] max2: has joined #RubyOnRails
[17:34:17] Spami: has joined #RubyOnRails
[17:34:55] axl_: has joined #RubyOnRails
[17:35:06] rogue_koder: has joined #RubyOnRails
[17:35:54] roshanavand: has joined #RubyOnRails
[17:36:54] axl_: has left #RubyOnRails: ()
[17:37:48] Spami: has joined #RubyOnRails
[17:41:55] pwnd_nsfw`: has joined #RubyOnRails
[17:41:57] qejk: has joined #RubyOnRails
[17:42:00] jon31: has joined #RubyOnRails
[17:46:29] systemnate: has joined #RubyOnRails
[17:47:23] sneakers: has joined #RubyOnRails
[17:48:12] eljimmy: has joined #RubyOnRails
[17:50:08] Circuit8: has joined #RubyOnRails
[17:51:07] Circuit8: Hi guys, in your apps do you always create a polymorphic imageable resource if you're planning on having images associated with many different resources?
[17:51:31] barhum2013: has joined #RubyOnRails
[17:51:59] roshanavand: has joined #RubyOnRails
[17:53:10] yfeldblum: has joined #RubyOnRails
[17:54:14] cnk: Only if they behave the same, for example same thumbnail crops, etc
[17:54:48] cnk: I have several image types in my project because I need them processed differently and because they serve different purposes
[17:55:40] cnk: there are some downsides - I have some code duplication - and some upsides - the user is not offered an image that is not cropped correctly
[17:57:20] mrbubbles: Is there an obvious thing I'm missing where a model can be called Matviews::Parameters::Cos0AveMatview but not Matviews::Parameters::IL1Matview?
[17:58:02] Circuit8: cnk: Ah I see. Do you use paperclip? With that you can create many different thumbnail sizes etc. Why not just have one polymorphic imageable model and have whatever is using it pick the correct size it needs?
[17:58:33] cnk: This project is older than Paperclip
[17:58:52] axl_: has joined #RubyOnRails
[17:58:58] eljimmy: has joined #RubyOnRails
[17:59:00] Circuit8: cnk: Oh I see, would you recommend what I suggested if you had access to it?
[17:59:01] cnk: A single polymorphic model may be exactly right for you
[17:59:12] macsteps: has joined #RubyOnRails
[17:59:21] cnk: and might be what I would choose if I were rebuilding my project from scratch
[17:59:24] Circuit8: cnk: OK cool, it seems fine, I just wanted to check I wasn't doing something mental
[17:59:31] Circuit8: cnk: Thanks
[17:59:43] greghoggard: has joined #RubyOnRails
[18:00:29] cnk: The things I would want to check are that you can easily find for display the images you want. I hate CMS systems where you have a giant set of images and NO idea if they are used or not or can be safely removed
[18:02:02] Palsson: has joined #RubyOnRails
[18:02:07] pur3eval: has joined #RubyOnRails
[18:02:13] Circuit8: cnk: AKA Wordpress
[18:02:33] Circuit8: cnk: OK I'll be sure of that, thanks
[18:02:35] cnk: I was actually thinking Drupal but ya
[18:03:28] manfrin: has joined #RubyOnRails
[18:06:48] eljimmy: has joined #RubyOnRails
[18:08:14] DoctorMonocular: has joined #RubyOnRails
[18:09:11] elementaru: has joined #RubyOnRails
[18:09:29] Oliphaunte: has joined #RubyOnRails
[18:09:40] jjwright: has joined #RubyOnRails
[18:11:39] upsell5: has joined #RubyOnRails
[18:13:16] eljimmy: has joined #RubyOnRails
[18:15:42] edwinvdgraaf: has joined #RubyOnRails
[18:17:31] moeabdol: has joined #RubyOnRails
[18:17:38] AntiSpamMeta: has joined #RubyOnRails
[18:17:52] jheathco: has joined #RubyOnRails
[18:18:27] axl_: has joined #RubyOnRails
[18:19:20] wd40s: has joined #RubyOnRails
[18:20:30] douglascorrea: has joined #RubyOnRails
[18:21:27] whathappens: has joined #RubyOnRails
[18:21:57] GodFather: has joined #RubyOnRails
[18:23:59] srinidhi: has joined #RubyOnRails
[18:25:26] pawnbox: has joined #RubyOnRails
[18:27:32] greghoggard: has joined #RubyOnRails
[18:28:54] srinidhi1: has joined #RubyOnRails
[18:31:44] Oliphaunte: has joined #RubyOnRails
[18:32:23] pLaTo0n: has joined #RubyOnRails
[18:35:03] jjwright: has joined #RubyOnRails
[18:45:15] pur3eval: has joined #RubyOnRails
[18:48:05] AndroidLoverInSF: has joined #RubyOnRails
[18:51:53] akira616: has joined #RubyOnRails
[18:52:37] DoctorMonocular: has joined #RubyOnRails
[18:53:38] pwnd_nsfw: has joined #RubyOnRails
[18:55:49] pawnbox: has joined #RubyOnRails
[18:57:03] Axsuul: has joined #RubyOnRails
[18:57:25] djbkd: has joined #RubyOnRails
[18:57:33] jjwright: has joined #RubyOnRails
[18:57:53] Dimik: has joined #RubyOnRails
[18:59:44] jstransky: has joined #RubyOnRails
[19:01:40] aegis3121: has joined #RubyOnRails
[19:02:05] daumie: has joined #RubyOnRails
[19:02:22] eljimmy: has joined #RubyOnRails
[19:09:33] jjwright: has joined #RubyOnRails
[19:12:22] bbrowning: has joined #RubyOnRails
[19:16:32] xingped: has joined #RubyOnRails
[19:17:42] xingped: Hey there. I've tried to generate a rails api-only project, but it doesn't seem to be generating as an api-only project. I'm using "rails new my_proj --api -T -d postgresql", but my config/application.rb doesn't contain the "config.api_only = true" line
[19:17:44] xingped: any ideas?
[19:20:59] xingped: ah, found the docs for rails. i'm on 4.2.6 and it looks like rails new doesn't have an "--api" option?
[19:21:47] Spami: has joined #RubyOnRails
[19:21:57] edwinvdgraaf: has joined #RubyOnRails
[19:24:04] sergey_makagon: has joined #RubyOnRails
[19:24:21] n90b0jjf: @xingped pretty sure that sounds right
[19:24:55] n90b0jjf: i think --api is rails 5.0, especially since i've never used it ;-D
[19:25:45] manfrin: has joined #RubyOnRails
[19:25:45] barhum2013: has joined #RubyOnRails
[19:26:17] jjwright: has joined #RubyOnRails
[19:26:47] Darmani: has joined #RubyOnRails
[19:26:49] cnk: right. If you need to create your new api with rails 4, there may be a gem for that - if not, then blog post about which parts of rails to load
[19:26:58] cnk: xingped: ^
[19:27:24] arup_r: has joined #RubyOnRails
[19:30:33] xingped: cool, thanks guys
[19:30:54] manfrin_: has joined #RubyOnRails
[19:31:37] douglasc_: has joined #RubyOnRails
[19:32:20] bbrowning_: has joined #RubyOnRails
[19:34:57] bga57: has joined #RubyOnRails
[19:37:45] jhwhite: xingped: https://github.com/rails-api/rails-api
[19:37:46] greghoggard: has joined #RubyOnRails
[19:40:35] pLaTo0n: has joined #RubyOnRails
[19:40:35] pLaTo0n: has joined #RubyOnRails
[19:41:40] Darmani: Hey guys, one of my buttons on my show page does absolutely nothing
[19:41:41] Darmani: https://gist.github.com/mfifth/9cc8d01cc7babe3ee96acc68e73aa622#file-show-html-erb-L27
[19:41:46] Darmani: I have no idea why.
[19:42:34] Darmani: Also related, if I wanted to update a particular shirt on an order would it be a post request or a patch request? o.o
[19:42:36] Axilla: has joined #RubyOnRails
[19:46:29] jjwright: has joined #RubyOnRails
[19:47:27] dminuoso: Darmani: Why would you think it's possible PATCH?
[19:47:52] dminuoso: Darmani: https://tools.ietf.org/html/rfc5789
[19:48:21] manfrin: has joined #RubyOnRails
[19:48:34] Darmani: dminuoso: o.o
[19:48:37] dminuoso: Darmani: The question of which verb depends on what your resource is. Is your resource "order" ?
[19:49:13] Darmani: No it's technically a "variant" of the subclass "shirt" which belongs to an "order"
[19:49:32] Darmani: dminuoso: I'm trying to update the quantity of the "variant"
[19:50:04] dminuoso: Darmani: Oh! Why do you think POST would be adequate then?
[19:50:25] Andr3as_: is that do |f| ok with variant.quantity? (might be a lame question)
[19:50:27] dminuoso: Darmani: If your resource is "variant" the question is, are you changing an existing variant, or creating an ew one?
[19:50:43] Darmani: dminuoso: I'm changing an existing one...
[19:50:49] zacts: has joined #RubyOnRails
[19:50:53] dminuoso: Darmani: https://tools.ietf.org/html/rfc7231#section-4.3.3
[19:50:56] Darmani: Andr3as_: and that's the only way the form will work otherwise I get an error.
[19:51:00] dminuoso: " Creating a new resource that has yet to be identified by the
[19:51:01] dminuoso: origin server;
[19:51:19] Darmani: dminuoso: o Appending data to a resource's existing representation(s).
[19:52:03] pawnbox: has joined #RubyOnRails
[19:52:37] n90b0jjf: has joined #RubyOnRails
[19:52:46] lupine: has joined #RubyOnRails
[19:52:51] dminuoso: Darmani: Im not exactly sure whats meant by it. POST is basically the "CREATE" in HTTP.
[19:53:26] Darmani: dminuoso: Ah, well if that's the case then it's not a Post request.
[19:53:44] dminuoso: Darmani: I think its describing a case where you are "creating a message to a board" (and thus appending data to another resource)
[19:53:51] dminuoso: Darmani: Yeah.
[19:54:07] dminuoso: Darmani: The differentiation between PUT and PATCH is far more interesting. :-)
[19:54:21] Darmani: dminuoso: Lol I'm sure it is.
[19:54:49] dminuoso: Darmani: Though I guess "technically" POST is not clearly defined in the RFC.
[19:55:08] Darmani: dminuoso: I just want to know why the form doesn't submit the information when I press the button.
[19:55:20] Darmani: It doesn't even give me an error it's like empty.
[19:55:30] apotry: has joined #RubyOnRails
[19:55:34] dminuoso: Darmani: Let me introduce you to the developer tools of your browser
[19:55:41] dminuoso: This is Mike. Mike, this is Darmani.
[19:55:43] dminuoso: Have fun you two.
[19:55:53] Darmani: dminuoso: lmao
[19:56:02] Darmani: Hello Mike!
[19:56:28] flashpoint9: has joined #RubyOnRails
[19:58:57] arooni-mobile: has joined #RubyOnRails
[19:59:28] rafaelfranca: has joined #RubyOnRails
[20:02:24] DoctorMonocular: has joined #RubyOnRails
[20:02:37] whathappens: has joined #RubyOnRails
[20:03:06] Darmani: If anyone gets a chance, take a look please ^.^
[20:03:07] Darmani: https://gist.github.com/mfifth/9cc8d01cc7babe3ee96acc68e73aa622#file-orders_controller-rb-L23
[20:03:07] ziggy: has joined #RubyOnRails
[20:04:04] whathappens: has joined #RubyOnRails
[20:04:07] highbass: has joined #RubyOnRails
[20:04:14] highbass: hey guys.. i used some gems to overwrite the default Raisl logger... however, i still have some logs that get written over to logs/production.log ....
[20:04:17] highbass: how can i go about redirecting those logs to a different location?
[20:04:27] clandry94: has joined #RubyOnRails
[20:04:30] jjwright: has joined #RubyOnRails
[20:05:47] pur3eval: has joined #RubyOnRails
[20:10:15] Oliphaunte: has joined #RubyOnRails
[20:10:32] LBRapid: has joined #RubyOnRails
[20:11:37] jhass: has joined #RubyOnRails
[20:14:19] hahuang61: has joined #RubyOnRails
[20:14:39] yfeldblum: has joined #RubyOnRails
[20:16:30] Velizar: has joined #RubyOnRails
[20:18:08] AntiSpamMeta: has joined #RubyOnRails
[20:20:59] jenrzzz: has joined #RubyOnRails
[20:20:59] jenrzzz: has joined #RubyOnRails
[20:21:46] jtong: has joined #RubyOnRails
[20:21:51] Scriptonaut: has joined #RubyOnRails
[20:23:19] Scriptonaut: does anyone know how I can change the timezone of a DateTime without changing the hour value?
[20:23:49] Scriptonaut: so if the time is 7:30 UTC, I want to change it to 7:30 PST or 7:30 PDT depending on daylight savings
[20:24:57] jtong_: has joined #RubyOnRails
[20:25:55] pur3eval: has joined #RubyOnRails
[20:27:30] flashpoint9: has joined #RubyOnRails
[20:27:35] VeryBewitching: has joined #RubyOnRails
[20:27:45] edwinvdgraaf: has joined #RubyOnRails
[20:28:41] Terens: has anyone used ioctl/
[20:29:06] Polysics: has joined #RubyOnRails
[20:29:45] Polysics: hello! has validation behavior changed in RAils 5? I have a "validate do" block that adds an error (and should be ALWAYS invalid, right?), that is being ignored in specs
[20:30:19] fryguy: yes there are lots of changes to validation behavior in rails 5
[20:30:59] jjwright: has joined #RubyOnRails
[20:31:20] Polysics: fryguy: is it by chance not validating associated objects by default?
[20:32:03] Polysics: although what I am doing as a test is literally just add the error, which should make the object always invalid
[20:33:27] matthewd: polysics: Nothing I know of
[20:35:55] dminuoso: polysics: !gist
[20:35:55] helpa: polysics: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:36:03] dminuoso: Include the spec too.
[20:36:08] matthewd: Scriptonaut: Do I need to wind up my I-told-you-so face? ;)
[20:37:52] Polysics: spec is irrelevant, I think
[20:37:53] Polysics: https://gist.github.com/polysics/f594c9e79d31a2d345a91fbe85829418
[20:37:59] Polysics: as I removed all conditionals
[20:38:30] dminuoso: polysics: !mcve
[20:38:30] helpa: polysics: Please provide a Minimal, Complete, and Verifiable example of your problem to assist us - http://stackoverflow.com/help/mcve
[20:38:37] Polysics: that validate block should ALWAYS make the record invalid
[20:38:54] dminuoso: polysics: If you leave out things you "think" are not relevant, they probably *ARE* relevant. You can leave out things you have PROVEN to be irrelevant.
[20:38:57] dminuoso: So go make a test case.
[20:39:03] dminuoso: Remove code until the problem stops presenting.
[20:40:47] SteenJobs: has joined #RubyOnRails
[20:41:31] Scriptonaut: haha matthewd
[20:41:47] Scriptonaut: the timezones aren't a nightmare...yet
[20:42:30] clandry94: has joined #RubyOnRails
[20:44:20] cnk: if you are trying to just jam the timezone part onto a datetime, you have a nightmare
[20:44:42] Scriptonaut: I'm collecting a time from users that has no timezone on it
[20:45:12] Scriptonaut: I like to store all my times in UTC
[20:45:12] cnk: and then you are trying to cast it to goodness only knows what TZ
[20:45:26] cnk: good, rails likes that
[20:45:43] Scriptonaut: ah, I see what you mean
[20:45:51] cnk: so why are you trying to take 7:30 UTC and turn it into 7:30 PST?
[20:45:55] Scriptonaut: I should be storing it as the proper UTC time, not just the time they entered with UTC jammed onto it
[20:45:59] cnk: that is wrong on a lot of levels
[20:46:08] Scriptonaut: because, I'm storing it as 7:30 UTC when it's really 7:30 PST
[20:46:22] cnk: ya don't do that
[20:46:34] Scriptonaut: The column is a time data type in active record
[20:46:38] Scriptonaut: does time take timezones?
[20:47:00] cnk: I dont' know you will need to consult the docs
[20:47:27] deur-_: has joined #RubyOnRails
[20:49:45] matthewd: PostgreSQL has a timetz type, which is even more useless than the time type
[20:50:09] hahuang61: has joined #RubyOnRails
[20:51:50] Scriptonaut: the issue with storing it in DateTime, is if they enter 23:00 PST, and I convert it to UTC, it will be the next day
[20:52:17] Scriptonaut: however, I haven't yet determined the date, that is determined at a later time. Just the Time is determined when I create this record
[20:53:22] greghoggard: has joined #RubyOnRails
[20:53:24] cnk: OK that is odd
[20:53:29] cnk: what are you writing?
[20:53:30] jjwright: has joined #RubyOnRails
[20:53:44] cnk: I want something at 7:30 - any day?
[20:55:34] Axsuul: has joined #RubyOnRails
[20:55:43] cnk: you could store it in a datetime, convert it back to the correct TZ, and then change it to the correct day once you know it - just adding days
[20:57:03] fryguy: cnk: you are making life way more difficult for yourself, and you are going to end up with corrupted data in your database
[20:57:18] cnk: not my data
[20:57:28] DoctorMonocular: has joined #RubyOnRails
[20:57:33] fryguy: whoops, yah wrong person
[20:57:34] cnk: Scriptonaut: has some weird thing that takes a time w/o a date
[20:57:44] akira616: has joined #RubyOnRails
[20:58:10] cnk: but ya, this sounds like the better answer is "don't do that"!
[20:58:55] Scriptonaut: ok, what should I do then?
[20:58:58] Scriptonaut: I'll lay it out really quick
[20:59:27] matthewd: Scriptonaut: Store the time however you like, but treat it as just an hh:mm value. Do not treat it as a Time.
[21:00:09] Scriptonaut: I have a record called an Action, an Action has a "days_until_due" field, and a "send_time" field. When creating an action, I set these fields. Sometime later(days/months/years), I apply the Action to a person. When I apply the Action to a person, then I set a concrete "due_date". The "due_date" is days_until_due days at send_time o'clock
[21:00:20] Scriptonaut: matthewd: that's what I'm doing
[21:00:30] Scriptonaut: if they enter "7:30", I store "7:30"
[21:00:46] qejk: has joined #RubyOnRails
[21:00:55] matthewd: > how I can change the timezone of a DateTime
[21:00:59] matthewd: ^^ treating it as a Time
[21:01:15] Scriptonaut: I mean I do that after it has been stored
[21:01:23] Scriptonaut: this is what I'm doing while applying the Action
[21:01:27] Scriptonaut: which happens at some later date
[21:02:00] matthewd: What was wrong with the code I gave you the other day?
[21:02:13] Scriptonaut: I used the snippets you gave me
[21:02:27] Scriptonaut: with my_time.change hour: t.hour, min: t.min
[21:02:44] Scriptonaut: this happens after I store it, when applying the Action though
[21:02:46] Scriptonaut: not while storing it
[21:03:00] Scriptonaut: when I store the Time, I store it as a literal string, however the user entered it (a select dropdown actually)
[21:03:08] hahuang61: has joined #RubyOnRails
[21:03:32] pvertenten: has joined #RubyOnRails
[21:04:30] orolo: has joined #RubyOnRails
[21:04:33] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[21:05:01] Scriptonaut: which code do you want
[21:05:07] Scriptonaut: the view? Controller? Model? Schema?
[21:05:30] Scriptonaut: also decorators, helpers, or active interactions
[21:05:36] matthewd: Whatever's doing the date manipulation, I guess. Presumably some model methods?
[21:06:54] matthewd: Basically: the thing we're talking about, because details can get lost while discussing in words what we could both be looking at directly
[21:07:35] flashpoint9: has joined #RubyOnRails
[21:09:56] SteenJobs: anyone know what method Resque/resque-scheduler takes to query the job objects?
[21:10:14] SteenJobs: i want to remove some jobs from console, but want to fetch the job first to make sure i’m removing the correct one
[21:10:36] Scriptonaut: https://gist.github.com/robins35/5892a499f450334650b3253654fc92ff
[21:11:12] Scriptonaut: lines 22 and 23 in the view file are where I generate the times the user can enter
[21:11:28] Scriptonaut: and the exposure is where the options for the select are generated
[21:11:38] edwinvdg_: has joined #RubyOnRails
[21:12:16] matthewd: Scriptonaut: Oh, so you're setting the offset: on line 6 in action.rb, and that's where things are going awry?
[21:13:03] arooni-mobile: has joined #RubyOnRails
[21:13:49] Scriptonaut: matthewd: it doesn't go awry
[21:13:59] Scriptonaut: it seems to work
[21:14:11] matthewd: Well, it changes the time, which you don't want. Right?
[21:14:12] Scriptonaut: I fixed it, but now I'm worried I'm doing this the wrong way
[21:14:16] Scriptonaut: no it doesn't
[21:14:19] Scriptonaut: it keeps the time the same
[21:14:25] Scriptonaut: like, the hour and minute doesn't change
[21:14:30] Scriptonaut: but the offset changes
[21:14:39] matthewd: Oh, then.. it seems fine?
[21:14:43] Kbcrooms: has joined #RubyOnRails
[21:14:52] matthewd: I was expecting you'd do it on the line above
[21:15:07] matthewd: Put the 'now' into the target TZ, before we start manipulating it
[21:15:17] matthewd: But, if it works... :)
[21:17:27] arooni-mobile__: has joined #RubyOnRails
[21:17:47] arup_r: has joined #RubyOnRails
[21:20:32] AndrewIsHere: has joined #RubyOnRails
[21:21:24] zacts: has joined #RubyOnRails
[21:21:35] jtong: has joined #RubyOnRails
[21:23:26] davidklsn: has joined #RubyOnRails
[21:24:03] whathappens: has joined #RubyOnRails
[21:24:48] Maletor: has joined #RubyOnRails
[21:26:20] arooni-mobile: has joined #RubyOnRails
[21:27:46] rikkipitt: has joined #RubyOnRails
[21:29:05] edwinvdgraaf: has joined #RubyOnRails
[21:29:13] rikkipitt: hey folks, what's a better way (compared to STI) to handle significantly different user types? i.e. using Devise for users but have a variation for photographers and engineers for example
[21:29:39] rikkipitt: so the User table doesn't et swamped with columns
[21:30:04] GodFather: has joined #RubyOnRails
[21:30:08] arup_r: do they have all attributes ? or different?
[21:30:17] arup_r: all same attributes**
[21:30:26] jhass: one alternative is externalize those into their own model
[21:30:40] jhass: User has_one :profile, polymorphic: true
[21:30:59] jhass: Photographer belongs_to :user, as: :profile
[21:31:11] jhass: Engineer belongs_to :user, as: :profile
[21:32:30] rikkipitt: hey, yeah they'll have the same login attributes, but they'll have different profile type columns
[21:33:13] rikkipitt: jhass: I was thnking about polymorphic, but then wouldn't the polymorphic table then get swamped?
[21:34:41] rikkipitt: jhass: wouldn't the profile model have all the attributes for all the model types?
[21:35:08] jhass: there's no Profile model
[21:35:48] rikkipitt: photographer model which is a polymorphic user via "profile"
[21:37:34] mustmodify: has joined #RubyOnRails
[21:37:45] mustmodify: has left #RubyOnRails: ()
[21:37:51] mustmodify: has joined #RubyOnRails
[21:38:03] rikkipitt: jhass: i get you, thanks for the pointer
[21:38:19] mustmodify: I've been using PUT so long I wanted to make sure this hasn't changed or I haven't remembered wrong... you can still POST to /resources/1 instead of using PUT, right?
[21:39:29] Sashimi: has joined #RubyOnRails
[21:41:02] arup_r: mustmodify: put/patch is used for update generally. if you have any line like `resources posts` in routes.rb file, then run like rake routes | grep posts and see how rails default convention is
[21:41:04] SteenJobs: has joined #RubyOnRails
[21:41:04] edwinvdg_: has joined #RubyOnRails
[21:41:44] arup_r: and that is the best way to know I use myself when I get confused. :)
[21:42:40] xlegoman: has joined #RubyOnRails
[21:42:56] mustmodify: I know it's generally used. I thought Rails would accept POST in a jam... and I have to pass either GET or POST to an API for a callback. I'll just test it.
[21:43:36] jtong_: has joined #RubyOnRails
[21:43:59] edwinvdgraaf: has joined #RubyOnRails
[21:46:25] Ebok: has joined #RubyOnRails
[21:48:36] Oliphaunte: has joined #RubyOnRails
[21:52:15] flashpoint9: has joined #RubyOnRails
[21:52:18] blackmesa: has joined #RubyOnRails
[21:58:11] Ebok: has joined #RubyOnRails
[22:05:39] davidklsn: has joined #RubyOnRails
[22:07:45] Mia: has joined #RubyOnRails
[22:07:51] workmad3: mustmodify: you can't just use a POST... but rails accepts a special `_method=put` (or whatever) parameter for POST requests that can override the http method
[22:08:30] workmad3: mustmodify: the default routes are set up so that `/foobar/1` would only accept GET, PUT/PATCH and DELETE though, so you couldn't use a POST without also providing that special param
[22:08:32] Scriptonaut: has left #RubyOnRails: ()
[22:11:01] barhum2013: has joined #RubyOnRails
[22:11:15] n90b0jjf: has joined #RubyOnRails
[22:12:26] SteenJobs: PSA: if resque isn’t working, try actually starting the workers. it’ll probably help.
[22:12:37] mustmodify: workmad3: blah, ok. Well I guess I can send _method in the URL. Or I could just set up a custom route.
[22:12:54] mustmodify: SteenJobs: This message brought to you by the letter R and the number 0. :P
[22:13:14] workmad3: SteenJobs: yeah, that is normally quite a useful step ;)
[22:13:34] jjwright: has joined #RubyOnRails
[22:13:53] SteenJobs: for the life of me i couldn’t figure out why in development it was working but in prod everything just got added to the delayed jobs list but never processed
[22:15:33] SteenJobs: dangerous to take things for granted, like running workers
[22:17:38] pawnbox: has joined #RubyOnRails
[22:19:40] qejk: has joined #RubyOnRails
[22:23:29] jenrzzz: has joined #RubyOnRails
[22:23:29] jenrzzz: has joined #RubyOnRails
[22:26:25] greghoggard: has joined #RubyOnRails
[22:30:24] n90b0jjf: has joined #RubyOnRails
[22:32:59] moeabdol: has joined #RubyOnRails
[22:33:52] djbkd: has joined #RubyOnRails
[22:34:54] AntiSpamMeta: has joined #RubyOnRails
[22:36:12] Axy: has joined #RubyOnRails
[22:36:40] rubyonrailed: has joined #RubyOnRails
[22:36:57] jjwright: has joined #RubyOnRails
[22:41:22] arBmind: has joined #RubyOnRails
[22:42:21] jtong: has joined #RubyOnRails
[22:42:52] barhum2013: has joined #RubyOnRails
[22:43:48] flashpoint9: has joined #RubyOnRails
[22:45:23] SteenJobs: has joined #RubyOnRails
[22:46:08] flashpoint9: has joined #RubyOnRails
[22:47:43] Polysics: has joined #RubyOnRails
[22:47:55] Polysics: hello! I managed to fix my earlier problem but now I have another :)
[22:48:21] Polysics: we have a gem that bundles some fonts. It is making request specs fail with a missing font, but the font IS there.
[22:48:58] rikkipitt: has joined #RubyOnRails
[22:49:35] Polysics: has anything changed regarding assets in Rails 5?
[22:54:45] matthewd: polysics: "anything" has changed regarding most things
[22:55:21] Polysics: I guess that is true, I am at loss for what the issue could be, though
[22:56:12] DoctorMonocular: has joined #RubyOnRails
[22:56:49] edwinvdg_: has joined #RubyOnRails
[22:58:54] kevr: has joined #RubyOnRails
[22:59:17] kevr: Hello. How can I setup a route based on the group? i.e. in the Gemfile i can obviously `group :development do ... end`
[22:59:38] Radar: kevr: if Rails.env.development?
[22:59:41] SteenJobs: kevr: you try if Rails.env.development?
[23:00:18] kevr: SteenJobs: indeed, thank you very much.
[23:00:30] SteenJobs: youre very welcome!
[23:01:59] kevr: > when i send :q, :w, and :wq everywhere because vim is ingrained in me. zzz
[23:02:39] rubyonrailed: has joined #RubyOnRails
[23:03:00] jenrzzz: has joined #RubyOnRails
[23:03:20] dalbuschat: has joined #RubyOnRails
[23:07:05] jfelchner: has joined #RubyOnRails
[23:07:21] jstransky: has joined #RubyOnRails
[23:09:36] yfeldblum: has joined #RubyOnRails
[23:09:39] dminuoso: has joined #RubyOnRails
[23:11:04] daffy_duck: has joined #RubyOnRails
[23:12:04] dvinciguerra: has joined #RubyOnRails
[23:12:56] SteenJobs: has joined #RubyOnRails
[23:13:09] greghoggard: has joined #RubyOnRails
[23:13:46] greghoggard: has left #RubyOnRails: ()
[23:13:59] Rodya_: has joined #RubyOnRails
[23:14:01] jtong: has joined #RubyOnRails
[23:19:48] Darmani: Radar: Hey I'm trying to account for the quantity of each shirt that might be ordered. Does this action look okay?
[23:19:49] Darmani: https://gist.github.com/mfifth/9cc8d01cc7babe3ee96acc68e73aa622#file-orders_controller-rb-L14
[23:20:24] zacts: has joined #RubyOnRails
[23:24:14] cnk: Darmani: I suspect @variant.quantity is not what you want on line 17
[23:24:36] AndrewIs_: has joined #RubyOnRails
[23:29:23] drale2k: has joined #RubyOnRails
[23:29:59] qejk: has joined #RubyOnRails
[23:30:04] Rodya_: has joined #RubyOnRails
[23:31:10] hck89: has joined #RubyOnRails
[23:31:24] Darmani: cnk: Apologies I stepped away from my computer for a moment.
[23:31:57] Darmani: Why do you say that?
[23:34:00] pvertenten: has joined #RubyOnRails
[23:38:01] cnk: it seems to me like quantity and stock should be on different objects
[23:38:13] cnk: isn't it order.quantity?
[23:38:52] cnk: is quantity really a field on your variant model?
[23:39:24] cnk: 'cause if Variant already knows it's out of stock, why was it shown to the user in the first place
[23:42:18] jstransky: has joined #RubyOnRails
[23:42:46] Darmani: cnk: Well I wasn't sure where to put the "stock" column...
[23:43:15] cnk: I think that one is OK
[23:43:16] Darmani: I figured having two different variables would just give it some clarity.
[23:43:42] cnk: what I am arguing about is you have 1 var @variant - with 2 attributes
[23:44:05] cnk: Please show your Variant and Order models
[23:45:13] Darmani: cnk: https://gist.github.com/mfifth/9cc8d01cc7babe3ee96acc68e73aa622
[23:46:19] cnk: ah right, rails
[23:46:31] cnk: I need to know what database columns variant has
[23:46:50] rubyonra_: has joined #RubyOnRails
[23:47:43] baash05: has joined #RubyOnRails
[23:47:51] baash05: Good morning all.
[23:48:25] Darmani: cnk: https://gist.github.com/mfifth/9cc8d01cc7babe3ee96acc68e73aa622
[23:48:30] Darmani: baash05: Hello ^.^
[23:48:50] ferr: has joined #RubyOnRails
[23:49:24] baash05: I am wondering if anyone is sending out push notifications to android phones..
[23:49:48] ferr: Hey, I've upgraded to rails 5, I have association has_many and belongs_to, however it seems I cannot create the Property record without providing Order record
[23:50:07] kevr: baash05: usually it's better to just ask your question and see if anybody knows
[23:50:21] cnk: Darmani: so what do quanity and stock on Varient mean?
[23:50:45] cnk: I get what stock might be - how many items are in stock. So what is quantity?
[23:51:08] Darmani: cnk: Well... It was supposed to be how many the customer had ordered.
[23:51:11] baash05: I am attempting to push notifications to android phones, however it is really slow because we are sending one notice per call to google.
[23:51:53] baash05: I am engaging the GCM gem..
[23:52:20] baash05: gcm = GCM.new(GCM_API_KEY)
[23:52:20] baash05: message_contents = { data: message_hash }
[23:52:21] baash05: response = gcm.send_notification([recipient_token], message_contents)
[23:52:23] cnk: that is not on Variant
[23:52:26] cnk: it is in order
[23:52:33] kevr: baash05: use a pastebin website, to show people your code
[23:52:51] kevr: baash05: that way your code pastes don't end up clobbering the channel, and it's in an organized place for people to view over time
[23:52:53] cnk: YOu do it right in your show action - and then wrong in add_shirt
[23:53:29] Darmani: cnk: Well... That's why I need some help ._.
[23:53:38] pur3eval: has joined #RubyOnRails
[23:53:52] baash05: The problem I see is I have k's of messages to send out.
[23:54:07] baash05: And it's slow as.
[23:54:45] baash05: I was wondering if anyone was sending out push notifications in bulk.
[23:55:41] flashpoint9: has joined #RubyOnRails
[23:56:43] ferr: https://gist.github.com/Fercell/2433058649cedd007cc36697b737974e why I cannot create a record without association?
[23:57:46] eljimmy: has joined #RubyOnRails