« Back to channel list

#RubyOnRails - 30 June 2017

« Back 1 day Forward 1 day »
[00:01:14] jhfisc: has joined #RubyOnRails
[00:01:20] xco: Radar: yes i did
[00:01:28] xco: looks like i have to lock it
[00:08:18] jhfisc: has joined #RubyOnRails
[00:09:09] xco: Radar: thanks, working.
[00:18:33] jhfisc: has joined #RubyOnRails
[00:19:36] Radar: xco: I think in 3.0.0 it moved to bootstrap/tooltip
[00:21:00] xco: Radar: i don’t get it. what’s bootstrap/tooltip here?
[00:21:10] Radar: Same as bootstrap-tooltip.
[00:22:09] Radar: https://gist.github.com/siaw23/28d3286815884c945f186956c7f03573#file-application-js-L22-L26
[00:22:17] Radar: It's likely that you'd have the same issues with your other bootstrap dependencies too.
[00:22:24] Radar: I think in v3 the naming scheme changed to bootstrap/dropdown
[00:22:45] Radar: amperry: thanks about the kind words this morning btw
[00:23:09] Radar: https://github.com/twbs/bootstrap-sass/blob/master/assets/javascripts/bootstrap/tooltip.js See here its location is bootstrap/tooltip.js
[00:23:50] Radar: But then in the last v2.3.2.2 release before 3.0, it was at bootstrap-tooltip.js.
[00:24:07] Radar: protip: major versions are most likely to introduce breaking changes
[00:28:53] ascarter: has joined #RubyOnRails
[00:46:07] umaaji: has joined #RubyOnRails
[00:56:36] tanuki: has joined #RubyOnRails
[00:58:03] jhfisc: has joined #RubyOnRails
[01:01:04] ResidentBiscuit: has joined #RubyOnRails
[01:05:11] jhfisc: has joined #RubyOnRails
[01:06:10] sevenseacat: has joined #RubyOnRails
[01:08:20] jhfisc: has joined #RubyOnRails
[01:14:40] jhfisc: has joined #RubyOnRails
[01:17:40] jhfisc: has joined #RubyOnRails
[01:19:15] Jameser: has joined #RubyOnRails
[01:21:16] jphase: has joined #RubyOnRails
[01:23:40] jhfisc: has joined #RubyOnRails
[01:31:34] jhfisc: has joined #RubyOnRails
[01:33:36] zacts|pi: has joined #RubyOnRails
[01:35:50] jottr: has joined #RubyOnRails
[01:36:12] ascarter: has joined #RubyOnRails
[01:37:41] jhfisc: has joined #RubyOnRails
[01:38:15] Fenhl: has joined #RubyOnRails
[01:39:50] fschuindt: has joined #RubyOnRails
[01:40:37] jhfisc: has joined #RubyOnRails
[01:46:38] irishfromua: has joined #RubyOnRails
[01:48:49] jhfisc: has joined #RubyOnRails
[01:50:53] quirkycoders: has joined #RubyOnRails
[01:54:05] jhfisc: has joined #RubyOnRails
[02:04:14] jhfisc: has joined #RubyOnRails
[02:09:30] rafaeldelucena: has joined #RubyOnRails
[02:10:45] xall: has joined #RubyOnRails
[02:13:26] jhfisc: has joined #RubyOnRails
[02:13:52] MrCrackPotBuilde: has joined #RubyOnRails
[02:19:42] jhfisc: has joined #RubyOnRails
[02:23:49] Rodya_: has joined #RubyOnRails
[02:25:41] jhfisc: has joined #RubyOnRails
[02:31:40] jhfisc: has joined #RubyOnRails
[02:31:41] andrevan: has joined #RubyOnRails
[02:36:48] zacts: has joined #RubyOnRails
[02:40:28] ascarter: has joined #RubyOnRails
[02:41:50] jottr: has joined #RubyOnRails
[02:48:00] jhfisc: has joined #RubyOnRails
[02:53:01] jhfisc: has joined #RubyOnRails
[02:56:53] quazimodo: has joined #RubyOnRails
[02:58:54] jhfisc: has joined #RubyOnRails
[03:04:48] jhfisc: has joined #RubyOnRails
[03:06:43] ruby635: has joined #RubyOnRails
[03:06:52] ruby635: hey hey all
[03:08:51] ruby635: Anyone know how to remove characters in a view
[03:09:05] ruby635: from a variable in a controller?
[03:10:32] fryguy: ruby635: be more specific
[03:10:55] ruby635: ill show you my code
[03:11:04] ruby635: This is the controller code
[03:11:07] ruby635: @categories = Problem.select(:category).distinct @performance = {} @categories.each do |c| @performance[c.category] = {total: Problem.where(category: c.category).count, correct: 0} end @user.submissions.where(correct: TRUE).each do |s|
[03:11:25] fryguy: please use a pastebin, that's basically unreadable
[03:11:44] Jameser: has joined #RubyOnRails
[03:13:18] ruby635: https://pastebin.com/SWACKCCD
[03:13:32] jhfisc: has joined #RubyOnRails
[03:13:51] ruby635: How would i go about removing the {} from the output?
[03:14:47] fryguy: oh wow there's so much done that I wouldn't do there i don't even know where to start
[03:16:42] fryguy: what do you actually want the output to look like
[03:17:47] ruby635: one sec ill make a new paste of the desired output
[03:19:40] jhfisc: has joined #RubyOnRails
[03:19:42] ruby635: Ideally i would like each of the categories to look like this "Recon" total: 1, correct: 0
[03:20:46] ruby635: however if i could get it to look like this "Exploitation"=>total=>2, correct=>0, "Windows Basics"=> total=>10, correct=>1
[03:20:52] ruby635: i would be fine witht hat as well
[03:22:48] quazimodo: has joined #RubyOnRails
[03:28:24] fryguy: don't really know your schema, so i'm guessing a bit, there's ways to make this substantially faster, but this might work: https://pastebin.com/q1Lx2GS6
[03:28:29] fnodeuser: has left #RubyOnRails: ()
[03:29:10] ruby635: ill give that a shot
[03:31:51] jhfisc: has joined #RubyOnRails
[03:35:00] Technodrome: has joined #RubyOnRails
[03:39:01] quirkycoders: has joined #RubyOnRails
[03:39:20] jhfisc: has joined #RubyOnRails
[03:40:42] segy: has joined #RubyOnRails
[03:42:21] jhfisc: has joined #RubyOnRails
[03:42:52] jottr: has joined #RubyOnRails
[03:43:26] ascarter: has joined #RubyOnRails
[03:47:48] Dreamer3: has joined #RubyOnRails
[03:55:39] planigan: has joined #RubyOnRails
[03:55:56] ephemer0l_: has joined #RubyOnRails
[04:01:12] Rodya_: has joined #RubyOnRails
[04:19:04] Rodya_: has joined #RubyOnRails
[04:27:49] ur5us: has joined #RubyOnRails
[04:29:42] timdotrb: has joined #RubyOnRails
[04:30:32] timdotrb: has joined #RubyOnRails
[04:30:57] quazimodo: has joined #RubyOnRails
[04:31:17] timdotrb: has joined #RubyOnRails
[04:32:08] timdotrb: has joined #RubyOnRails
[04:32:53] timdotrb: has joined #RubyOnRails
[04:40:55] agent_white: has joined #RubyOnRails
[04:41:28] xall: has joined #RubyOnRails
[04:41:43] jhfisc: has joined #RubyOnRails
[04:43:35] jottr: has joined #RubyOnRails
[04:46:26] jhfisc: has joined #RubyOnRails
[04:47:03] ascarter: has joined #RubyOnRails
[04:54:51] guardianxx: has joined #RubyOnRails
[05:07:44] jhfisc: has joined #RubyOnRails
[05:08:59] armyriad: has joined #RubyOnRails
[05:12:21] jhfisc: has joined #RubyOnRails
[05:28:46] FastJack: has joined #RubyOnRails
[05:31:57] conta: has joined #RubyOnRails
[05:33:43] wethu: has joined #RubyOnRails
[05:39:40] jhfisc: has joined #RubyOnRails
[05:44:21] jottr: has joined #RubyOnRails
[05:51:13] ascarter: has joined #RubyOnRails
[05:51:40] jhfisc: has joined #RubyOnRails
[06:07:54] jhfisc: has joined #RubyOnRails
[06:20:20] p8m: has joined #RubyOnRails
[06:21:35] jhfisc: has joined #RubyOnRails
[06:22:03] loglaunch: has joined #RubyOnRails
[06:24:02] timdotrb: has joined #RubyOnRails
[06:25:48] Rodya__: has joined #RubyOnRails
[06:27:50] conta: has joined #RubyOnRails
[06:29:40] jhfisc: has joined #RubyOnRails
[06:35:14] codezomb: has joined #RubyOnRails
[06:35:40] jhfisc: has joined #RubyOnRails
[06:38:03] rgr: has joined #RubyOnRails
[06:39:42] marr: has joined #RubyOnRails
[06:45:06] jottr: has joined #RubyOnRails
[06:51:06] dionysus69: has joined #RubyOnRails
[06:51:30] xall: has joined #RubyOnRails
[06:51:39] jhfisc: has joined #RubyOnRails
[06:53:25] ascarter: has joined #RubyOnRails
[07:00:27] jhfisc: has joined #RubyOnRails
[07:04:14] pwnd_nsfw: has joined #RubyOnRails
[07:04:16] pwnd_nsfw: registered_admin_users GET /admin/users/registered(.:format) admin/users#registered
[07:04:23] pwnd_nsfw: if I want that to say admin_registered_users
[07:05:06] kies: has joined #RubyOnRails
[07:05:39] jhfisc: has joined #RubyOnRails
[07:05:46] guardianx: has joined #RubyOnRails
[07:06:02] pwnd_nsfw: https://gist.github.com/SirUncleCid/73df78c6da989a6e5d67827992ef338a
[07:09:23] dminuoso: pwnd_nsfw: I dont think that is possible.
[07:09:45] pwnd_nsfw: it's weird that it'd put the specified (as: :butts) in front
[07:10:11] pwnd_nsfw: and makes my code give a different idea than what it actually represents
[07:10:46] alexday: has joined #RubyOnRails
[07:11:35] jhfisc: has joined #RubyOnRails
[07:12:41] alexday: hello. I had a sidekiq question. in the sidekiq redis. I have some dead jobs. I can see them in the ui in <ip>:9494/morgue. but when I do zcount dead 0 -1. it shows integer count 0. where to check for a dead job in a paricular queue and chech the contents!!
[07:15:43] jhfisc: has joined #RubyOnRails
[07:17:40] quazimodo: has joined #RubyOnRails
[07:18:21] DoubleMalt: has joined #RubyOnRails
[07:20:45] jhfisc: has joined #RubyOnRails
[07:21:24] agent_white: has joined #RubyOnRails
[07:26:25] tanuki: has joined #RubyOnRails
[07:27:19] Rodya_: has joined #RubyOnRails
[07:29:45] guardianx: has joined #RubyOnRails
[07:33:40] patarr: has joined #RubyOnRails
[07:33:54] jhfisc: has joined #RubyOnRails
[07:36:48] alexday: also https://github.com/mperham/sidekiq/blob/b38bb6f676e8cf43925cbd6061e3b7699c490a3b/lib/sidekiq/processor.rb#L151 what is work.job
[07:40:01] arBmind: has joined #RubyOnRails
[07:45:52] jottr: has joined #RubyOnRails
[07:46:00] DrYockel: has joined #RubyOnRails
[07:49:39] jhfisc: has joined #RubyOnRails
[07:50:55] quirkycoders: has joined #RubyOnRails
[07:56:23] ascarter: has joined #RubyOnRails
[08:02:09] jhfisc: has joined #RubyOnRails
[08:04:36] cseder: has joined #RubyOnRails
[08:07:30] mikecmpbll: has joined #RubyOnRails
[08:09:13] cseder: has joined #RubyOnRails
[08:12:07] xibalba: has joined #RubyOnRails
[08:17:11] shotbug: has joined #RubyOnRails
[08:18:20] jhfisc: has joined #RubyOnRails
[08:20:29] shotbug: has joined #RubyOnRails
[08:22:56] timdotrb: has joined #RubyOnRails
[08:23:02] timdotrb: Evening, all
[08:24:20] jhfisc: has joined #RubyOnRails
[08:27:40] tanuki: has joined #RubyOnRails
[08:29:25] Rodya_: has joined #RubyOnRails
[08:29:40] jhfisc: has joined #RubyOnRails
[08:32:30] jhfisc: has joined #RubyOnRails
[08:34:59] rietta_: has joined #RubyOnRails
[08:35:54] dionysus69: how do whitelist hash inside hash? .permit(:operation_code, date: { :year }) is not a correct syntax. .permit(:operation_code, date: Hash) successfully whitelists date hash but not nested params inside it. :s
[08:38:50] jhfisc: has joined #RubyOnRails
[08:39:23] dionysus69: ok I figured out the mistake :)))
[08:40:37] sevenseacat: glad we could help
[08:41:02] ferr: has joined #RubyOnRails
[08:44:37] dionysus69: xD haven't dealt with params, forgot they involve [] not {} :)
[08:44:50] dionysus69: dealth with params in a while*
[08:46:59] jottr: has joined #RubyOnRails
[08:47:31] lxsameer: has joined #RubyOnRails
[08:49:43] jhfisc: has joined #RubyOnRails
[08:54:21] xall_: has joined #RubyOnRails
[08:55:40] jhfisc: has joined #RubyOnRails
[08:59:51] lxsameer: has joined #RubyOnRails
[09:03:57] brent__: has joined #RubyOnRails
[09:07:26] srinidhi: has joined #RubyOnRails
[09:16:39] p8m: has joined #RubyOnRails
[09:22:36] umaaji: has joined #RubyOnRails
[09:27:21] jhfisc: has joined #RubyOnRails
[09:30:09] Rodya_: has joined #RubyOnRails
[09:33:35] jhfisc: has joined #RubyOnRails
[09:34:44] patarr: has joined #RubyOnRails
[09:36:08] timdotrb_: has joined #RubyOnRails
[09:39:33] jhfisc: has joined #RubyOnRails
[09:45:28] arup_r: has joined #RubyOnRails
[09:45:40] jhfisc: has joined #RubyOnRails
[09:47:44] jottr: has joined #RubyOnRails
[09:51:02] arBmind: has joined #RubyOnRails
[09:54:06] Fernando-Basso: has joined #RubyOnRails
[09:54:14] jhfisc: has joined #RubyOnRails
[09:54:39] ElektroBug: has joined #RubyOnRails
[09:56:36] marr: has joined #RubyOnRails
[09:57:51] tofutoon: has joined #RubyOnRails
[09:59:44] jhfisc: has joined #RubyOnRails
[10:00:49] tofutoon: Is there any way to prevent form_with from submitting as an AJAX request? The rails guide says to set :local. I tried setting :'data-remote' => 'false' and a few other variants. However, the 'X-Requested-With' header keeps getting set to 'XMLHttpRequest'.
[10:00:57] tofutoon: Any way to prevent that?
[10:05:18] ascarter: has joined #RubyOnRails
[10:07:37] cseder: has joined #RubyOnRails
[10:12:04] jhfisc: has joined #RubyOnRails
[10:14:04] ElektroBug: the paperclip is not adding name to the db of the image being uploaded conteroller:https://gist.github.com/456fe4efeac757e8a1b49cc49ae88b2f Model: https://gist.github.com/a604db8b1ef6775eff8e6f756de3d8bf
[10:15:39] ElektroBug: how to make it save all fields if possible to db
[10:20:48] tbuehlmann: tofutoon: add an `local: true` option to the form_with call
[10:23:11] sevenseacat: wow, ajax is the default now? thats messed up
[10:23:34] jhfisc: has joined #RubyOnRails
[10:26:30] tbuehlmann: remote forms are the default now, yes. the remote option is disabled when upgrading the app, though. iirc, forms generated using a generator have the local: true option set
[10:30:50] Rodya_: has joined #RubyOnRails
[10:39:57] ElektroBug: the paperclip is not adding name to the db of the image being uploaded conteroller:https://gist.github.com/456fe4efeac757e8a1b49cc49ae88b2f Model: https://gist.github.com/a604db8b1ef6775eff8e6f756de3d8bf
[10:40:02] ElektroBug: how to make it save all fields if possible to db
[10:40:15] shotbug: has joined #RubyOnRails
[10:41:35] Fernando-Basso: has joined #RubyOnRails
[10:47:28] patarr: has joined #RubyOnRails
[10:47:42] shotbug: has joined #RubyOnRails
[10:48:29] jottr: has joined #RubyOnRails
[10:49:54] dionysus69: rubocop tells me not to use Date.today instead to use Time.zone.now. should I ignore it or whats the difference other then date getting system time and time getting application time?
[10:54:26] tbuehlmann: dionysus69: that's the exact problem
[10:54:57] dionysus69: and why is application time better?
[10:55:06] dionysus69: I thought app time depends on system time anyways
[10:55:18] jhfisc: has joined #RubyOnRails
[10:58:18] tbuehlmann: you setup a timezone for your app and maybe change it depending on the user, so you can present the correct times
[10:58:40] tbuehlmann: why would a user care for the timezone the server running the application is located at?
[11:00:28] jhfisc: has joined #RubyOnRails
[11:03:15] jhfisc: has joined #RubyOnRails
[11:08:21] roshanavand: has joined #RubyOnRails
[11:09:19] ascarter: has joined #RubyOnRails
[11:13:37] jhfisc: has joined #RubyOnRails
[11:15:40] DoubleMalt: has joined #RubyOnRails
[11:23:23] jhfisc: has joined #RubyOnRails
[11:31:37] Rodya_: has joined #RubyOnRails
[11:35:51] ule: has joined #RubyOnRails
[11:36:55] ElektroBug: has joined #RubyOnRails
[11:37:00] ElektroBug: i have paperclip and paperclip-meta tags the image models database,i want the name field to be updated with the name of the file being uploaded.
[11:37:04] ElektroBug: How can I achieve it?
[11:37:16] ElektroBug: the paperclip is not adding name to the db of the image being uploaded conteroller:https://gist.github.com/456fe4efeac757e8a1b49cc49ae88b2f Model: https://gist.github.com/a604db8b1ef6775eff8e6f756de3d8bf
[11:39:45] DrYockel: has joined #RubyOnRails
[11:47:44] jhfisc: has joined #RubyOnRails
[11:49:14] jottr: has joined #RubyOnRails
[11:54:43] dionysus69: tbuehlmann: i guess :D never had dealt with that scenario :)
[11:55:32] jhfisc: has joined #RubyOnRails
[12:02:35] jottr: has joined #RubyOnRails
[12:10:15] jarr0dsz: has joined #RubyOnRails
[12:10:26] jarr0dsz: hi everyone, is is possible to store a model + association into an array?
[12:10:37] jarr0dsz: for example im doing @organisations.push(organisation)
[12:11:06] jarr0dsz: but organisation has also an organisation.organisation_profile, i would like to push it in an array so im able to retrieve the organisation profile and the organisation itself in a convient way
[12:11:16] jarr0dsz: just like regular AR organisation.organisation_profile.name for example
[12:11:53] tbuehlmann: jarr0dsz: what's wrong with organisation and organisation.organisation_profile?
[12:12:18] jarr0dsz: @organisations.push(organisation) only pushes the organisation model data to the array not the associated organisation_profile TheMoonMaster
[12:12:28] jarr0dsz: * tbuehlmann
[12:13:44] tbuehlmann: because it's accessible through the organisation object
[12:13:48] ascarter: has joined #RubyOnRails
[12:14:09] tbuehlmann: example: @organisations[0] is the organisation, @organisations[0].organisation_profile is the profile
[12:15:32] ule: What's the official Rails recommendation regarding folder structures for non ActiveRecord Model classes? (PORO) /lib? /app/models/concerns?
[12:16:30] tbuehlmann: ule: app/models
[12:16:40] ule: tbuehlmann: that's bullshit
[12:16:58] ule: tbuehlmann: mixing active models with non classes
[12:17:26] ule: I don't understand why mixing tons of classes at the same folder is a good thing
[12:17:32] sevenseacat: models are models, whether they're active record models or not
[12:17:37] tbuehlmann: so a model doesn't belong in the models folder?
[12:17:46] jarr0dsz: tbuehlmann im building the @organisations indeed what you say work right after the variable is set, but when rendering a collection it does not work
[12:17:56] ule: I'm not talking abot Model classes.. I'm talking about PORO
[12:18:01] ule: Pure Old Ruby Objects
[12:18:11] jarr0dsz: so when inside the _organisation.haml partial i do not have an organisation.organisation_profile i only have an organisation
[12:18:13] sevenseacat: "for non ActiveRecord Model classes"
[12:18:14] ule: Let's say I want to extract some logic from models to specific classes
[12:18:17] sevenseacat: models go in the models folder.
[12:18:44] ule: Authentication methods for something like Authentication.rb
[12:18:56] ule: and then I can include it on my model class
[12:19:05] ule: Keeping everything clean and more organized
[12:19:18] ule: I'm not sure if that's the idea behind app/models/concerns folder
[12:19:35] sevenseacat: love when people ask for recommendations then call bullshit 5 seconds later
[12:20:04] ule: lol I'm being honest. This is comming from someone with experience on PHP/Java frameworks
[12:20:20] sevenseacat: good for you.
[12:20:42] ule: Smart is saying that your system with 100 classes should be all at the same folder
[12:20:44] sevenseacat: Rails isn't a PHP/Java framework.
[12:20:46] ule: being activemodels or not
[12:20:52] sevenseacat: no, your models all go in the models folder.
[12:20:58] sevenseacat: not 100 classes. models.
[12:21:33] tbuehlmann: well, I can just repeat myself: models belong to the app/models folder. if they are domain independent, then I'd put them into lib or better write a gem
[12:21:35] conta: has joined #RubyOnRails
[12:21:35] sevenseacat: Authentication most likely is not a model.
[12:22:09] ule: sevenseacat: so, now you're getting what I'm asking for.. where do I put something like authentication?
[12:22:20] tbuehlmann: if you want "cleaner" models, as in less lines but more includes, then the concerns might fit your need
[12:23:18] Tempesta: has joined #RubyOnRails
[12:23:56] ule: there we go
[12:24:34] tbuehlmann: have an example: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/models/concerns
[12:25:30] jhfisc: has joined #RubyOnRails
[12:25:32] tbuehlmann: I personally would use concerns if I have a constant that's used in several other files. if it's only used by one class, put it in the class
[12:25:38] ule: that's great tbuehlmann
[12:26:03] ule: having the opportunity to see what people are doing in big projects it's great
[12:26:30] tbuehlmann: when you want to structure code in a single class, http://api.rubyonrails.org/classes/Module/Concerning.html#method-i-concerning might help, too
[12:26:39] ule: tbuehlmann: when you say put it in the class you're saying keeping it inside the model?
[12:28:19] tbuehlmann: if the model feels not to be the right place, it might be a service, or a decorator, or some other thing
[12:29:00] ule: tbuehlmann: My only concern is actually not having classes with 500 lines
[12:29:29] ule: segmenting into multiple classes assuring the single responsability principle
[12:30:42] AzaToth: has joined #RubyOnRails
[12:32:18] xhoy: why does validates: :field, numericality: { only_integer: true }, :allow_nil => true
[12:32:32] xhoy: accept " 123123" as valid and even stores it?
[12:33:44] sevenseacat: 123123 is a valid integer.
[12:34:11] ule: lovely ruby
[12:34:30] ule: xhoy: you can use before_save :your_method_trimming_speces
[12:34:40] ule: and then define your method cleaning it before save
[12:34:46] ule: or before validate as well
[12:35:54] jhfisc: has joined #RubyOnRails
[12:37:31] xhoy: ok does sound a bit weird :P
[12:37:52] xhoy: so you just write a regex for this :)
[12:38:16] tbuehlmann: xhoy: I don't see a problem here, do you?
[12:39:15] xhoy: tbuehlmann: its unexpected :)
[12:40:10] tbuehlmann: I just asked a non-tech coworker what number " 123123" would be
[12:40:34] xhoy: but i would think " only integer" would fix that part
[12:40:51] xhoy: if it would only be numerical *maybe*
[12:41:08] xhoy: since <space> is defently not an int :)
[12:41:10] xhoy: buuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuut
[12:41:14] xhoy: tbuehlmann: i do understand your point :)
[12:43:39] tbuehlmann: yeah, I wouldn't care too much about it ¯\_(ツ)_/¯
[12:44:48] quirkycoders: has joined #RubyOnRails
[12:47:36] conta: has joined #RubyOnRails
[12:47:39] quirkycoders: has joined #RubyOnRails
[12:49:40] jhfisc: has joined #RubyOnRails
[12:49:50] cseder: has joined #RubyOnRails
[12:55:44] jhfisc: has joined #RubyOnRails
[12:58:34] brent__: has joined #RubyOnRails
[13:05:14] ekinmur: has joined #RubyOnRails
[13:05:14] jottr: has joined #RubyOnRails
[13:05:22] dblessing: has joined #RubyOnRails
[13:05:35] my123_: has joined #RubyOnRails
[13:15:46] ascarter: has joined #RubyOnRails
[13:20:05] NL3limin4t0r: has joined #RubyOnRails
[13:24:03] jhfisc: has joined #RubyOnRails
[13:25:37] chouhoulis: has joined #RubyOnRails
[13:29:58] jhfisc: has joined #RubyOnRails
[13:33:16] chouhoulis: has joined #RubyOnRails
[13:33:57] delgiudices: has joined #RubyOnRails
[13:34:04] dionysus69: is there a way to further optmize this ?
[13:34:04] dionysus69: temp = ClassName.find_or_create_by(params_hash)
[13:34:04] dionysus69: temp.update_attributes(params_hash)
[13:54:53] truenito: has joined #RubyOnRails
[13:56:58] jscheel: has joined #RubyOnRails
[13:57:57] DoubleMalt: has joined #RubyOnRails
[13:59:09] quirkycoders: has joined #RubyOnRails
[14:00:41] NL3limin4t0r: @dionysus69 - Optimization would be to remove the second line `temp.update_attributes(params_hash)`.
[14:02:28] dionysus69: NL3limin4t0r: why? does find_or_create_by handle updates too?
[14:02:31] NL3limin4t0r: @dionysus69 - If `ClassName.find_or_create_by(params_hash)` matches an exsisting record, there is no need to update the attributes (since it already matched). If no match is found, the object will be created with `params_hash`, thus the second line is not needed.
[14:02:32] dionysus69: what if data changes?
[14:03:10] dionysus69: but the object wont be created anew if just one param changes right?
[14:04:37] NL3limin4t0r: I'll have to check, but if you throw all params in create_or_update, it will search for a match that has all attributes. If one attribute changes it will not find the record.
[14:05:01] jscheel: has joined #RubyOnRails
[14:05:13] dionysus69: ok then I guess I ll have to find_or_create_by based on PK and then update
[14:06:19] jottr: has joined #RubyOnRails
[14:07:34] NL3limin4t0r: Just checked with a dummy server, just as I thought it'll only match the record if the whole `params_hash` matches, otherwise it will create a new record.
[14:07:57] NL3limin4t0r: (with the given `params_hash`)
[14:09:36] NL3limin4t0r: I've a question myself too. I'm finding myself writing ugly code for nested controllers with a polymorphic relation. Check out my gist: https://gist.github.com/3limin4t0r/e235dc54c1bccaf5e84a7537e0a506cd
[14:10:07] stalk3r: has joined #RubyOnRails
[14:11:36] stalk3r: hello there, I'm having troubles with foundation accordion menus! On the first page load, the menu work as intended but as soon as I click on an item and go to another page, the whole menu is collapsed. Anyone have any insight?
[14:11:45] NL3limin4t0r: Is there a clean way to find out what type of instance to fetch (question marked in the gist)?
[14:14:06] Chernobuk: has joined #RubyOnRails
[14:15:53] dblessing: has joined #RubyOnRails
[14:16:33] NL3limin4t0r: oops, I'm missing my slashes xD
[14:17:04] dionysus69: NL3limin4t0r: thanks, will fix it later. off now :)
[14:18:27] Rodya_: has joined #RubyOnRails
[14:18:36] Technodrome: has joined #RubyOnRails
[14:19:01] ascarter: has joined #RubyOnRails
[14:19:03] tofutoon: tbuehlmann: I tried setting `local: true` in my form. After doing this, the forms don't submit when I hit the Save/Submit button. However, they submit just fine without the `local: true` option. Any idea what causes this?
[14:20:27] tofutoon: tbuehlmann: This is in response to your suggestion about 3.5 hours ago, "add an `local: true` option to the form_with call".
[14:21:20] tofutoon: tbuehlmann: My original question was: Is there any way to prevent form_with from submitting as an AJAX request? The rails guide says to set :local. I tried setting :'data-remote' => 'false' and a few other variants. However, the 'X-Requested-With' header keeps getting set to 'XMLHttpRequest'.
[14:21:41] theunraveler: has joined #RubyOnRails
[14:21:51] jottr: has joined #RubyOnRails
[14:22:54] ekinmur: has joined #RubyOnRails
[14:25:13] ResidentBiscuit: has joined #RubyOnRails
[14:30:22] jarr0dsz: hi everyone how could i use an index value inside an array? like. @user[index] instead of @user[0]
[14:30:46] jarr0dsz: cannot figure this out could not be really hard? the index is already an integer but not sure why i cannot just use it like that, does it need to be in another format?
[14:32:26] cpruitt: has joined #RubyOnRails
[14:38:03] Takumo: jarr0dsz: depends on what `@user` is, what does `@user.class.name` say?
[14:38:22] Technodrome: has joined #RubyOnRails
[14:39:49] arup_r: has joined #RubyOnRails
[14:41:13] endemic: has joined #RubyOnRails
[14:43:04] cseder: has joined #RubyOnRails
[14:45:01] cpruitt: has joined #RubyOnRails
[14:52:00] Takumo: Hi All, I'm trying to customize some behaviour in Devise (specifically Devise::RegistrationsController#create) but it appears super do |resource| only calls the block on success, and when there's a validation error none of my own code gets called, which means things don't work
[15:03:40] patarr: has joined #RubyOnRails
[15:19:52] jhfisc: has joined #RubyOnRails
[15:23:32] ascarter: has joined #RubyOnRails
[15:23:45] patarr: has joined #RubyOnRails
[15:24:37] jottr: has joined #RubyOnRails
[15:26:51] jaegerca: has joined #RubyOnRails
[15:27:38] jaegerca: Does anyone know if there are some current ical/ics gems out there? Seems like the community goes with icalendar but that thing seems fairly dead, 3 years work on an unreleased 2.0 version.
[15:30:39] jhfisc: has joined #RubyOnRails
[15:32:02] jaegerca: Oh I am wrong nevermind
[15:37:48] dblessing: has joined #RubyOnRails
[15:39:54] tbuehlmann: tofutoon: hm, pretty sure local: true should work :\
[15:40:42] arup_r: has joined #RubyOnRails
[15:43:00] arup_r: Hi I installed node using nvm. But seems like uglifier looking for nodejs, not node. How can I solve it? https://gist.github.com/aruprakshit/ec2dd80d42a32fae895316571ac8b86a
[15:44:01] patarr: has joined #RubyOnRails
[15:46:26] jhfisc: has joined #RubyOnRails
[15:46:53] tofutoon: tbuehlmann: Thanks. The problem is likely elsewhere in my code. Let me isolate the problem further.
[15:47:44] brent__: has joined #RubyOnRails
[15:48:27] tbuehlmann: tofutoon: you could try setting Rails.application.config.action_view.form_with_generates_remote_forms = false in an initializer
[15:48:35] brent__: has joined #RubyOnRails
[15:51:52] quazimodo: has joined #RubyOnRails
[15:53:45] conta: has joined #RubyOnRails
[15:55:52] tanuki: has joined #RubyOnRails
[15:58:30] delgiudices: has joined #RubyOnRails
[16:01:49] jhfisc: has joined #RubyOnRails
[16:06:13] patarr: has joined #RubyOnRails
[16:12:16] planigan: has joined #RubyOnRails
[16:14:04] pwnd_nsfw: has joined #RubyOnRails
[16:17:08] zacts: has joined #RubyOnRails
[16:23:39] weaksauce: has joined #RubyOnRails
[16:26:32] ascarter: has joined #RubyOnRails
[16:26:39] patarr: has joined #RubyOnRails
[16:29:17] gusrub: has joined #RubyOnRails
[16:30:55] pwnd_nsfw: https://gist.github.com/SirUncleCid/f8cf025a225126fc22763f6e4cb270a8
[16:31:14] pwnd_nsfw: I'm wondering how I can remove all of the breadcrumb calls into another file
[16:31:34] pwnd_nsfw: I'm pretty sure I could move it into a module, import the module
[16:31:50] pwnd_nsfw: But I'd like to not have to write any code past importing the module, which I'm pretty sure is doable?
[16:32:11] delgiudices: has joined #RubyOnRails
[16:32:13] pwnd_nsfw: I'd google it, but I'm unsure of the terminology
[16:34:45] pLaTo0n: has joined #RubyOnRails
[16:34:53] delgiudices: has joined #RubyOnRails
[16:35:40] jhfisc: has joined #RubyOnRails
[16:41:31] jhfisc: has joined #RubyOnRails
[16:44:48] quirkycoders: has joined #RubyOnRails
[16:47:11] patarr: has joined #RubyOnRails
[16:50:34] HoierM: has joined #RubyOnRails
[16:52:28] [Butch]: has joined #RubyOnRails
[16:56:24] jhfisc: has joined #RubyOnRails
[17:00:29] zacts: has joined #RubyOnRails
[17:01:40] jhfisc: has joined #RubyOnRails
[17:07:36] patarr: has joined #RubyOnRails
[17:09:16] SteenJobs_: has joined #RubyOnRails
[17:13:26] jhfisc: has joined #RubyOnRails
[17:14:49] alexday: has left #RubyOnRails: ("WeeChat 1.8")
[17:16:14] stalk3r: hello there, I'm having troubles with foundation accordion menus! On the first page load, the menu work as intended but as soon as I click on an item and go to another page, the whole menu is collapsed. Anyone have any insight?
[17:22:08] jottr: has joined #RubyOnRails
[17:22:28] jhfisc: has joined #RubyOnRails
[17:23:34] SteenJobs: has joined #RubyOnRails
[17:25:30] jhfisc: has joined #RubyOnRails
[17:28:04] patarr: has joined #RubyOnRails
[17:28:22] irishfromua: has joined #RubyOnRails
[17:29:05] tbuehlmann: stalk3r: do you use turbolinks?
[17:30:37] pLaTo0n: has joined #RubyOnRails
[17:30:47] ascarter: has joined #RubyOnRails
[17:30:58] stalk3r: tbuehlmann, yes I do
[17:31:07] tbuehlmann: can you disable it and check again?
[17:31:17] stalk3r: I'll check it out
[17:31:18] pLaTo0n: has joined #RubyOnRails
[17:34:01] jaegerca: has joined #RubyOnRails
[17:34:04] jaegerca: Anyone have some solid strategies for loading certain rake tasks only when the environment is test?
[17:34:17] stalk3r: tbuehlmann, yes it does work
[17:34:32] stalk3r: tbuehlmann, do you know any solution to use both?
[17:34:53] stalk3r: I mean, to still be able to use turbolinks
[17:34:54] tbuehlmann: then there are probably some callbacks bound to wrong events
[17:35:31] tbuehlmann: you can try this: https://github.com/kossnocorp/jquery.turbolinks
[17:36:13] stalk3r: tbuehlmann, lovely, I'll check it out, thanks a bunch
[17:36:37] FastJack: has joined #RubyOnRails
[17:41:50] jhfisc: has joined #RubyOnRails
[17:46:45] stalk3r: tbuehlmann, it doesn't really fix the problem. When I activate turbolinks once more, the same behavior comes back, even after the installation of jquery.turbolinks
[17:46:51] alexday: has joined #RubyOnRails
[17:47:12] kies: has joined #RubyOnRails
[17:47:55] tbuehlmann: and you require jquery.turbolinks before turbolinks?
[17:48:15] stalk3r: yes, in the same way they indicate
[17:48:32] patarr: has joined #RubyOnRails
[17:50:33] tbuehlmann: I guess you have to check the events yourself then
[17:51:29] stalk3r: all right, I'll see if I can figure it out, thanks anyway
[17:53:50] jhfisc: has joined #RubyOnRails
[17:54:32] xiljin: has joined #RubyOnRails
[17:56:31] jhfisc: has joined #RubyOnRails
[17:59:04] delgiudices: has joined #RubyOnRails
[18:02:22] jhfisc: has joined #RubyOnRails
[18:05:20] gusrub: has joined #RubyOnRails
[18:08:16] jhfisc: has joined #RubyOnRails
[18:08:58] patarr: has joined #RubyOnRails
[18:27:11] jhfisc: has joined #RubyOnRails
[18:29:25] patarr: has joined #RubyOnRails
[18:29:55] Aherin: has joined #RubyOnRails
[18:32:23] tofutoon: tbuehlmann: The local: true works fine. The problem was another bug in my code. Thanks for your help.
[18:32:27] jhfisc: has joined #RubyOnRails
[18:32:38] tbuehlmann: ah, welcome!
[18:32:47] alexday: has left #RubyOnRails: ("WeeChat 1.8")
[18:34:26] ascarter: has joined #RubyOnRails
[18:38:21] alexday: has joined #RubyOnRails
[18:38:50] jhfisc: has joined #RubyOnRails
[18:39:13] alexday: has left #RubyOnRails: ("WeeChat 1.8")
[18:44:23] tycoon177: has left #RubyOnRails: ()
[18:45:42] patarr: has joined #RubyOnRails
[18:48:12] alexday: has joined #RubyOnRails
[18:50:47] mikecmpbll: has joined #RubyOnRails
[18:57:18] cseder: anybody else having trouble installing the pg gem on the latest os x?
[19:00:35] patarr: has joined #RubyOnRails
[19:02:52] knight33: has joined #RubyOnRails
[19:04:50] Rodya_: has joined #RubyOnRails
[19:11:55] alexday: has left #RubyOnRails: ("WeeChat 1.8")
[19:13:53] jhfisc: has joined #RubyOnRails
[19:15:05] choke: has joined #RubyOnRails
[19:16:25] Technodrome: has joined #RubyOnRails
[19:16:33] pLaTo0n: has joined #RubyOnRails
[19:18:44] jottr_: has joined #RubyOnRails
[19:18:57] pLaToOn: has joined #RubyOnRails
[19:20:10] SteenJobs_: has joined #RubyOnRails
[19:23:56] helpa: has joined #RubyOnRails
[19:24:50] ur5us: has joined #RubyOnRails
[19:25:27] alfiemax: has joined #RubyOnRails
[19:27:52] mikecmpb_: has joined #RubyOnRails
[19:39:35] ascarter: has joined #RubyOnRails
[19:43:42] choke: has joined #RubyOnRails
[19:44:02] patarr: has joined #RubyOnRails
[19:45:42] marr: has joined #RubyOnRails
[20:04:39] patarr: has joined #RubyOnRails
[20:06:41] pwnd_nsfw: cseder, nah because I use linux
[20:06:52] Rodya_: has joined #RubyOnRails
[20:10:39] jhfisc: has joined #RubyOnRails
[20:13:55] jhfisc: has joined #RubyOnRails
[20:17:14] lxsameer: has joined #RubyOnRails
[20:23:37] jottr_: has joined #RubyOnRails
[20:24:56] patarr: has joined #RubyOnRails
[20:25:39] Rodya_: has joined #RubyOnRails
[20:26:27] jhfisc: has joined #RubyOnRails
[20:29:03] srinidhi: has joined #RubyOnRails
[20:32:05] jhfisc: has joined #RubyOnRails
[20:35:49] mwlang_: has joined #RubyOnRails
[20:38:29] jhfisc: has joined #RubyOnRails
[20:42:34] ascarter: has joined #RubyOnRails
[20:43:41] jhfisc: has joined #RubyOnRails
[20:44:56] patarr: has joined #RubyOnRails
[20:47:25] Rodya_: has joined #RubyOnRails
[20:47:40] jhfisc: has joined #RubyOnRails
[20:54:23] brent__: has joined #RubyOnRails
[20:56:12] jhfisc: has joined #RubyOnRails
[20:59:42] delgiudices: has joined #RubyOnRails
[21:02:22] patarr: has joined #RubyOnRails
[21:05:36] jhfisc: has joined #RubyOnRails
[21:06:00] knight33: has joined #RubyOnRails
[21:13:49] xco: has joined #RubyOnRails
[21:14:25] xco: can someone help me find the equivalent of this method in Rails 5.0?
[21:14:27] xco: https://apidock.com/rails/ActionController/TestProcess/process
[21:15:56] jhfisc: has joined #RubyOnRails
[21:17:24] sloggerkhan: has joined #RubyOnRails
[21:17:36] SteenJobs_: has joined #RubyOnRails
[21:18:35] Rodya_: has joined #RubyOnRails
[21:19:48] delgiudices: has joined #RubyOnRails
[21:22:14] jphase: has joined #RubyOnRails
[21:26:15] SteenJobs: has joined #RubyOnRails
[21:26:53] knight33: has joined #RubyOnRails
[21:31:01] jhfisc: has joined #RubyOnRails
[21:31:35] noob_on_rails: has joined #RubyOnRails
[21:31:50] noob_on_rails: i just pushed my project to heroku and jquery simply doesnt work :O
[21:32:36] tbuehlmann: probably your fault
[21:33:38] noob_on_rails: tbuehlmann: lol , that's for sure but i can't figure out why :S
[21:33:47] noob_on_rails: maybe some gem in production ?
[21:38:10] noob_on_rails: https://gist.github.com/frcake/ecbe51d6f8ff7aad436470ee66fe4e84
[21:38:19] noob_on_rails: u find anything weird with the warnings etc?
[21:39:53] noob_on_rails: maybe jquery turbolinks or something
[21:40:28] Technodrome: has joined #RubyOnRails
[21:46:22] ascarter: has joined #RubyOnRails
[21:50:39] knight33: has joined #RubyOnRails
[21:53:25] HoierM: has joined #RubyOnRails
[21:57:03] HoierM_: has joined #RubyOnRails
[22:00:03] jhfisc: has joined #RubyOnRails
[22:00:40] patarr: has joined #RubyOnRails
[22:10:35] ur5us: has joined #RubyOnRails
[22:18:28] jhfisc: has joined #RubyOnRails
[22:21:06] patarr: has joined #RubyOnRails
[22:22:09] tofutoon: has left #RubyOnRails: ()
[22:30:33] bed7: has joined #RubyOnRails
[22:30:59] debb75: has joined #RubyOnRails
[22:34:01] Fire-Dragon-DoL: hello everyone, any solution for this rails autoloader mess? (this is not pseudocode, I actually created those files): https://gist.github.com/Fire-Dragon-DoL/46f03c6ce6b258910e4bc857e80043ea
[22:35:28] Technodrome: has joined #RubyOnRails
[22:37:43] jhfisc: has joined #RubyOnRails
[22:45:54] havenwood: Fire-Dragon-DoL: I wonder if that's fixed after this patch lands in Ruby 2.5: https://bugs.ruby-lang.org/issues/11547
[22:46:19] Fire-Dragon-DoL: sigh I thought it was solved earlier, I'll stick to the ugly require_dependency trick
[22:49:01] quirkycoders: has joined #RubyOnRails
[22:49:43] jhfisc: has joined #RubyOnRails
[22:50:31] ascarter: has joined #RubyOnRails
[22:50:58] ekinmur: has joined #RubyOnRails
[22:53:43] dviola: has joined #RubyOnRails
[23:00:22] FastJack: has joined #RubyOnRails
[23:02:02] patarr: has joined #RubyOnRails
[23:05:06] Technodrome: has joined #RubyOnRails
[23:09:59] jhfisc: has joined #RubyOnRails
[23:12:02] jottr_: has joined #RubyOnRails
[23:13:09] Rodya_: has joined #RubyOnRails
[23:16:00] mostlybadfly: has joined #RubyOnRails
[23:21:03] jhfisc: has joined #RubyOnRails
[23:21:42] Rodya_: has joined #RubyOnRails
[23:32:52] timdotrb: has joined #RubyOnRails
[23:33:03] timdotrb: Afternoon, all
[23:33:40] jhfisc: has joined #RubyOnRails
[23:37:42] timdotrb: I’m getting a large set of data from an API that I’m processing, and my code stops looping through it after a certain number of iterations. Is there something in Rails that would cause this to happen? I have 40k + items that I’m looping through, and my code stopped after about 4400
[23:38:11] timdotrb: It’s moving on to the next piece of the code which references the items that were supposed to be added, and then fails because it can’t find the items
[23:38:13] timdotrb: https://gist.github.com/willc0de4food/7ee461c7a39719d0c4aa887ed291e66a
[23:39:42] jhfisc: has joined #RubyOnRails
[23:43:09] choke: has joined #RubyOnRails
[23:45:47] jhfisc: has joined #RubyOnRails
[23:48:57] jhfisc: has joined #RubyOnRails
[23:51:34] s2013: has joined #RubyOnRails
[23:54:22] jahrichie: has joined #RubyOnRails
[23:54:34] jahrichie: Generating a new rails app for prod
[23:54:48] jahrichie: i should jump to rails 5 right?
[23:55:03] ascarter: has joined #RubyOnRails
[23:58:49] jhfisc: has joined #RubyOnRails
[23:59:03] debb75: has joined #RubyOnRails
[23:59:26] havenwood: jahrichie: Rails 5.1