« Back to channel list

#RubyOnRails - 08 June 2016

« Back 1 day Forward 1 day »
[00:00:01] jhack: has joined #RubyOnRails
[00:02:29] AmiMoench: has joined #RubyOnRails
[00:13:58] ksoze: has joined #RubyOnRails
[00:16:43] triangles: has joined #RubyOnRails
[00:18:55] benlieb: has joined #RubyOnRails
[00:26:21] fryguy: has joined #RubyOnRails
[00:33:29] zave: has joined #RubyOnRails
[00:36:22] harfangk: has joined #RubyOnRails
[00:36:53] P_R_Deltoid: has joined #RubyOnRails
[00:37:21] superlou: has joined #RubyOnRails
[00:38:04] P_R_Deltoid: I am trying to follow the Getting Started with Rails guide on rubyonrails.org, and I am having an issue with the "form_for" segment, specifically when setting the url option to the _path variable
[00:38:07] lightt: has joined #RubyOnRails
[00:38:09] P_R_Deltoid: When I try to access the page
[00:38:18] P_R_Deltoid: I get an error that says "No route matches {:action=>"show", :controller=>"forum"} missing required keys: [:id]"
[00:38:44] P_R_Deltoid: But I don't know why it would be trying to use the action "show" when it should be using the only POST resource in my Routes file
[00:40:51] tjohnson: has joined #RubyOnRails
[00:41:53] allcentu1: has joined #RubyOnRails
[00:44:14] johnnyrichard: has joined #RubyOnRails
[00:44:47] jstransky: has joined #RubyOnRails
[00:46:42] David_H_Smith: has joined #RubyOnRails
[00:49:03] David_H_Smith: has joined #RubyOnRails
[00:52:04] Radar: P_R_Deltoid: Can you show us the form_for line that you're trying to use?
[00:52:25] xibalba: has joined #RubyOnRails
[00:52:32] benlieb: has joined #RubyOnRails
[00:52:34] P_R_Deltoid: <% form_for :forum, url: forum_path do |f|%>
[00:53:37] owenjones: has joined #RubyOnRails
[00:54:58] sumobob: has joined #RubyOnRails
[00:55:44] Radar: P_R_Deltoid: I think that should be forums_path
[00:56:33] P_R_Deltoid: Now I get "undefined local variable or method `forums_path'"
[00:56:39] P_R_Deltoid: My routes are all called "forum"
[00:56:51] P_R_Deltoid: and the controller I generated was called Forum as well
[00:57:16] draig: has joined #RubyOnRails
[00:57:37] Radar: P_R_Deltoid: The route should be a plural, as should the controller.
[00:58:38] kgrz: has joined #RubyOnRails
[00:58:38] P_R_Deltoid: Is that a requirement? Or just expected grammar?
[00:58:46] Radar: P_R_Deltoid: It's the convention in Rails.
[00:58:55] P_R_Deltoid: I wanted the URI scheme to use "forum/id" not "forums/id"
[00:59:03] P_R_Deltoid: because its a singular forum
[00:59:14] P_R_Deltoid: But the convention shouldn't cause these issues, should it?
[01:03:34] banister: has joined #RubyOnRails
[01:03:59] eljimbo: has joined #RubyOnRails
[01:05:45] owenjones: has joined #RubyOnRails
[01:06:48] sevenseacat: has joined #RubyOnRails
[01:09:03] moei: has joined #RubyOnRails
[01:15:53] zave: has joined #RubyOnRails
[01:17:40] emachnic: has joined #RubyOnRails
[01:20:26] matthewd: P_R_Deltoid: How have you defined the route?
[01:21:29] Ropeney_: has joined #RubyOnRails
[01:21:36] ElFerna: has joined #RubyOnRails
[01:24:17] shortCircuit__: has joined #RubyOnRails
[01:24:29] lightt: has joined #RubyOnRails
[01:24:49] refinerysource: has joined #RubyOnRails
[01:25:45] yfeldblum: has joined #RubyOnRails
[01:28:01] fryguy: has joined #RubyOnRails
[01:30:20] P_R_Deltoid: matthewd, I used :resources to define all the normal routes
[01:30:42] matthewd: Code please
[01:34:19] dkam: has joined #RubyOnRails
[01:37:24] P_R_Deltoid: which part in particular? My routes file?
[01:37:34] macsteps: has joined #RubyOnRails
[01:40:24] ensyde__: has joined #RubyOnRails
[01:41:23] P_R_Deltoid: matthewd, http://pastebin.com/U1byuCht
[01:42:10] matthewd: P_R_Deltoid: Sorry, yes, routes.rb
[01:42:23] ensyde: has joined #RubyOnRails
[01:42:47] P_R_Deltoid: Also, in that paste, I hardcoded URL to get around my _path helper issue, but I'd really like to solve it the correct way, and that was just a stop-gap
[01:43:37] P_R_Deltoid: https://gist.github.com/PRDeltoid/be75ed5fed273b5383ac85d0c5e593d9
[01:44:22] flashpoint9: has joined #RubyOnRails
[01:51:46] patrick_star_3: has joined #RubyOnRails
[01:58:43] one_zero: has joined #RubyOnRails
[01:59:37] jancel: has joined #RubyOnRails
[02:00:23] Leepoff: has joined #RubyOnRails
[02:00:52] harfangk: has joined #RubyOnRails
[02:01:40] IFrank00: has joined #RubyOnRails
[02:01:41] IFrank004: has joined #RubyOnRails
[02:03:37] AaronTheWhite: has joined #RubyOnRails
[02:03:40] Rodya_: has joined #RubyOnRails
[02:04:08] maxz: has joined #RubyOnRails
[02:05:32] Coldblackice: has joined #RubyOnRails
[02:11:41] IFrank004: has joined #RubyOnRails
[02:11:41] IFrank00: has joined #RubyOnRails
[02:17:54] ElFerna: has joined #RubyOnRails
[02:19:18] Spami: has joined #RubyOnRails
[02:19:36] tedwing: has joined #RubyOnRails
[02:24:26] gamov: has joined #RubyOnRails
[02:26:32] refinerysource: has joined #RubyOnRails
[02:26:51] flashpoint9: has joined #RubyOnRails
[02:26:54] lightt: has joined #RubyOnRails
[02:32:15] meinside: has joined #RubyOnRails
[02:33:05] rakm: has joined #RubyOnRails
[02:34:22] tgeeky: what should be my ROOT directory if I have to run a custom version of webbrick?
[02:34:26] tgeeky: clearly not /public
[02:35:50] quazimodo: has joined #RubyOnRails
[02:39:32] tgeeky: doh, thin took over my rails server command. how do I remove it?
[02:40:46] tgeeky: just remove gem 'thin', it seems
[02:41:39] sypheren: has joined #RubyOnRails
[02:45:01] sleungcy: has joined #RubyOnRails
[02:48:36] assgrass: has joined #RubyOnRails
[02:49:44] assgrass: has joined #RubyOnRails
[02:51:45] ksoze: has joined #RubyOnRails
[02:54:43] Spami: has joined #RubyOnRails
[02:56:49] tgeeky: jeez, now I can't use it because webrick generates SHA-1 certs :(
[02:58:51] ur5us: has joined #RubyOnRails
[03:00:50] jancel: has joined #RubyOnRails
[03:02:51] SteenJobs: has joined #RubyOnRails
[03:03:46] chopin: has joined #RubyOnRails
[03:05:38] emachnic: has joined #RubyOnRails
[03:07:31] tgeeky: ha. how cool is this: https://github.com/Daplie/localhost.daplie.com-certificates
[03:07:36] tgeeky: a free SSL cert for localhost
[03:17:51] braincrash: has joined #RubyOnRails
[03:20:53] k3rn31: has joined #RubyOnRails
[03:22:48] harfangk: has joined #RubyOnRails
[03:30:26] ElFerna: has joined #RubyOnRails
[03:37:41] jancel: has joined #RubyOnRails
[03:39:13] sleungcy: has joined #RubyOnRails
[03:39:44] IFrank004: has joined #RubyOnRails
[03:39:44] IFrank00: has joined #RubyOnRails
[03:56:26] kknight: has joined #RubyOnRails
[03:58:45] siaw23: has left #RubyOnRails: ()
[03:58:54] kknight: how to give valdiation for email, does we need js or we have to change it in model
[03:59:04] pwnd_nsfw: has joined #RubyOnRails
[03:59:40] tedwing: has joined #RubyOnRails
[04:04:47] jancel: has joined #RubyOnRails
[04:07:47] tjbiddle: has joined #RubyOnRails
[04:14:06] hahuang61: has joined #RubyOnRails
[04:16:05] djbkd: has joined #RubyOnRails
[04:18:05] chouhoulis: has joined #RubyOnRails
[04:19:35] hahuang61: has joined #RubyOnRails
[04:23:00] supernov_a: has joined #RubyOnRails
[04:24:41] armyriad: has joined #RubyOnRails
[04:24:47] yfeldblum: has joined #RubyOnRails
[04:25:21] yatish27: has joined #RubyOnRails
[04:26:55] chouhoulis: has joined #RubyOnRails
[04:30:28] mytrile: has joined #RubyOnRails
[04:31:32] duncannz: has joined #RubyOnRails
[04:36:01] Cohedrin: has joined #RubyOnRails
[04:39:01] harfangk: has joined #RubyOnRails
[04:47:07] kgrz: has joined #RubyOnRails
[04:51:28] DTZUBDUB: has joined #RubyOnRails
[04:53:59] emachnic: has joined #RubyOnRails
[04:54:09] tildes_: has joined #RubyOnRails
[04:54:47] zave: has joined #RubyOnRails
[04:56:26] njero: has joined #RubyOnRails
[04:58:54] braincra-: has joined #RubyOnRails
[05:08:15] jayc0b0: has joined #RubyOnRails
[05:08:28] pawnbox: has joined #RubyOnRails
[05:13:20] rvanlieshout: has joined #RubyOnRails
[05:18:28] alfiemax: has joined #RubyOnRails
[05:22:18] David_H_Smith: has joined #RubyOnRails
[05:23:43] pawnbox: has joined #RubyOnRails
[05:24:09] jas02: has joined #RubyOnRails
[05:25:25] roamingdog: has joined #RubyOnRails
[05:27:14] sleungcy: has joined #RubyOnRails
[05:30:01] tgeeky: where do I need to put a class (a worker class, for a web app connector), so that my rails instance can see it?
[05:30:11] tgeeky: literally anywhere in any controller .rb file?
[05:30:34] pawnbox: has joined #RubyOnRails
[05:31:43] tubbo: has joined #RubyOnRails
[05:31:47] Radar: tgeeky: lib is the traditional place for it
[05:31:53] Radar: then require that file in the controller which uses that file
[05:31:56] Radar: require 'web_connector'
[05:32:22] tgeeky: Radar: thanks. does it matter if it's a controller that I use for anything or not?
[05:32:36] Radar: tgeeky: Is it really a controller?
[05:32:45] apotry: has joined #RubyOnRails
[05:32:45] Radar: Does it receive requests and respond with data like views?
[05:32:59] tgeeky: it recieves requests and... right now just prints them to the rails db
[05:33:19] tgeeky: Radar: I am using the gem 'qbwc' to do this. So Quickbooks is logging into my webapp, doing someting
[05:33:22] tgeeky: something*
[05:33:50] tgeeky: Radar: https://github.com/qbwc/qbwc#workers
[05:34:14] tgeeky: so I have exactly that thing, CustomerTestWorker; I was just running it manually; but of course the webserver could not find it.
[05:34:15] Radar: It's not a controller. Put the class in `lib`.
[05:34:28] DoctorMonocular: has joined #RubyOnRails
[05:34:30] tgeeky: and it will autoload somewhere thanks to being in lib?
[05:34:34] mytrile: has left #RubyOnRails: ()
[05:34:38] Radar: [15:31:53] <Radar> then require that file in the controller which uses that file
[05:34:46] syndikate: has joined #RubyOnRails
[05:35:53] syndikate: Hello, can somebody please tell me why my stub_request is not returning a body here? https://gist.github.com/anonymous/008b9b0b10ce2cae19db9872df3618a8
[05:36:20] syndikate: It fail in the test -> BlogController GET index returns an array of file hash
[05:37:09] tgeeky: Radar: thanks again! I actually see it working!
[05:37:30] tgeeky: this is wildly inappropriate data to be logging to a text file, but at least I know it works :)
[05:37:54] syndikate: My test tells me that I get a response of ""
[05:38:06] syndikate: which should not be the case
[05:38:09] lightt: has joined #RubyOnRails
[05:39:17] dandaman: has joined #RubyOnRails
[05:39:27] Radar: syndikate: My guess is that you didn't disable the internet connections so whatever you're using for requests is still making those requests
[05:42:39] syndikate: If the request was made then it should totally fail with the fake data, plus when I tried to run wihtout stub it failed and showed me that internet use is turned off and I need to stub
[05:47:00] jayc0b0: has joined #RubyOnRails
[05:48:54] emachnic: has joined #RubyOnRails
[05:49:05] dionysus69: has joined #RubyOnRails
[05:53:22] jayc0b0: has joined #RubyOnRails
[05:55:50] pawnbox: has joined #RubyOnRails
[05:56:32] emilkarl: has joined #RubyOnRails
[05:58:26] Depili: has joined #RubyOnRails
[06:04:20] agit0: has joined #RubyOnRails
[06:05:48] jstransky: has joined #RubyOnRails
[06:07:16] pawnbox_: has joined #RubyOnRails
[06:07:39] dandaman: has joined #RubyOnRails
[06:07:52] alfiemax: has joined #RubyOnRails
[06:11:48] Wolland: has joined #RubyOnRails
[06:12:27] Technodrome: has joined #RubyOnRails
[06:13:30] yardenbar: has joined #RubyOnRails
[06:15:43] sevenseacat: syndikate: not enough information to say
[06:16:14] axxyhtrx: has joined #RubyOnRails
[06:16:43] emilkarl: has joined #RubyOnRails
[06:18:16] solars: has joined #RubyOnRails
[06:18:22] emilkarl: If a User has many Groups by Group::user_id and then User has_and_belongs_to_many groups with a relationship how would you name those relationships in user model? has_many :groups (as owner), has_and_belongs_to_many :groups?
[06:18:42] Radar: syndikate: Can you reproduce it in a new app?
[06:18:45] sevenseacat: syndikate: you've shown a test but not the code being tested
[06:18:52] Radar: emilkarl: need a join model between users + groups
[06:19:16] shortCircuit__: has joined #RubyOnRails
[06:21:03] emilkarl: i have the groups_users table. it is not how to do it, more like how to name it? I cant name both has_many :groups and has_and_belongs_to_many :groups
[06:21:27] sevenseacat: has_many :owned_groups, if thats what the association is
[06:21:40] sleungcy: has joined #RubyOnRails
[06:21:59] Radar: emilkarl: The "owner" attribute should be on that join table.
[06:22:17] Radar: Or at least, an owner_id on the groups table if there's only one owner
[06:22:27] emilkarl: there is only one owner
[06:22:27] AimlessRAven: has joined #RubyOnRails
[06:23:04] emilkarl: so i have now Group(:name, :user_id), groups_users(:group_id, :user_id)
[06:23:28] emilkarl: as a group only can be owned by one user it seems right to put the id on the group model
[06:23:50] emilkarl: that user does not belong to it, just owns it.
[06:26:20] aganov: has joined #RubyOnRails
[06:27:47] AimlessRAven: https://gist.github.com/anonymous/adb07217ba89e74d50a1f9e3081ce38b
[06:27:55] AimlessRAven: can someone help me to optimize this to use less code
[06:28:39] kali3: has joined #RubyOnRails
[06:28:41] emilkarl: Is it bad practice to leave out the has_and_belongs_to_many :groups on the user? I dont think i will need to retrieve groups for users in that direction. I will always go group the owner and then list users for each group.
[06:28:58] Radar: emilkarl: You can leave out associations if you don't need them.
[06:30:26] lxsameer: has joined #RubyOnRails
[06:31:15] WilfredTheGreat: has joined #RubyOnRails
[06:33:07] roamingdog: in a loop. using pundit to authorize things in an /admin thingie, but now I want to create a dashboard. seems i'd have to inspect the current_user and authorize everything (again, as in repeating policy files) to show appropriate things to the user. conceptually, am i doing something wrong?
[06:34:43] darutoko: has joined #RubyOnRails
[06:35:01] Spami: has joined #RubyOnRails
[06:37:25] sevenseacat: it seems so. why are you repeating policy files?
[06:37:45] roamingdog: i suppose what i should do is 'if authorize Thing1; show Thing1; end if authorize Thing2; show Thing2; end' etc?
[06:37:50] universa1: i tend to "hack" around it by having an admin_area_policy which allows an admin to do everything, and everyone else is not allowed ;)
[06:38:20] roamingdog: universa1: there are several roles i have to consider in my case
[06:38:23] sevenseacat: roamingdog: poor pseudocode aside, that would make more sense
[06:39:03] tjbiddle: has joined #RubyOnRails
[06:40:56] pawnbox: has joined #RubyOnRails
[06:41:27] universa1: roamingdog: things.map {
[06:41:51] universa1: roamingdog: things.map {|t| authorize t}.reduce &:&& or alike ;)
[06:42:50] emachnic: has joined #RubyOnRails
[06:43:12] darkxploit: has joined #RubyOnRails
[06:45:59] gingray: has joined #RubyOnRails
[06:57:46] k3rn31: has joined #RubyOnRails
[06:58:05] arBmind: has joined #RubyOnRails
[06:58:34] lalalaaa: has joined #RubyOnRails
[06:59:12] Leepoff: has joined #RubyOnRails
[07:01:07] blockchan: has joined #RubyOnRails
[07:05:11] AimlessRAven: for example i have
[07:05:20] AimlessRAven: = f.input :category_id_in, as: :check_boxes, collection: Category.all, item_wrapper_class: 'inline check-primary', label_html: {class: 'm-r-20'}, label: false
[07:05:26] AimlessRAven: this generate check boxes of my categories
[07:05:33] AimlessRAven: when i click search .. this find it
[07:05:43] AimlessRAven: but i want to search without to need click search
[07:05:54] soroot: has joined #RubyOnRails
[07:08:16] Ropeney_: can you try that again? :(
[07:11:30] AimlessRAven: can ransack provide option to search without click submit
[07:11:36] AimlessRAven: i have checkboxes with my category and submit link
[07:11:46] AimlessRAven: i wanna when click chexbox to filter .. without need to click submit
[07:12:58] moei: has joined #RubyOnRails
[07:15:44] sleungcy: has joined #RubyOnRails
[07:16:22] edwinvdgraaf: has joined #RubyOnRails
[07:17:44] ur5us: has joined #RubyOnRails
[07:17:56] owenjones: has joined #RubyOnRails
[07:19:50] AimlessRAven: i have ransack category search.. there are checkboxes for each categoris
[07:19:56] AimlessRAven: and submit button
[07:20:04] sevenseacat: yeah I read the first time you posted it
[07:20:21] AimlessRAven: yeah, is a good idea to create js event when click some category checkbox
[07:20:25] AimlessRAven: to make click on submit button
[07:20:55] AimlessRAven: or ransack have some option to do this without js
[07:22:32] antgel: has joined #RubyOnRails
[07:24:04] pawnbox: has joined #RubyOnRails
[07:25:14] quazimodo: has joined #RubyOnRails
[07:25:48] AimlessRAven: sevenseacat: ?
[07:25:58] sevenseacat: AimlessRaven: why do you keep tagging me?
[07:27:57] codeshah: has joined #RubyOnRails
[07:28:32] Macaveli: has joined #RubyOnRails
[07:29:03] FCser: has joined #RubyOnRails
[07:37:23] Technodrome: has joined #RubyOnRails
[07:38:55] Pulkit21: has joined #RubyOnRails
[07:39:39] GorillaApe: has joined #RubyOnRails
[07:39:44] GorillaApe: I am really pissed off
[07:39:57] GorillaApe: and feel retarted
[07:40:37] ur5us: has joined #RubyOnRails
[07:41:44] gingray: has joined #RubyOnRails
[07:44:54] tildes: I'm working with a relatively large installation with 142 models... I found a nice case for using composition, which will require creating three new classes. would you put these just in the same models-folder root, or how would you go about it?
[07:45:10] tildes: perhaps rather namespace it with a module, that has the same name as the model that is going to use these?
[07:45:21] tildes: ^ it -> them
[07:56:39] pawnbox: has joined #RubyOnRails
[07:57:57] gingray: has joined #RubyOnRails
[08:00:43] apotry: has joined #RubyOnRails
[08:03:43] qejk: has joined #RubyOnRails
[08:06:04] yfeldblum: has joined #RubyOnRails
[08:06:34] DaniG2k: has joined #RubyOnRails
[08:06:36] jsrn: has joined #RubyOnRails
[08:07:04] crova: has joined #RubyOnRails
[08:08:36] mikecmpbll: has joined #RubyOnRails
[08:08:42] marr: has joined #RubyOnRails
[08:09:42] adre: has joined #RubyOnRails
[08:09:46] sleungcy: has joined #RubyOnRails
[08:10:43] crova: greetings all! I'm trying to record an object into the database and the console asks me to pass a hash while assigning attributes, but i have no clue on how to build the hash. Any thoughts please? gist here: https://gist.github.com/crova/1baa98b74f3c55ee208806f14725ff78
[08:11:21] sevenseacat: crova: pass acct_info directly to Acct.create
[08:11:40] sevenseacat: also consider renaming the model to be Account, not Acct
[08:11:50] harfangk: has joined #RubyOnRails
[08:13:20] crova: sevenseacat query succeed but i only get timestamps updated
[08:13:30] crova: all other values are nil
[08:13:41] sevenseacat: show what happened? :)
[08:14:00] msyvich: has joined #RubyOnRails
[08:14:37] crova: same gist https://gist.github.com/crova/1baa98b74f3c55ee208806f14725ff78/edit
[08:14:47] crova: not sure if I did what you suggested exactly
[08:15:01] sevenseacat: you need to update the gist with your new information
[08:15:17] crova: I did, file named try #2
[08:15:29] sevenseacat: its not in that gist
[08:15:36] crova: try again now
[08:15:57] sevenseacat: crova: you need to pass acct_info directly to Acct.create
[08:16:02] sevenseacat: eg. Acct.create(acct_info)
[08:16:21] sevenseacat: also strongly consider renaming the model to Account
[08:17:01] Pazician: has joined #RubyOnRails
[08:17:01] Pazician: has joined #RubyOnRails
[08:17:03] crova: nice, I see now what you mean by 'directly' lol, thank you very much
[08:17:09] crova: and I'll rename my model :)
[08:17:48] alfiemax: has joined #RubyOnRails
[08:18:31] harfangk: what are good books/tutorials for getting into TDD/BDD in rails? it’d be nice to get some rec
[08:18:36] blackmesa: has joined #RubyOnRails
[08:19:27] mark_66: has joined #RubyOnRails
[08:20:13] Radar: harfangk: !r4ia
[08:20:13] helpa: harfangk: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[08:20:22] Radar: harfangk: The book that sevenseacat and I wrote.
[08:20:31] Radar: It's pretty good if I say so myself.
[08:20:37] Radar: #notbiased
[08:21:06] sevenseacat: I also quite like it. <_<
[08:30:50] emachnic: has joined #RubyOnRails
[08:30:50] harfangk: haha thx for the rec
[08:30:59] harfangk: i like how it’s new
[08:31:30] harfangk: like, i’m not going to read that rspec book from 2010
[08:31:45] moei: has joined #RubyOnRails
[08:33:09] DaniG2k: sevenseacat Radar you wrote r4ia?
[08:33:40] DaniG2k: it's the best Rails book ever
[08:33:44] DaniG2k: I use it constantly
[08:34:16] sevenseacat: glad you like it!
[08:34:20] DaniG2k: there is one bug I noticed however...in case you're going for version 2
[08:34:34] gamov: rbr: an update: it seems that the aliaising is happening in the polyamorous gem, not in rails proper… what a nightmare to follow in the debugger!
[08:34:59] sevenseacat: DaniG2k: whats that?
[08:35:07] DaniG2k: sevenseacat: the make_default! method in the State class contains a race condition
[08:35:11] Kedare: has joined #RubyOnRails
[08:35:22] DaniG2k: you update all to false
[08:35:26] DaniG2k: then update one to default: true
[08:35:43] DaniG2k: if multiple people do that at the same time it might mess up the states (multiple true states)
[08:35:53] DaniG2k: I think I "fixed" it this way: https://github.com/DaniG2k/ticketee/blob/master/app/models/state.rb
[08:35:56] DaniG2k: wrapped it in a transaction
[08:36:23] DaniG2k: tbh I'm not sure how to test the race condition though
[08:36:46] sevenseacat: it should probably be in a transaction, yeah
[08:37:01] DaniG2k: awesome, can't believe I got it right :D
[08:37:07] jto: has joined #RubyOnRails
[08:37:20] DaniG2k: a potential employer pointed it out and asked me to fix so I just wrapped in a transaction, so he was happy with that
[08:37:29] sevenseacat: no, the rest of the code you added I don't think would be necessary
[08:37:46] DaniG2k: the whole State.where.not(id: id).lock(true).update_all(default: false) ?
[08:38:03] DaniG2k: I think that locks the entire column
[08:38:29] DaniG2k: or rather, all the rows that aren't of the correct id
[08:38:46] pawnbox: has joined #RubyOnRails
[08:39:07] sevenseacat: I would wrap it in a transaction, ie. transaction do; State.update_all!(default: false); update!(default: true); end
[08:39:11] DaniG2k: by the way, I still don't have a RoR job :/ thanks Obama
[08:39:29] DaniG2k: sevenseacat: ok
[08:39:59] DaniG2k: sevenseacat: I wasn't sure how to test so I just wrote a basic controller spec
[08:40:03] DaniG2k: sevenseacat: https://github.com/DaniG2k/ticketee/blob/master/spec/models/state_spec.rb
[08:40:14] sevenseacat: thats a model spec.
[08:40:31] DaniG2k: oops yea, model spec I mean
[08:41:08] sevenseacat: that spec depends heavily on the database returning the states in the right order
[08:41:15] sevenseacat: which isnt what you're testing
[08:42:19] DaniG2k: State.first etc should probably read state1
[08:43:06] sevenseacat: state1.reload, yes
[08:43:29] DaniG2k: I'll do it now, let's see if it works
[08:45:28] rogue_koder: has joined #RubyOnRails
[08:46:47] syndikate: has joined #RubyOnRails
[08:48:03] DaniG2k: oh wait, seems there's an issue hmm
[08:48:26] DaniG2k: ah user error
[08:49:22] tvw: has joined #RubyOnRails
[08:49:28] DaniG2k: sevenseacat: https://github.com/DaniG2k/ticketee/blob/master/app/models/state.rb
[08:49:45] DaniG2k: https://github.com/DaniG2k/ticketee/blob/master/spec/models/state_spec.rb
[08:51:23] sevenseacat: looks better. do you know why you need to reload in all the specs?
[08:52:21] DaniG2k: sevenseacat: not exactly, although it's the reason I was using State.first, State.second, etc
[08:52:32] DaniG2k: because when I was passing in the variable at first, my tests were failing
[08:52:49] DaniG2k: what does the reload method do precisely?
[08:52:56] sevenseacat: because the make_default! method calls State.update_all, which updates the database, but not the State instances you've already got in memory
[08:53:00] sevenseacat: it reloads the record from the database
[08:53:43] DaniG2k: ooh so the variables are cached in memory
[08:53:48] DaniG2k: why don't they reference the db?
[08:53:55] bruce_lee: has joined #RubyOnRails
[08:53:58] bruce_lee: has joined #RubyOnRails
[08:54:27] DaniG2k: I thought that the instance variables would reflect what's in the dn
[08:54:53] DaniG2k: makes sense though, thanks for explaining
[08:54:58] sevenseacat: it does, but then you update the db out from under it
[08:55:29] sevenseacat: it doesnt hold a link to the db so when the db updates, the object in memory doesnt automatically refresh
[08:55:42] DaniG2k: ok I think I get it
[08:56:02] DaniG2k: that's a total of 135 specs, not bad
[08:56:12] DaniG2k: for a simple project :)
[08:56:22] Nuck: has joined #RubyOnRails
[08:58:23] Technodrome: has joined #RubyOnRails
[08:58:38] tjbiddle: Those who use Amazon SES - What way makes the most sense to setup here - SMTP or using their SDK?
[08:58:43] ur5us: has joined #RubyOnRails
[08:59:12] der-landgraf: has joined #RubyOnRails
[08:59:12] der-landgraf: has joined #RubyOnRails
[08:59:42] owenjones: has joined #RubyOnRails
[09:01:53] emachnic: has joined #RubyOnRails
[09:02:27] Circuit8: has joined #RubyOnRails
[09:02:55] msyvich: How does one interact with the request object when doing controller tests in minitest ?
[09:03:03] msyvich: e.g. open_session do |sess|
[09:03:24] msyvich: I need to set a key on the `env` object of the `request` object but the `request` object isn't defined anywhere...
[09:05:16] ksoze: has joined #RubyOnRails
[09:06:17] norc: has joined #RubyOnRails
[09:07:08] msyvich: tjbiddle my team uses smtp and it works just fine
[09:07:31] msyvich: the SDK might be asynchronous though, which could be a plus, not sure
[09:08:05] msyvich: tjbiddle, but yea configuring action_mailer for smtp is a breeze
[09:08:19] AlexJakeGreen: has joined #RubyOnRails
[09:08:27] blockchan: has joined #RubyOnRails
[09:08:37] soroot: has joined #RubyOnRails
[09:10:32] soroot: has joined #RubyOnRails
[09:11:17] norc: So I have an application that uses devise to authenticate users against LDAP. Currently the same Rails application is providing 2 REST API endpoints for a javascript application, using a custom JWT authentication strategy. Is this a wise thing?
[09:11:37] norc: Would you place the REST API into a separate application?
[09:12:15] DaniG2k: two separate authentication methods?
[09:12:24] msyvich: has joined #RubyOnRails
[09:12:25] DaniG2k: LDAP and JWT
[09:12:29] norc: DaniG2k: That is what I have atm.
[09:12:47] norc: The thing though is the REST API is just a SOAP mapper for an external unrelated service.
[09:13:36] DaniG2k: hmm if they're namespaced into separate mini applications I don't see why this would be "bad"
[09:14:21] DaniG2k: despite being part of the same main Rails app
[09:14:25] soroot: has joined #RubyOnRails
[09:14:52] soroot: has joined #RubyOnRails
[09:15:19] norc: DaniG2k: Oh it just hit me! If the API uses a different base class for its controller I can even separate the authentication process entirely!
[09:15:39] norc: Then it feels right.
[09:15:57] DaniG2k: just namespace everything
[09:16:06] soroot: has joined #RubyOnRails
[09:16:15] DaniG2k: you can have separate mini apps within the same Rails app
[09:16:40] ur5us: has joined #RubyOnRails
[09:16:40] DaniG2k: if they're all using Devise then you might want a separate app? Not sure
[09:16:54] DaniG2k: but if they're entirely different authentication mechanisms I don't see why not :)
[09:18:28] adre: has joined #RubyOnRails
[09:26:29] rogue_koder: has joined #RubyOnRails
[09:27:01] AzaToth: has joined #RubyOnRails
[09:27:23] Macaveli: has joined #RubyOnRails
[09:27:48] mdw: has joined #RubyOnRails
[09:28:15] srinidhi: has joined #RubyOnRails
[09:32:07] Ergo: has joined #RubyOnRails
[09:34:00] Xentil: has joined #RubyOnRails
[09:41:14] quazimodo: has joined #RubyOnRails
[09:44:04] netzfisch: has joined #RubyOnRails
[09:45:52] DTZUBDUB: has joined #RubyOnRails
[09:49:03] mdw7: has joined #RubyOnRails
[09:49:10] workmad3: has joined #RubyOnRails
[09:50:50] mdw7_: has joined #RubyOnRails
[09:51:05] allcentu1: has joined #RubyOnRails
[09:54:08] alfiemax: has joined #RubyOnRails
[09:58:10] arBmind: has joined #RubyOnRails
[09:59:40] westoque: has joined #RubyOnRails
[10:00:00] ruid: has joined #RubyOnRails
[10:00:05] flashpoint9: has joined #RubyOnRails
[10:00:33] owenjones: has joined #RubyOnRails
[10:01:40] westoque: i wanted to make a POST request using CORS to my rails app but missing the csrf token, what would be the best way to get the csrf token? i was thinking maybe a GET request for it and replace the input html with its contents. would this be ideal? thanks.
[10:03:33] mdw: has joined #RubyOnRails
[10:05:03] DaniG2k: westoque: try this maybe? http://stackoverflow.com/questions/11622496/return-csrf-token-in-json-response
[10:08:23] lightt: has joined #RubyOnRails
[10:09:09] westoque: DaniG2K: thanks. will try that. was hoping i could do get the csrf on initial load of the parent domain, so i only have to do 1 call for the POST
[10:09:34] westoque: has left #RubyOnRails: ()
[10:10:09] westoque: has joined #RubyOnRails
[10:10:17] westoque: has left #RubyOnRails: ()
[10:17:10] artto: has joined #RubyOnRails
[10:17:18] mdw: has joined #RubyOnRails
[10:20:06] netzfisch: has joined #RubyOnRails
[10:22:41] soroot: has joined #RubyOnRails
[10:26:17] tjbiddle: Hey all - I have "config.mailer_sender" set to the email I want in devise.rb - but I keep getting the error "An SMTP From address is required to send a message"
[10:27:13] gingray: has joined #RubyOnRails
[10:28:03] marr: has joined #RubyOnRails
[10:29:50] lightt: has joined #RubyOnRails
[10:30:27] pLaToOn: has joined #RubyOnRails
[10:31:29] wimplash: has joined #RubyOnRails
[10:34:35] ruid: has joined #RubyOnRails
[10:37:14] emilkarl: has joined #RubyOnRails
[10:37:53] blockchan: has joined #RubyOnRails
[10:38:08] harfangk: has joined #RubyOnRails
[10:42:42] artto: has joined #RubyOnRails
[10:44:41] tjbiddle: Ergh, I have config.action_mailer.raise_delivery_errors = true set and I'm not getting any output. My normal mailers were working fine - switch to devise and they're just failing silently
[10:48:01] tjbiddle: *sigh* I guess calling deliver() helps
[10:57:53] jmignault: has joined #RubyOnRails
[11:01:11] Hyuk: has joined #RubyOnRails
[11:01:47] mdw: has joined #RubyOnRails
[11:02:20] rodfersou: has joined #RubyOnRails
[11:04:10] Hyuk: has joined #RubyOnRails
[11:06:21] Pumukel: has joined #RubyOnRails
[11:10:50] blackmesa: has joined #RubyOnRails
[11:12:05] artto: has joined #RubyOnRails
[11:12:22] artto: has joined #RubyOnRails
[11:16:00] srinidhi: has joined #RubyOnRails
[11:16:45] arathald: has joined #RubyOnRails
[11:17:51] k3rn31: has joined #RubyOnRails
[11:19:04] Ropeney_: has joined #RubyOnRails
[11:22:33] kknight: has joined #RubyOnRails
[11:23:01] flashpoint9: has joined #RubyOnRails
[11:32:17] k3rn31: has joined #RubyOnRails
[11:32:21] nettoweb: has joined #RubyOnRails
[11:32:25] emilkarl: has joined #RubyOnRails
[11:34:00] nettoweb: Has anyone here ever tried using "nested_form_fields" with a has_and_belongs_to_many association?
[11:37:45] ldnunes: has joined #RubyOnRails
[11:39:17] nettoweb: has_and_belongs_to_many is not used anymore in new version of rails? only has_many through?
[11:39:51] snowy: has joined #RubyOnRails
[11:40:57] norc: nettoweb: you can still use it, but more often than not you want an explicit intermediate model instead.
[11:42:11] nettoweb: norc im sure I dont need, just a link between both. just wondering how to link between both. using this "nested_form_fields" gem
[11:42:15] achamian: has joined #RubyOnRails
[11:42:17] nettoweb: or nested form
[11:42:49] mdw7: has joined #RubyOnRails
[11:43:10] norc: nettoweb: 8 minutes have passed since then, you could have simply created an intermediate model and has_many :through
[11:44:27] nettoweb: norc just to manke things simpler for me? because there is no sense to create a model with two fields: company_id and xx_id for example. or I'm wrong?
[11:44:35] phredus: has joined #RubyOnRails
[11:44:40] norc: nettoweb: A model is just a ruby class, nothing more.
[11:44:50] nettoweb: norc ok, I'' try
[11:45:25] dionysus69: has joined #RubyOnRails
[11:45:26] ddv: nettoweb: read the rails style guide
[11:46:33] ddv: nettoweb: https://github.com/bbatsov/rails-style-guide#has-many-through
[11:48:46] rbr: nettoweb: It can save you from a lot of future hassle ;)
[11:49:02] nettoweb: thanks guys
[11:50:42] kgrz: has joined #RubyOnRails
[11:55:55] Macaveli: has joined #RubyOnRails
[11:56:19] Wolland: has joined #RubyOnRails
[11:56:48] emilkarl: has joined #RubyOnRails
[12:00:54] chouhoulis: has joined #RubyOnRails
[12:01:37] pierrehoudyer: has joined #RubyOnRails
[12:03:40] ruid: has joined #RubyOnRails
[12:04:26] msyvich: has joined #RubyOnRails
[12:04:40] roamingdog: has joined #RubyOnRails
[12:04:55] kedare1: has joined #RubyOnRails
[12:13:30] nettoweb: getting there... Now I set this in my controller: @company.cnae.build in order to nested form works, configured the strong params but when I try o update my company I'm getting "undefined method `to_sym' for nil:NilClass"
[12:13:37] nettoweb: any clue or it's best to create a gist?
[12:14:22] norc: nettoweb: The pure error message without code and a complete (!) stack trace is usually fairly useless.
[12:16:30] ElFerna: has joined #RubyOnRails
[12:20:35] wd40s: has joined #RubyOnRails
[12:21:17] nettoweb: https://gist.github.com/osnysantos/0622e214f3de29ac8d2697108433e5fc please tell me if this is enough is order to check this issue
[12:22:16] Axilla: what am I missing, I have a image in /public for facebook og and it is visible in development but in production its not..
[12:23:31] pierrehoudyer: axilla : Look in your production settings inside config/env
[12:23:38] pierrehoudyer: and look at > config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
[12:24:47] norc: nettoweb: I asked for a stack trace.
[12:25:17] norc: Why is it that people, even after me asking for it explicitly try to hide stack traces, when they are the one thing telling you how an error happened.
[12:25:36] nettoweb: norc sorry. but I figure it out, it was that line: https://gist.github.com/osnysantos/0622e214f3de29ac8d2697108433e5fc#file-_form-html-erb-L9
[12:25:54] nettoweb: it doesnt need an id there as it's just a link table
[12:25:57] norc: nettoweb: next time click "Full trace"
[12:27:17] nettoweb: norc ok, the full trace is better because you can understand exactly where the erro comes from?
[12:27:24] norc: nettoweb: precisely.
[12:27:30] artto: has joined #RubyOnRails
[12:27:40] gheegh: has joined #RubyOnRails
[12:27:47] flashpoint9: has joined #RubyOnRails
[12:28:15] norc: nettoweb: and if you remove code from your controller, you need to somehow do the math in your head and update the lines in your stack trace.
[12:28:53] refinerysource: has joined #RubyOnRails
[12:29:06] nettoweb: thanks for the tips, I'll keep this in mind
[12:29:14] harfangk: has joined #RubyOnRails
[12:29:26] nettoweb: to help people to help me
[12:29:41] norc: nettoweb: If the people coming into this channel took the time to read an error message and look at a stack trace, we would get 50% less chatter.
[12:29:52] norc: (This number is just based on my feelings)
[12:29:57] Axilla: pierrehoudyer: ahh yep i def never set an ENV var for that.. duh =/
[12:30:09] norc: nettoweb: Point being: Stack traces are *that* useful.
[12:30:38] nettoweb: norc Im sure of this. but sometimes we keep so much time trying to fix something that we get lost and dont know what to look more
[12:30:56] edwinvdgraaf: has joined #RubyOnRails
[12:31:26] k3dare: has joined #RubyOnRails
[12:31:45] norc: nettoweb: Imagine people getting a NoMethodError: undefined method `[]' for nil:NilClass for a line that says: @users[1]
[12:31:53] norc: nettoweb: people actually come in here and ask what they did wrong.
[12:32:09] norc: Ignoring that Ruby already told them what the problem is.
[12:32:46] nettoweb: yes... doesnt make sense
[12:36:27] Axilla: damn, that didn't take long
[12:36:34] Axilla: while working on this issue people are already trying to hack the site
[12:36:52] Axilla: getting hits for someone trying to run /testproxy.php in a rails app
[12:37:10] jhass: so what, welcome to the internet background noise
[12:37:12] jhass: just ignore it
[12:37:17] pierrehoudyer: axilla: and he got a 404 ?
[12:37:20] Axilla: yea for sure
[12:37:20] Axilla: just find it funny
[12:37:20] Axilla: the sites been online for about 4 days
[12:37:22] pLaToOn: has joined #RubyOnRails
[12:37:24] Axilla: yea of course
[12:37:46] jhass: IPv4 isn't that big, it's continuously scanned
[12:38:09] Axilla: and its AWS ip4 i'm sure the entire ip range is known
[12:38:28] jhass: all ip ranges are always known, inherently
[12:39:42] Axilla: well yea gotcha
[12:39:48] Axilla: makes sense..
[12:39:52] norc: axilla: When the Cisco ASA vulnerability was made public, the SANS university noticed this change in internet background noise: https://isc.sans.edu/diaryimages/images/Screen%20Shot%202016-02-10%20at%202_43_10%20PM.png
[12:40:00] lxsameer: any one using docker for both development and production ? I like to ask you a few questions
[12:40:20] norc: axilla: And that is why patching services as quickly as possible is extremely important because people *will* scan the internet for vunlerable services.. constantly.
[12:40:48] Axilla: i've been a dev for a long time, and done devops, but have never been the guy that monitors this stuff.. so its kind of eye opening.
[12:40:51] norc: axilla: For the graph note that this is for the ports that are used for Cisco VPN. ;-)
[12:41:00] tknz: has joined #RubyOnRails
[12:41:17] King_Rex: has joined #RubyOnRails
[12:41:20] elomatreb: axilla: Even more interesting is looking at SSH auth logs (at least if it's running on port 22)
[12:42:49] emilkarl: has joined #RubyOnRails
[12:46:19] c355E3B: has joined #RubyOnRails
[12:47:41] Circuit8: Hey guys, `redirect_to edit_product_path(@product)` is giving me an error `No route matches {:action=>"edit", :controller=>"products", :shopify_id=>""} missing required keys: [:shopify_id]`... Its strange because when I call `edit_product_path(@product)` in a view it works perfectly and generates a route that works (by the way to_param is set to shopify_id). Any ideas?
[12:48:27] sevenseacat: Circuit8: please gist the full error with backtrace
[12:49:33] sk0r: has joined #RubyOnRails
[12:50:16] Skelz0r: has joined #RubyOnRails
[12:50:35] Circuit8: sevenseacat: thanks :), here it is: https://gist.github.com/Circuit8/0ddd43e4a2c793c20567e12400b44255
[12:51:38] sevenseacat: so what is the shopify_id of the @product being updated?
[12:51:41] elomatreb: Protip: Gists can have more than one file. There's a "Add file" button at the bottom
[12:52:12] Malgorath: has joined #RubyOnRails
[12:52:26] Circuit8: sevenseacat: Its the same one thats being sent in the params
[12:52:31] Circuit8: elomatreb: Thanks
[12:53:02] Circuit8: sevenseacat: let me see...
[12:53:38] Malgorath: Howdy all. Hope everyone is having a good day
[12:55:19] Sylario: I do change an attribute & save -> perform a test on a children -> chidren changed and saved. I added a test on the children before changing the attribute, but now the children see the old attribute, except if i do a reload before test
[12:55:45] artto: Circuit8: what's the URL for this request?
[12:55:54] Circuit8: sevenseacat: Ah I think I see the issue
[12:56:11] Sylario: So it works, but it mean children has a memory version of the attribute independently, does using reload mean bad smell code?
[12:56:12] Circuit8: sevenseacat: I've got some funky shit going on with my params, it seems like thats the cause, thanks alot!
[12:56:20] Circuit8: artto: I think I've sorted it thanks
[12:56:41] Circuit8: sevenseacat: Just out of interest how did you know that was the issue?
[12:56:57] gremly: has joined #RubyOnRails
[12:57:00] Wolland: has joined #RubyOnRails
[12:57:12] emachnic: has joined #RubyOnRails
[12:57:38] sevenseacat: just from the error message - my initial thought was that the error was coming from the page being redirected to, but that wasnt the case
[12:58:13] emachnic: has joined #RubyOnRails
[13:00:11] banister: has joined #RubyOnRails
[13:00:34] Circuit8: sevenseacat: OK thanks
[13:03:09] TheMonster: has joined #RubyOnRails
[13:03:23] dionysus69: has joined #RubyOnRails
[13:03:29] arup_r: has joined #RubyOnRails
[13:04:28] davidklsn: has joined #RubyOnRails
[13:05:04] ramortegui: has joined #RubyOnRails
[13:05:43] TheMonster: I can say has_many :projects, through: :companies then say person.projects to get all projects of all companies. Is there a way to do a query person.companies.projects without that has_many?
[13:06:32] truenito: has joined #RubyOnRails
[13:07:01] benlieb: has joined #RubyOnRails
[13:10:42] aegis3121: has joined #RubyOnRails
[13:10:48] chouhoulis: has joined #RubyOnRails
[13:14:34] macsteps: has joined #RubyOnRails
[13:17:24] k3rn31: has joined #RubyOnRails
[13:19:07] rubyonrails008: has joined #RubyOnRails
[13:24:25] mdw: has joined #RubyOnRails
[13:25:10] mdw: has joined #RubyOnRails
[13:27:37] diegoviola: has joined #RubyOnRails
[13:27:43] rubyhatesme: has joined #RubyOnRails
[13:28:01] macsteps: has joined #RubyOnRails
[13:29:11] lxsameer: has joined #RubyOnRails
[13:29:49] axxyhtrx: has joined #RubyOnRails
[13:30:58] kgrz: has joined #RubyOnRails
[13:32:30] mdw: has joined #RubyOnRails
[13:32:59] gingray: has joined #RubyOnRails
[13:34:03] sleungcy: has joined #RubyOnRails
[13:34:08] Axy: has joined #RubyOnRails
[13:35:05] emachnic: has joined #RubyOnRails
[13:36:10] pawnbox: has joined #RubyOnRails
[13:37:45] yutu: has joined #RubyOnRails
[13:39:06] yutu: Question about rails and concerns
[13:39:15] norc: yutu: dont use concerns.
[13:39:19] norc: question answered. next customer please.
[13:39:29] yutu: a concern for models
[13:39:51] yutu: wait the question may be the concern is not the appropriated solution ...
[13:40:08] dcluna: has joined #RubyOnRails
[13:40:12] yutu: I have a very simple concern to do logical deletion
[13:42:07] yutu: with a column canceled_at that is nil when NOT canceled and with a Time if canceled ... it works. Now I would like to cancel some associated instances on which I call cancel!
[13:43:00] tbuehlmann: sounds like a concern (or what it is: module) would work for that
[13:43:10] yutu: so for it I added a method cancel_cascade in my class_methods block of my concern
[13:43:31] yellow5: has joined #RubyOnRails
[13:44:17] yutu: In this method I set a class variable getting the values from what is declared in the model, by example cancel_cascade :a, :b
[13:44:28] norc: yutu: Generally keep your fingers away from concerns. A simple module with include is fine.
[13:45:51] yutu: then I have a cancel! method in my included block doing the job where I read the class variable set before.
[13:47:10] alfiemax: has joined #RubyOnRails
[13:47:30] norc: yutu: Just gist your concern.
[13:47:59] achamian: has joined #RubyOnRails
[13:48:35] yutu: If I do my_model.cancel! (with "declared" in the model cancel_cascade :a, :b). It cancels my_model as expected, then call cancel on my_model.a but the class variable still contains [:a, :b] even if nothing is declared about cancel_cascade on model A
[13:48:46] yutu: Will gist the concern :)
[13:49:45] yutu: https://gist.github.com/anonymous/18dfe6e730d487f3a8e7133b431b2a93
[13:53:14] yutu: may be using a class variable is not the best way to do it ... don't know
[13:53:29] sergey_makagon: has joined #RubyOnRails
[13:54:06] tbuehlmann: norc: are you talking about app/models/concerns or ActiveSupport::Concern?
[13:54:19] norc: tbuehlmann: ActiveSupport::Concern
[13:54:33] norc: yutu: Generally class level methods are a bad idea for many reasons.
[13:54:36] norc: *class level variables
[13:55:05] norc: yutu: If you have a multiple process solution, then the state wont be shared. If you have a multi threaded solution, you need to use thread-safe containers.
[13:55:29] tbuehlmann: yutu: just to be clear, I was talking about having a module in app/models/concerns as a place for shared/similar behaviour
[13:55:46] tbuehlmann: that can be a module and/or a module extending ActiveSupport::Concern, I personally am okay with that
[13:56:51] epochwolf: ... This application has both selenium and capybara-webkit.
[13:57:35] workmad3: epochwolf: I've done that before, so I could switch driver with an environment variable (e.g. turn on selenium for a client demo so they could see their app being used by the test suite)
[13:59:04] Wolland: has joined #RubyOnRails
[14:01:32] Macaveli: has joined #RubyOnRails
[14:02:05] banister: has joined #RubyOnRails
[14:02:50] ksoze: has joined #RubyOnRails
[14:02:52] dionysus70: has joined #RubyOnRails
[14:02:55] jerematic: has joined #RubyOnRails
[14:03:35] maya-migo: has joined #RubyOnRails
[14:05:11] rodfersou: has joined #RubyOnRails
[14:06:49] kgrz: has joined #RubyOnRails
[14:08:08] jhack: has joined #RubyOnRails
[14:08:18] epochwolf: workmad3: yeah... this is both being used in the test suite.
[14:09:34] jhack_: has joined #RubyOnRails
[14:12:06] kgrz: has joined #RubyOnRails
[14:14:49] tennis: has left #RubyOnRails: ("Leaving")
[14:15:53] mostlybadfly: has joined #RubyOnRails
[14:17:54] pawnbox: has joined #RubyOnRails
[14:19:09] clandry94: has joined #RubyOnRails
[14:22:57] kies: has joined #RubyOnRails
[14:23:56] helpa: has joined #RubyOnRails
[14:24:02] frem_: has joined #RubyOnRails
[14:24:12] JesseH: has joined #RubyOnRails
[14:24:40] clandry94: has joined #RubyOnRails
[14:25:49] harai: has joined #RubyOnRails
[14:28:35] sleungcy: has joined #RubyOnRails
[14:28:43] marahin: has left #RubyOnRails: ("WeeChat 1.5")
[14:32:32] cschneid: has joined #RubyOnRails
[14:32:58] lxsameer: has joined #RubyOnRails
[14:35:35] cschneid: has joined #RubyOnRails
[14:35:36] banister_: has joined #RubyOnRails
[14:36:01] eserror_: has joined #RubyOnRails
[14:36:36] agent_white: has joined #RubyOnRails
[14:38:37] fmcgeough: has joined #RubyOnRails
[14:42:29] Leepoff: has joined #RubyOnRails
[14:42:58] polishdub: has joined #RubyOnRails
[14:43:24] adavia: has joined #RubyOnRails
[14:43:51] harfangk: has joined #RubyOnRails
[14:44:07] prithaj: has joined #RubyOnRails
[14:46:48] urbanmonk: has joined #RubyOnRails
[14:48:11] maya-migo: has joined #RubyOnRails
[14:48:19] alfiemax: i'm getting an error like : `uninitialized constant ActionView::CompiledTemplates::GOOGLE_MAP_API_KEY` in my view
[14:48:20] cd83x: has joined #RubyOnRails
[14:48:35] alfiemax: this is the line that's causing the error : `%script{src: "https://maps.googleapis.com/maps/api/js?key=#{ENV[GOOGLE_MAP_API_KEY]}"}`
[14:48:49] alfiemax: isn't it possible to use or access ENV vars from views?
[14:48:51] universa1: alfiemax: ok, look closely at that line.
[14:49:07] universa1: alfiemax: and compare it with the error
[14:49:18] universa1: alfiemax: do you notice something
[14:49:56] jamey-uk: has joined #RubyOnRails
[14:50:28] alfiemax: universa1, yeah, i think the curly-braces are causing the issue
[14:50:29] dopamean_: has joined #RubyOnRails
[14:50:35] universa1: alfiemax: o0, no.
[14:50:45] universa1: alfiemax: what does the error say?
[14:51:11] alfiemax: that the constant isn't defined
[14:51:21] universa1: alfiemax: ohhh!
[14:51:52] jamey-uk: I'm trying to get my head around a has_many through (many-to-many) relationship I have setup with my models. I have User, Skill and UserSkill is the join model. I have one extra attribute on the join model ("level"). I can access the skills either through `user.skills` or `user.user_skills`. It seems a little redundant to me. Is there a way to set it up so `user.user_skills` is accessible through `user.skills` instead?
[14:52:21] universa1: alfiemax: http://heeeeeeeey.com/ (chuckle)
[14:52:33] sevenseacat: jamey-uk: well they dont access the same thing
[14:52:45] sevenseacat: user.skills would give you the skills, user.user_skills would give you the UserSkills
[14:52:45] jamey-uk: sevenseacat: yeah I understand that, just the naming convention is confusing me
[14:53:10] TheMonster: I can say has_many :projects, through: :companies then say person.projects to get all projects of all companies. Is there a way to do a query person.companies.projects without that has_many?
[14:53:16] jamey-uk: sevenseacat: but logically, to me, it would be better for user.skills to give me what user.user_skills currently does
[14:53:20] DacHoliday: has joined #RubyOnRails
[14:53:28] alfiemax: universa1, can't believe i missed that :)
[14:53:30] sevenseacat: jamey-uk: you can do that, but I think that would be more confusing to call something like user.skills.first.skill to get the *actual* skill
[14:53:35] lupine: unless there are extra attributes in the ?users_skills table, probably best to pretend it doesn't exist
[14:53:43] sevenseacat: lupine: there is an extra attribute
[14:54:03] jamey-uk: sevenseacat: so I guess if I could come up with a better name than "user_skills" but I suppose that's the problem, then it becomes even more confusing later on
[14:54:08] DacHoliday: Does anyone know how to get Foundation's Switch to work with a boolean on a Rails form?
[14:54:30] sevenseacat: jamey-uk: skill_levels maybe?
[14:54:42] jamey-uk: sevenseacat: ah! you're the best
[14:55:09] sevenseacat: good names can really improve the readability and understandability, as you're finding now :)
[14:55:34] jamey-uk: sevenseacat: yes :) I've always been a stickler for good semantic naming
[14:56:20] sevenseacat: you're welcome :)
[14:59:53] Wolland: has joined #RubyOnRails
[15:05:20] jhack: has joined #RubyOnRails
[15:05:26] yellow5: has joined #RubyOnRails
[15:07:37] kgrz: has joined #RubyOnRails
[15:09:52] jtong: has joined #RubyOnRails
[15:10:25] jtong: does anyone know how i can check if rails s is running on a specific terminal tab (this is so i can write a bash script)
[15:10:58] jtong: like how i can set an environment variable or bash function that checks if something like (rails s or ember s is running)
[15:11:13] universa1: jtong: psgrep rails ?
[15:11:16] DacHoliday: ps aux |grep rails s'
[15:11:33] jtong: but that looks at all processes across all terminal tabs
[15:11:48] jtong: like is there a way to look at if that specific terminal tab is busy with the rails s?
[15:11:54] chouhoulis: has joined #RubyOnRails
[15:12:22] universa1: jtong: possible, i guess. but easy? probably not. what is your original intention behind this?
[15:13:08] jtong: i am using iterm and want a badge to show the folder name if a "busy" process is taking up that terminal tab
[15:13:27] jtong: so when i look through my tabs (which i have multiple rails servers running for different apps) i can tell which one it is
[15:14:11] universa1: jtong: alias railsswithbadge = "set ITERM_BADGE=FOO; rails s" (fake obviously)
[15:15:21] IFrank00: has joined #RubyOnRails
[15:15:21] IFrank004: has joined #RubyOnRails
[15:16:20] Hennie: has joined #RubyOnRails
[15:17:06] msyvich: has joined #RubyOnRails
[15:18:05] chopin: has joined #RubyOnRails
[15:18:17] disgrntld: has joined #RubyOnRails
[15:22:43] sleungcy: has joined #RubyOnRails
[15:22:57] jhack: has joined #RubyOnRails
[15:24:43] tildes_: has joined #RubyOnRails
[15:25:37] borodin: has joined #RubyOnRails
[15:26:32] rubyonrails9083: has joined #RubyOnRails
[15:27:42] soroot: has joined #RubyOnRails
[15:28:07] rubyonrails9083: I'm trying to pull some data from a json feed, https://gist.github.com/rivacom/3d9185044a7308805395c9311532b748 but i keep getting TypeError: no implicit conversion of String into Integer which I know has to do with it being a array, but I can't figure out how to get this to work
[15:29:00] universa1: rubyonrails9083: !gist-usage
[15:29:00] helpa: rubyonrails9083: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[15:29:14] universa1: rubyonrails9083: where is the json? where is the error trace? ...
[15:29:33] Leepoff: has joined #RubyOnRails
[15:31:24] aegis3121: has joined #RubyOnRails
[15:32:37] jamey-uk: has left #RubyOnRails: ()
[15:33:00] rubyonrails9083: https://api.xcausxn.com/v1/overwatch/profile?platform=pc&region=us&profile=Riva-11618 that is the full path to the json
[15:33:10] universa1: rubyonrails9083: add it to the gist.
[15:34:39] rubyonrails9083: https://gist.github.com/rivacom/b5388bc4f9f6da2a4d2758d60f36c384 theres the trace
[15:35:14] universa1: rubyonrails9083: add it all to ONE gist... different links makes it harder to look at it.
[15:35:42] universa1: rubyonrails9083: but the error is, you are trying to access an array with a string index!
[15:35:58] universa1: rubyonrails9083: [1,2,3]["foo"] <-- does not work. this is your basic problem.
[15:36:35] rubyonrails9083: https://gist.github.com/rivacom/b56daced1053cf1263859e87e7c394d0
[15:37:12] JohnBat26: has joined #RubyOnRails
[15:37:25] rubyonrails9083: Understood but my json wins = response['careerStats']['ALL HEROES']['Game']['Games Won'] is only 1 value per each loop
[15:38:30] universa1: rubyonrails9083: nope.
[15:38:37] universa1: rubyonrails9083: https://gist.github.com/rivacom/b56daced1053cf1263859e87e7c394d0#file-json-feed-data-L706
[15:38:51] universa1: json[careeer][allheroes] is an array.
[15:42:37] chouhoulis: has joined #RubyOnRails
[15:43:48] hobodave: has joined #RubyOnRails
[15:45:04] jancel: has joined #RubyOnRails
[15:45:47] yfeldblum: has joined #RubyOnRails
[15:47:23] kgrz: has joined #RubyOnRails
[15:49:35] diegoaguilar: has joined #RubyOnRails
[15:51:20] triangles: has joined #RubyOnRails
[15:51:41] davidw: has joined #RubyOnRails
[15:53:34] rubyonrails9083: so how would i get the value from Games Won?
[15:54:06] universa1: rubyonrails9083: well, you probably need to find the element you want from the array first.
[15:55:07] universa1: rubyonrails9083: split your long response[][][][][] ... into parts
[15:55:27] universa1: rubyonrails9083: and select at each step what you want.
[15:56:25] noobsu: has joined #RubyOnRails
[15:56:59] universa1: ok gtg, but this boils done to some basic array select, hash access .
[15:57:20] definiv: has joined #RubyOnRails
[16:00:34] Wolland: has joined #RubyOnRails
[16:00:35] havenwood: rubyonrails9083: What should `x` be to correspond to the index that returns `"sekret"` with this example?: ['waffles', 'cake', 'sekret', 'pancakes'][x]
[16:01:57] definiv: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[16:02:00] havenwood: rubyonrails9083: Yup! But if you used a String instead it's complain about no implicit conversion from String to Integer. Because it expects an Integer corresponding to an index.
[16:02:40] havenwood: rubyonrails9083: If you're using very recent Ruby, #dig is handy for accessing nested values.
[16:02:44] phrozen77: has joined #RubyOnRails
[16:03:00] rubyonrails9083: I think im confusing myself with how I use to do it with Php where is [][][][][this] would return the value in this
[16:03:38] havenwood: rubyonrails9083: Here's an example: {an_array: ['zero', 'one', {aim: true, good: :morning}]}.dig(:an_array, 2, :good) #=> :morning
[16:06:37] Cohedrin: has joined #RubyOnRails
[16:07:29] nettoweb: has joined #RubyOnRails
[16:07:35] rubyonrails9083: so in my case where wins = response['careerStats']['ALL HEROES']['Game']['Games Won'] , ALL HEROES is under careerStats, and game under All HEROES. Can I do ['Games Won'].dig(wins, 3) ?
[16:09:29] mrgreenfur: has joined #RubyOnRails
[16:10:09] dionysus69: has joined #RubyOnRails
[16:10:56] tjbiddle: has joined #RubyOnRails
[16:13:53] yellow5: has joined #RubyOnRails
[16:15:32] tjbiddle_: has joined #RubyOnRails
[16:15:33] djbkd: has joined #RubyOnRails
[16:16:51] sleungcy: has joined #RubyOnRails
[16:17:49] kgrz: has joined #RubyOnRails
[16:18:57] DacHoliday: has left #RubyOnRails: ()
[16:21:04] jhack: has joined #RubyOnRails
[16:21:29] d1rewolf: has joined #RubyOnRails
[16:21:42] artto: has joined #RubyOnRails
[16:21:58] d1rewolf: all, when using rails_admin, what controls what values are searched when searching associations in the multi-select widget?
[16:22:15] d1rewolf: for example, I have a user which has_many departments
[16:22:43] d1rewolf: when I go the edit screen in rails_admin, I see the departments select widget, but it only searches on the id of the department
[16:23:08] d1rewolf: correction, name and id
[16:23:16] d1rewolf: I'd like it to search on a different value
[16:25:27] adgtl: has joined #RubyOnRails
[16:30:05] sypheren: has joined #RubyOnRails
[16:33:38] arBmind: has joined #RubyOnRails
[16:36:24] pawnbox: has joined #RubyOnRails
[16:37:41] [Butch]: has joined #RubyOnRails
[16:41:29] [Butch]_: has joined #RubyOnRails
[16:41:42] rakm: has joined #RubyOnRails
[16:41:43] phredus: has joined #RubyOnRails
[16:44:16] mrgreenfur: has joined #RubyOnRails
[16:44:17] manfrin: has joined #RubyOnRails
[16:44:27] Cache_Money: has joined #RubyOnRails
[16:45:45] flashpoint9: has joined #RubyOnRails
[16:46:28] sumobob: has joined #RubyOnRails
[16:47:36] whathappens: has joined #RubyOnRails
[16:48:10] diegoviola: has joined #RubyOnRails
[16:48:34] jtong: has joined #RubyOnRails
[16:50:25] sypheren: has joined #RubyOnRails
[16:51:21] Leepoff: has joined #RubyOnRails
[16:51:22] dorje_: has joined #RubyOnRails
[17:01:22] Wolland: has joined #RubyOnRails
[17:01:24] shinnya: has joined #RubyOnRails
[17:02:35] blockchan: has joined #RubyOnRails
[17:02:52] wldcordeiro: has joined #RubyOnRails
[17:06:59] plll: has joined #RubyOnRails
[17:08:39] djbkd: has joined #RubyOnRails
[17:10:48] sleungcy: has joined #RubyOnRails
[17:12:44] blackmesa: has joined #RubyOnRails
[17:15:22] mikecmpbll: has joined #RubyOnRails
[17:19:48] hahuang61: has joined #RubyOnRails
[17:23:44] edwinvdgraaf: has joined #RubyOnRails
[17:24:09] jancel: has joined #RubyOnRails
[17:24:34] aegis3121: has joined #RubyOnRails
[17:26:15] smathy: has joined #RubyOnRails
[17:29:14] eserror: has joined #RubyOnRails
[17:30:29] jtong: has joined #RubyOnRails
[17:31:26] yfeldblum: has joined #RubyOnRails
[17:32:24] Pumukel: has joined #RubyOnRails
[17:41:26] Coldblackice: has joined #RubyOnRails
[17:44:06] harai: has joined #RubyOnRails
[17:46:25] d5sx43: has joined #RubyOnRails
[17:48:27] sypheren: has joined #RubyOnRails
[17:49:03] alevy: has joined #RubyOnRails
[17:50:30] rubyonrails953: has joined #RubyOnRails
[17:50:48] ElFerna: has joined #RubyOnRails
[17:54:23] rubyonrails953: Hi guys, does anybody see me?
[17:54:24] harai: has joined #RubyOnRails
[17:54:28] fryguy: rubyonrails953: yes
[17:54:54] macsteps: has joined #RubyOnRails
[18:00:57] dionysus69: has joined #RubyOnRails
[18:02:15] Wolland: has joined #RubyOnRails
[18:03:56] rogue_koder: has joined #RubyOnRails
[18:06:25] mikecmpbll: has joined #RubyOnRails
[18:07:15] hahuang65: has joined #RubyOnRails
[18:08:01] netzfisch: has joined #RubyOnRails
[18:08:24] lxsameer: has joined #RubyOnRails
[18:08:29] sergio_101: has joined #RubyOnRails
[18:08:38] lopin: has joined #RubyOnRails
[18:09:48] hahuang61: has joined #RubyOnRails
[18:12:11] Technodrome: has joined #RubyOnRails
[18:12:37] achamian: has joined #RubyOnRails
[18:14:20] Dimik: has joined #RubyOnRails
[18:15:20] CBX: has joined #RubyOnRails
[18:15:48] lopin: has joined #RubyOnRails
[18:17:42] Doddlin: has joined #RubyOnRails
[18:23:29] blackmesa: has joined #RubyOnRails
[18:24:43] roelof: has joined #RubyOnRails
[18:25:50] roelof: Can someone recommend a good tutorial so I can learn to make a good rest-api engine
[18:26:13] Talltree: roelof codeacademy has one i think
[18:27:59] adre: has joined #RubyOnRails
[18:28:49] chipotle: has joined #RubyOnRails
[18:29:11] kies: has joined #RubyOnRails
[18:29:27] rubyscale: has joined #RubyOnRails
[18:30:28] roelof: Talltree: thanks I cannot find it at the moment
[18:32:39] Talltree: reolof https://www.codeschool.com/courses/surviving-apis-with-rails
[18:32:47] Talltree: meant that, sorry
[18:33:13] qejk: has joined #RubyOnRails
[18:36:37] lopin: has joined #RubyOnRails
[18:37:56] edwinvdgraaf: has joined #RubyOnRails
[18:39:29] jstransky: has joined #RubyOnRails
[18:40:24] jhack: has joined #RubyOnRails
[18:40:31] chouhoul_: has joined #RubyOnRails
[18:41:15] roelof: Talltree: thanks
[18:41:32] harai54: has joined #RubyOnRails
[18:42:36] [Butch]_: has joined #RubyOnRails
[18:42:51] sleungcy: has joined #RubyOnRails
[18:44:18] Talltree: well, i guess now i have to ask something, any recommended tutorial on deploying rails? :D
[18:44:41] gchristensen: has joined #RubyOnRails
[18:45:08] roelof: hae your tried Heroku for deploying ?
[18:46:45] Talltree: i'm not hosting on heroku
[18:47:05] jancel: has joined #RubyOnRails
[18:47:15] Talltree: i have a debian root that i use for some stuff.
[18:48:00] lopin: has joined #RubyOnRails
[18:48:18] roelof: What has a debian root to do with deploying a rails app
[18:48:30] gchristensen: Hi, I'm a contractor trying to relocate a RoR application from one server to another. I'm trying to setup a dev instance to get a feel for its requirements and what-not and make sure I can set it up to work elsewhere before touching production. One page has an error and a stack trace: "ERROR Rack::Lint::LintError: The file identified by body.to_path does not exist" which I'm only finding one search
[18:48:32] gchristensen: result on, and it isn't even so helpful (https://github.com/livingsocial/rake-pipeline/issues/131) Anyone have tips what this error might mean? or if it is on the incoming processing of the request or outgoing processing of the result? Not sure where to start here.
[18:50:02] DoctorMonocular: has joined #RubyOnRails
[18:50:55] matthewd: gchristensen: The application is attempting to send you a file it thinks is present in the server's local filesystem, but it's not there
[18:52:08] djbkd: has joined #RubyOnRails
[18:53:31] soroot: has joined #RubyOnRails
[18:54:05] dionysus69: has joined #RubyOnRails
[18:59:36] blockchan: has joined #RubyOnRails
[19:00:09] DoctorMonocular: I have an issue that I can't seem to google -- I'm trying to run a feature spec for the first time, and I
[19:00:54] DoctorMonocular: m getting an error message: `application_root_path': Spring was unable to find your config/application.rb file. Your project root was detected at /Users/pete/Projects/code/gyro/spec/features, so spring looked for /Users/pete/Projects/code/gyro/spec/features/config/application.rb but it doesn't exist. You can configure the root of your application by setting Spring.application_root in config/spring.rb
[19:00:54] DoctorMonocular: . (Spring::MissingApplication)
[19:01:08] choke: has joined #RubyOnRails
[19:01:23] DoctorMonocular: I've tried the thing that seems vaguely related which was reinstalling spring's binstub thing, but it didn't change the message
[19:01:39] DoctorMonocular: I'm not sure if it's an error for it to be looking in spec/features for the app root
[19:01:42] DoctorMonocular: but it seems like it is
[19:01:46] alfiemax: has joined #RubyOnRails
[19:02:27] DoctorMonocular: and I don't know how to fix it, or what else to even try
[19:02:48] Wolland: has joined #RubyOnRails
[19:05:01] lopin: has joined #RubyOnRails
[19:05:29] matthewd: DoctorMonocular: cd ../..
[19:06:00] urbanmonk: has joined #RubyOnRails
[19:06:23] DoctorMonocular: matthewd: ok, a little more context? I run the spec from the root directory of the app, is that what you mean?
[19:07:12] codeshah: has joined #RubyOnRails
[19:07:19] gchristensen: matthewd: that makes sense, I think I understand now. There is a send_file in that controller. not sure why it is broken, but that I can work with. Thank you!
[19:07:36] roelof: someone who can tell if this is a good book for making api's on rails : http://apionrails.icalialabs.com/book
[19:07:50] matthewd: DoctorMonocular: That's what I'd try, yes. Not sure why spring thinks the deeper directory looks app-like.
[19:08:49] Talltree: roelof because i could deploy it to the debian root? Oo
[19:09:07] rueben_: has joined #RubyOnRails
[19:09:21] prestorium: has joined #RubyOnRails
[19:10:32] prestorium: hi all. I need to start my app whenever my server restarts. My app is *not* run by root. What is the common approach? I thought about supervisor + init.d, but it seems a little overpower. Puma + init.d, maybe?
[19:12:21] urbanmonk: has joined #RubyOnRails
[19:12:25] chopin: has joined #RubyOnRails
[19:12:43] yellow5: has joined #RubyOnRails
[19:12:55] roelof: Talltree: debian root of what ?
[19:13:16] branchini: has joined #RubyOnRails
[19:13:29] jenrzzz: has joined #RubyOnRails
[19:13:29] jenrzzz: has joined #RubyOnRails
[19:13:39] lopin: has joined #RubyOnRails
[19:13:58] Talltree: i dont understand the question, a root server, in a datacenter, with a gigabit connection, typical webhost, just not "managed" by someone else. managed by me.
[19:14:11] macsteps: has joined #RubyOnRails
[19:15:30] branchini: So, I feel like I am losing my mind. The general idea of what I am working on is that there are 2 different types of users, with a bunch of attributes that the other don't use about 20 different fields on each side. I posted in various places, and have it set up to use a polymorphic user model -also with devise. And the responses I got told me the proper way was to just have one user model, and all the nulls... This can't be
[19:16:06] djbkd: has joined #RubyOnRails
[19:23:06] whathapp_: has joined #RubyOnRails
[19:23:10] rakm: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[19:24:18] whathapp_: has joined #RubyOnRails
[19:25:13] whathapp_: has joined #RubyOnRails
[19:25:47] FailBit: has joined #RubyOnRails
[19:26:13] FailBit: https://gist.github.com/liamwhite/0c23ea05e64950e204bd9cd336624dd1 how can I convert this to upsert?
[19:26:56] FailBit: some profiling revealed that this was one of the slowest constants of my site
[19:27:27] prestorium: FailBit, what DB?
[19:27:31] prestorium: mysql, I assume
[19:27:39] FailBit: 9.5 is installed on production
[19:27:42] FailBit: so it has the new upsert stuff
[19:28:11] prestorium: FailBit, are you using the correct indexes? Do you have an explain of the SELECT query?
[19:28:27] prestorium: FailBit, https://explain.depesz.com/
[19:28:31] FailBit: the query itself is not slow per se, and yes the indexes are there
[19:28:44] FailBit: it's actually time spent in ruby (!)
[19:28:52] prestorium: and the SELECT query *is* using the indexes?
[19:29:00] FailBit: fine, fine, I'll post the explain
[19:30:34] FailBit: https://explain.depesz.com/s/awa
[19:30:48] k3rn31: has joined #RubyOnRails
[19:31:32] prestorium: FailBit, since your profiling says that it's ruby, the explain wasn't needed :) But if you can provide an EXPLAIN ANALYZE... :)
[19:31:50] prestorium: FailBit, 1 - try to change the params order: user_id before IP. I think it should use a better index.
[19:32:58] prestorium: FailBit, 2 - have you tried INSERT ... ON CONFLICT DO UPDATE SET updated_at = CURRENT_DATE, uses = uses + 1 ?
[19:33:41] rueben_: has joined #RubyOnRails
[19:33:49] FailBit: https://gist.github.com/liamwhite/e69c8e88526656c3b06f4ea527ee1d04
[19:33:55] FailBit: there's your explain analyze
[19:34:12] FailBit: https://gist.github.com/liamwhite/f961f4a55f118f30e5e011bcb6507680 this is why I believe it is ruby
[19:34:27] FailBit: 0.3 + 0.5 ≠ 5.5
[19:34:58] Technodrome: has joined #RubyOnRails
[19:35:08] prestorium: FailBit, is it slow on new records too?
[19:35:17] prestorium: or just on updates?
[19:35:42] FailBit: I assume it is slow on new records but I don't particularly care about that usecase because it will only happen once per new user ip
[19:35:57] FailBit: whereas this will happen once every pageload
[19:36:11] lightt: has joined #RubyOnRails
[19:39:02] AntiSpamMeta: has joined #RubyOnRails
[19:39:10] prestorium: FailBit, sorry. I have no idea
[19:39:26] smathy: branchini, make one user model with as little in it as possible to make auth work, then one or more other models with the other distinct attributes in them and a 1:1 between user and those other models, either with the fkey in the other models, or with a polymorphic association from user to the others.
[19:39:52] prestorium: FailBit, _maybe_ that INSERT .. ON CONFLICT DO UPDATE will solve your issue. But I suspect that it has more to do than that.
[19:40:17] lopin: has joined #RubyOnRails
[19:40:29] AntiSpamMeta: has joined #RubyOnRails
[19:40:36] prestorium: FailBit, have you tried something like begin; UserIp.create ; rescue; UserIp.update; end ?
[19:41:47] FailBit: I just want something that will minimize the amount of time spent in ruby and that's certainly not it (exceptions are slow)
[19:42:08] FailBit: I will try the on conflict stuff
[19:42:26] allcentu1: has joined #RubyOnRails
[19:43:10] polishdub: has joined #RubyOnRails
[19:43:31] rueben_: has joined #RubyOnRails
[19:44:51] FailBit: that needs a constraint of some sort
[19:44:59] FailBit: but I have to satisfy it using two columns
[19:46:51] lopin: has joined #RubyOnRails
[19:48:31] rueben_: has joined #RubyOnRails
[19:49:37] blackmesa: has joined #RubyOnRails
[19:52:09] cschneid: has joined #RubyOnRails
[19:52:15] cnk: has joined #RubyOnRails
[19:53:43] chopin: has joined #RubyOnRails
[19:54:58] flashpoint9: has joined #RubyOnRails
[19:55:35] [Butch]: has joined #RubyOnRails
[19:59:21] alaing_: has joined #RubyOnRails
[20:00:10] alaing: has joined #RubyOnRails
[20:00:23] rueben_: has joined #RubyOnRails
[20:01:32] DoctorMonocular: has joined #RubyOnRails
[20:01:33] DTZUBDUB: has joined #RubyOnRails
[20:01:34] alaing: hi i'm trying to setup docker for my rails app. I'm new to docker but wodered whether i should create my postgres db in a seperate docker container instead of it all in the same container as my rails app
[20:01:54] smathy: alaing, yes, that's the docker way.
[20:02:52] chopin: has joined #RubyOnRails
[20:02:55] alaing: smathy, i'm really struggling to get my head around docker, rails and my app
[20:03:35] Wolland: has joined #RubyOnRails
[20:04:00] FailBit: I recommend not containerizing until you need to deploy to production
[20:04:04] adre: has joined #RubyOnRails
[20:04:07] FailBit: it's a bit of a headache
[20:04:41] smathy: alaing, why are you using it then?
[20:05:23] dionysus69: has joined #RubyOnRails
[20:06:20] alaing: FailBit: I'm kind of at that stage, I've deployes my app on heroku as a proof of concept but not getting to a point that i need to start setup a more permanent solution that will eventually be on cloudformation
[20:07:33] mdw: has joined #RubyOnRails
[20:08:45] alaing: smathy, I've been told i need to setup as part of putting together a rails stack that will be on cloudformation
[20:09:27] alaing: I see there is an official docker rails image but i'm bit nervous to use it because it reckons there are issues with it https://hub.docker.com/r/library/rails/tags/
[20:09:56] smathy: alaing, you have been told? So this is for your employer, and your employer doesn't care that you have no experience with docker?
[20:11:12] alaing: smathy yes but i'm seeing it as a bit of a learning opportunity
[20:12:03] alaing: there is a couple other projects that have a dockerfile but they all seem to have variations
[20:12:28] alaing: I might hangout in #docker
[20:14:34] dorje: has joined #RubyOnRails
[20:14:37] achamian: has joined #RubyOnRails
[20:15:09] ur5us: has joined #RubyOnRails
[20:15:47] srinidhi: has joined #RubyOnRails
[20:15:56] [Butch]: has joined #RubyOnRails
[20:17:00] alaing: thanks for your help and advice :-)
[20:17:10] alaing: still one of the best channels on freenode
[20:18:12] smathy: "one of" - pfft ;)
[20:19:33] adaedra: Don't be jealous of #ruby :p
[20:22:35] duncannz: has joined #RubyOnRails
[20:23:15] duncannz: has joined #RubyOnRails
[20:24:07] duncannz: has joined #RubyOnRails
[20:24:35] duncannz: has joined #RubyOnRails
[20:25:11] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[20:25:45] yatish27: has joined #RubyOnRails
[20:28:26] duderonomy: has joined #RubyOnRails
[20:28:48] allcentury: has joined #RubyOnRails
[20:31:11] tercenya: has joined #RubyOnRails
[20:31:26] dorje: has joined #RubyOnRails
[20:32:20] codeshah: has joined #RubyOnRails
[20:34:17] diegoviola: has joined #RubyOnRails
[20:34:42] blackmesa: has joined #RubyOnRails
[20:35:27] roamingdog: has joined #RubyOnRails
[20:36:01] dorje: has joined #RubyOnRails
[20:41:02] jhack: has joined #RubyOnRails
[20:44:14] optikalmouse: has joined #RubyOnRails
[20:44:26] optikalmouse: are there alternatives to using ArraySerializer?
[20:44:36] optikalmouse: It's allocating waaaaay too many objects.
[20:47:25] bumao: has joined #RubyOnRails
[20:48:07] chipotle: has joined #RubyOnRails
[20:54:04] alaing: with docker is there a need deploy using for eg. capistrano
[20:54:20] Technodrome: has joined #RubyOnRails
[20:54:52] quazimodo: has joined #RubyOnRails
[20:55:14] context: you could use cap with docker if you wanted to
[20:55:26] context: not in the way you are thinking though
[20:55:39] art-solopov: has joined #RubyOnRails
[20:56:02] Technodrome: has joined #RubyOnRails
[20:56:28] agit0: has joined #RubyOnRails
[20:57:36] alaing: do you still have to rackup?
[21:01:03] jenrzzz_: has joined #RubyOnRails
[21:01:22] Jasaka: has joined #RubyOnRails
[21:02:32] SteenJobs: has joined #RubyOnRails
[21:02:56] noobsu: has joined #RubyOnRails
[21:03:21] artto: has joined #RubyOnRails
[21:04:22] Wolland: has joined #RubyOnRails
[21:06:16] solars: has joined #RubyOnRails
[21:06:41] diegoaguilar: has joined #RubyOnRails
[21:07:13] dorje: has joined #RubyOnRails
[21:08:51] claudevandort: has joined #RubyOnRails
[21:09:38] neanderslob: has joined #RubyOnRails
[21:19:48] jenrzzz: has joined #RubyOnRails
[21:19:48] jenrzzz: has joined #RubyOnRails
[21:20:22] harai54: has joined #RubyOnRails
[21:20:25] netzfisch: has joined #RubyOnRails
[21:23:47] cd83x: has joined #RubyOnRails
[21:25:08] bruce_lee: has joined #RubyOnRails
[21:25:14] bumao: has joined #RubyOnRails
[21:26:25] mdw: has joined #RubyOnRails
[21:27:42] mdw7: has joined #RubyOnRails
[21:28:18] Brando753-o_O_o: has joined #RubyOnRails
[21:29:56] flashpoint9: has joined #RubyOnRails
[21:32:44] Technodrome: has joined #RubyOnRails
[21:34:31] gingray: has joined #RubyOnRails
[21:35:30] superlou: has joined #RubyOnRails
[21:35:32] Cohedrin: has joined #RubyOnRails
[21:37:15] dorje: has joined #RubyOnRails
[21:40:27] mdw: has joined #RubyOnRails
[21:40:31] optikalmouse: has left #RubyOnRails: ()
[21:42:02] dblessing: has joined #RubyOnRails
[21:42:31] hahuang65: has joined #RubyOnRails
[21:43:10] Wolland: has joined #RubyOnRails
[21:43:12] TinkerTyper: has joined #RubyOnRails
[21:45:35] macsteps: has joined #RubyOnRails
[21:47:09] Xentil: has joined #RubyOnRails
[21:48:20] hahuang65: has joined #RubyOnRails
[21:51:21] lightt: has joined #RubyOnRails
[21:51:40] crova: has joined #RubyOnRails
[21:53:31] artto: has joined #RubyOnRails
[21:56:23] bumao: has joined #RubyOnRails
[21:58:28] hahuang65: has joined #RubyOnRails
[21:58:42] claudevandort: has joined #RubyOnRails
[21:59:13] ElFerna: has joined #RubyOnRails
[22:00:02] kallisti5: ok.. running into odd issue
[22:00:21] kallisti5: using grap microapi.. and trying to use resque-pool to manage our resque tasks
[22:00:28] claudevandort: Hi guys, I'm trying to use capistrano, it's my first time, can someone help me make it work? It seems like I have an authentication issue u_u
[22:00:57] kallisti5: I have config.paths.all and config.autoload_paths in application.rb to add app/api into my app
[22:01:14] kallisti5: it seems like resque-pool are missing those additions :-|
[22:01:15] Leepoff: has joined #RubyOnRails
[22:02:17] Wolland: claudevandort: you should gist your error/trace, config, etc.
[22:02:19] crova: greetings ! Anyone know how to ignore attributes while creating/updating records? I'm trying to parse an api answer and I can't predict the number of fields from one row to another, so I just want to parse fields that are always present in the api response
[22:02:27] highbass: has joined #RubyOnRails
[22:02:34] highbass: im a ruby newby ... had a qustion regarding "Asset Pipeline" ... for some reason when i do a precompile for assets it creates the assets in public/assets folder but it also removes some of the status assets in my project (assets it pulls from other folders) during precompilation... is this normal behaviour?
[22:02:36] kallisti5: http://pastebin.com/RxGbMy8g anyone see that before?
[22:03:35] Radar: kallisti5: it's the rules
[22:03:43] kallisti5: I checked topic and didn't see it
[22:03:53] Radar: kallisti5: First thing in the topic is "Rules: http://goo.gl/dgSj5 "
[22:04:04] kallisti5: doing devops I'm in a lot of channels that perfor different pastebin alternatives :-|
[22:04:05] Radar: kallisti5: !rule4
[22:04:05] helpa: kallisti5: Do not use any service that is not Pastie or Gist to post code. Pastebin, for example has a tiny font and it has ads on it which cause the page to load slowly. Other paste services generally look like crap.
[22:04:43] Radar: highbass: "status assets"? Did you have other files in `public/assets` before running that command?
[22:05:52] Radar: crova: You can use strong params so that you'd do something like params.require(:post).permit(:title, :body)
[22:05:53] highbass: Radar: i have static files in app/assets and no files in public/assets... after running precompile i have some files that get removed from app/assets and lot of files get generated in public/assets
[22:05:55] kallisti5: https://gist.github.com/avongluck-r1soft/68a3c899654dd030a2f8beb1f708885b
[22:06:06] Radar: crova: That would allow params[:post][:title] and params[:post][:body]
[22:06:10] bumao: has joined #RubyOnRails
[22:06:11] highbass: i use CDN assests_host field to define the CDN
[22:06:48] Radar: kallisti5: No need to add app/api to the load path, as everything in app/api already is
[22:07:04] Radar: kallisti5: My guess is that it's looking for a file called "api" to load the API constant.
[22:07:17] kallisti5: same error taking it out
[22:07:31] Radar: kallisti5: Do you get the same error running "rails server"?
[22:07:43] kallisti5: nope.. however maybe I do now after removing it :-)
[22:07:45] kallisti5: ACTION checks
[22:07:50] Radar: highbass: Asset precompilation should not be removing files from app/assets. Can you reproduce this issue in anew app?
[22:08:06] crova: Radar and if it stumbles upon a key on the hash that does not exist on the database, it will pass through?
[22:08:27] highbass: Radar: yes i was able to on new server ... using AWS autoscaling ... the verbose option doesn't give much info .
[22:08:34] Radar: crova: strong parameters will only accept the parameters that you specify
[22:08:51] Radar: highbass: Do you have an app which I can clone and look at?
[22:08:55] crova: I see, I'll give it a shot
[22:08:59] crova: thanks for the input
[22:09:00] highbass: Radar: they are all cofee files not sure if that makes a difference?
[22:09:07] kallisti5: Radar: app starts fine with the app/api inclusion commented out
[22:09:14] Radar: highbass: As I said before, "Asset precompilation should not be removing files from app/assets."
[22:09:19] Radar: kallisti5: I don't know without seeing more of the code.
[22:09:21] kallisti5: however, resque-pool still shows same error
[22:09:26] highbass: i won't be able to give code but i could screenshare
[22:09:54] highbass: not sure if i am being dumb... i assumed this wouldn't remove files ... having a hard time debugging why its happening
[22:09:55] Radar: highbass: Can't screenshare atm.
[22:10:54] kallisti5: Radar: I have a rakefile task that gets loaded before the resque jobs start... is there a way to append the paths there?
[22:11:09] kallisti5: (for app/api)
[22:11:11] gchristensen: has left #RubyOnRails: ("WeeChat 0.4.2")
[22:11:30] highbass: Radar: ill dig around till then
[22:11:34] highbass: thanks for your help
[22:11:45] maximumgeek: has joined #RubyOnRails
[22:15:00] maximumgeek: when running rails ... rspec .. the database.rb file is only reading the default section, and not test... am I missing something
[22:15:03] dorje: has joined #RubyOnRails
[22:15:13] achamian: has joined #RubyOnRails
[22:15:52] maximumgeek: Not sure where to look. It says the env in test in the rails_helper file, but still does not use the test section of the database config
[22:16:00] SteenJobs: has joined #RubyOnRails
[22:17:48] macsteps: has joined #RubyOnRails
[22:17:52] highbass: Radar: i believe since its coffee scripts ... they get compiled and merged into single JS file which is left in that folder .. and then its copied over to the public/assets directory
[22:18:07] highbass: so this might be normal behaviour.... however now i have issues with using this in AWS/CODEDeploy
[22:18:12] highbass: which breaks because directory structure is modified
[22:19:11] manfrin: has joined #RubyOnRails
[22:20:06] maximumgeek: Well, never mind.
[22:20:34] maximumgeek: needed to move ENV["RAILS_ENV"] ||= 'test' to the top of the spec_helper.rb file
[22:22:35] benlieb: has joined #RubyOnRails
[22:24:58] hahuang65: has joined #RubyOnRails
[22:25:56] wldcordeiro: has joined #RubyOnRails
[22:28:45] highbass: hmm seems like codedeploy doesn't break with removal of files
[22:28:49] highbass: all is good in the hood
[22:30:53] choke: has joined #RubyOnRails
[22:31:33] bumao: has joined #RubyOnRails
[22:38:22] mwlang: has joined #RubyOnRails
[22:40:38] mwlang: why is item.reload necessary for me in the add_item method just to see the item I just added to the list? https://gist.github.com/mwlang/f8cf5f3e1a021b94569740566cee6b89
[22:40:46] andybernard: has joined #RubyOnRails
[22:41:09] sleungcy: has joined #RubyOnRails
[22:41:29] benlieb: has joined #RubyOnRails
[22:44:38] mwlang: weird, works as expected with “<<“ but not with create. https://gist.github.com/mwlang/f8cf5f3e1a021b94569740566cee6b89
[22:45:16] jstransky: has joined #RubyOnRails
[22:46:45] highbass: Do i have to run assets:sync after assets:precompile to get them to upload to my S3 bucket? or is it automatically done on asset:precompile
[22:48:45] Jasaka: has joined #RubyOnRails
[22:51:45] Radar: highbass: that is not the normal behaviour of the asset:precompilation step. Please provide an app which reproduces this issue.
[22:52:29] Radar: mwlang: because you're not touching the items association there; you're touching another association
[22:55:28] mwlang: Radar: That doesn’t explain why “<<“’s behavior is different in this instance than create’s — I’m operating on same association in both instances.
[23:00:17] owenjones: has joined #RubyOnRails
[23:00:40] tildes_: has joined #RubyOnRails
[23:02:04] dorje: has joined #RubyOnRails
[23:04:46] kies: has joined #RubyOnRails
[23:05:10] edwinvdgraaf: has joined #RubyOnRails
[23:09:10] lxsameer: has joined #RubyOnRails
[23:09:35] Didac: has joined #RubyOnRails
[23:09:40] choke: has joined #RubyOnRails
[23:10:11] yfeldblum: has joined #RubyOnRails
[23:12:22] whathappens: has joined #RubyOnRails
[23:14:53] cd83x: has joined #RubyOnRails
[23:22:05] djbkd: has joined #RubyOnRails
[23:23:08] djbkd: has joined #RubyOnRails
[23:23:56] artto: has joined #RubyOnRails
[23:24:26] jstransky: has joined #RubyOnRails
[23:31:08] dandaman: has joined #RubyOnRails
[23:36:57] crova: I'm trying to save a long api return to my database. when creating/saving, it get stuck on the first attribute that he can't find to the database. How can I ignore those attributes? https://gist.github.com/crova/968b9e799aae8f29be43fca5bf2bbb0f
[23:39:26] quazimodo: has joined #RubyOnRails
[23:41:19] dalbuschat: has joined #RubyOnRails
[23:41:45] cnk: crova: Not clear what part is 'stuck' - is single_shoot getting the hash you expect?
[23:42:47] crova: yes, but my model does not have collumns for all keys on the hash
[23:43:11] crova: so once it finds one of those keys, it halts
[23:44:03] crova: I guess i'll just add the missing columns
[23:44:33] jstransky: has joined #RubyOnRails
[23:44:48] cnk: You could filter the parameters - just like you would in a controller
[23:45:14] crova: i place it on the model?
[23:45:50] cnk: I don't think you can actually use strong parameters - unless you figure out how to require it in the model
[23:46:48] crova: I'll try to work with all the keys while I search further, I'm still learning the basics on this
[23:46:52] crova: but thanks for the input
[23:47:08] cnk: http://stackoverflow.com/questions/7430343/ruby-easiest-way-to-filter-hash-keys
[23:47:15] cnk: look at the second answer
[23:47:34] cnk: #select may let you filter for just the keys you have defined
[23:48:44] diegoviola: has joined #RubyOnRails
[23:49:35] crova: yeah, that seems to be something helpful, thanks once more
[23:50:16] benlieb: has joined #RubyOnRails
[23:50:19] flashpoint9: has joined #RubyOnRails
[23:52:22] bmorrison: has joined #RubyOnRails
[23:56:29] rueben: has joined #RubyOnRails