« Back to channel list

#RubyOnRails - 07 July 2016

« Back 1 day Forward 1 day »
[00:02:33] Radar: sage advice
[00:02:37] triptec: has joined #RubyOnRails
[00:05:55] quazimodo: has joined #RubyOnRails
[00:07:18] tenzan: has joined #RubyOnRails
[00:07:30] jstransky: has joined #RubyOnRails
[00:11:36] eya: has joined #RubyOnRails
[00:16:25] pawnbox: has joined #RubyOnRails
[00:16:38] Darmani: https://gist.github.com/mfifth/2725fffcdcd3c37ff0cec247a66bcad9#file-show-html-erb
[00:16:58] Darmani: How do I write a collection with simple_form?
[00:17:09] Darmani: Google search didn't really help
[00:18:28] Ayey_: has joined #RubyOnRails
[00:18:29] pur3eval: has joined #RubyOnRails
[00:19:32] lxsameer: has joined #RubyOnRails
[00:20:58] chouhoulis: has joined #RubyOnRails
[00:29:34] Radar: Darmani: https://github.com/plataformatec/simple_form#collections
[00:29:45] Radar: Darmani: Except the value of `collection` there should be your array of variants.
[00:31:09] ekinmur: has joined #RubyOnRails
[00:31:41] Darmani: Radar: I did look at that... So it would look like... <%= f.input :size, collection: :sizes %> ?
[00:31:52] Radar: Darmani: collection: @sizes
[00:31:58] Radar: Darmani: Where @sizes is probably @shirt.variants
[00:32:09] Darmani: Radar: But sizes isn't a variable o.o
[00:32:19] Radar: Darmani: There's ways to fix that.
[00:32:39] Radar: You can probably do @shirt.variants
[00:33:18] Darmani: Radar: Where would that go within the form?
[00:33:21] Pupeno: has joined #RubyOnRails
[00:33:25] timdotrb: has joined #RubyOnRails
[00:33:39] Radar: <%= f.input :size, collection: @shirt.variants %>
[00:34:02] SteenJobs: has joined #RubyOnRails
[00:35:16] hubejea: has joined #RubyOnRails
[00:38:17] chipotle: has joined #RubyOnRails
[00:40:48] chouhoulis: has joined #RubyOnRails
[00:41:41] Darmani: Radar: Hmm. It just shows up as a text box
[00:42:10] Darmani: Never mind, I got it.
[00:42:18] macsteps: has joined #RubyOnRails
[00:42:20] Darmani: Thanks man ^.^
[00:43:56] asheinfeld: has joined #RubyOnRails
[00:46:44] pur3eval: has joined #RubyOnRails
[00:49:36] Darmani: Radar: Okay I got another one for you
[00:50:25] Darmani: I have more than one instance of a small shirt, so the option for "small" shows up more than once within the selection.
[00:51:23] Darmani: Anyone have any ideas?
[00:52:27] pawnbox: has joined #RubyOnRails
[00:52:49] neo_: has joined #RubyOnRails
[00:53:05] Radar: Darmani: Screenshot?
[00:53:22] Darmani: Radar: https://tshirtshop-mfifth.c9users.io/shirts/1
[00:53:51] Liothen: has joined #RubyOnRails
[00:53:53] Radar: Darmani: Show me the variant model please
[00:54:06] Radar: Darmani: I think the size / colour boxes should be combined into one
[00:54:14] Radar: So that it shows as Small / Red, Small / Green, Small / Blue
[00:54:37] Darmani: Radar: hm. That would be more accurate...
[00:55:00] Darmani: https://gist.github.com/mfifth/2725fffcdcd3c37ff0cec247a66bcad9
[00:55:09] Darmani: Radar: It's pretty empty
[00:56:10] Radar: Darmani: Hm... I want to know how it's displaying the "Small" text there. Any ideas?
[00:56:33] Darmani: Radar: The small text within the form?
[00:58:41] Darmani: Radar: I have two "variants" of that particular shirt model. They are two different colors but they are both "Small's".
[00:58:54] Radar: Darmani: Where do you enter "Small" though?
[00:59:06] Radar: Darmani: It would be helpful to see all the code for the app.
[00:59:24] arooni: has joined #RubyOnRails
[00:59:25] Darmani: Radar: Sorry sorry I didn't realize I needed everything.
[00:59:35] Darmani: Let me update the current Github version.
[01:01:02] fletch`: has joined #RubyOnRails
[01:01:08] fletch`: has left #RubyOnRails: ()
[01:03:09] flashpoint9: has joined #RubyOnRails
[01:04:09] flashpoint9: has joined #RubyOnRails
[01:04:19] arooni: has joined #RubyOnRails
[01:04:23] Darmani: Radar: Abracadabra!
[01:04:24] Darmani: https://github.com/mfifth/T-Shirt-Store/tree/july_6th_commit
[01:05:58] arooni-mobile: has joined #RubyOnRails
[01:09:03] Darmani: So if you login as an admin there's a way to create new shirts and variants of those shirts. I thought it would be simpler that way.
[01:09:52] Radar: <%= f.input :size, collection: @shirt.variants, label_method: :size %> found it.
[01:09:59] Radar: I didn't know you were using label_method
[01:10:15] Radar: I would do <%= f.input :variant_id, collection: @shirt.variants, label_method: :name %>
[01:11:16] Radar: So then it appears like this: https://monosnap.com/file/xwgA9fgednTMonXeBUJSSIM4iJ1rio
[01:11:48] Darmani: Radar: O.O
[01:12:27] Radar: Then the ID of whatever variant the user has selected is available in the add_shirt action as... I am not sure what.
[01:13:31] Radar: I think it would be better to use a standard form_tag here instead of simple_form_for because there's no object in particular you're building the form for
[01:13:41] Radar: like in the shirt form, you can use simple_form_for because it's a simple form for a shirt
[01:14:06] Radar: In this case of selecting a variant, the form isn't showing fields for a particular resource...
[01:14:31] arooni-mobile: has joined #RubyOnRails
[01:14:50] arooni: has joined #RubyOnRails
[01:14:55] Darmani: Radar: hmmmmmmm.
[01:15:05] Radar: https://gist.github.com/radar/ddf10b470f4ccfc1c6356a6a44810077
[01:15:10] Radar: That's one way to do it.
[01:15:56] flashpoint9: has joined #RubyOnRails
[01:16:43] Darmani: Radar: Alright I'll get to it.
[01:19:29] Ayey_: has joined #RubyOnRails
[01:20:56] akira616: has joined #RubyOnRails
[01:22:10] fletch`: has joined #RubyOnRails
[01:22:15] fletch`: has left #RubyOnRails: ()
[01:23:24] lxsameer: during assets precompile sprockets fails with "Encoding::InvalidByteSequenceError: "\xA9" on UTF-8", any idea how to find that unicode character ?
[01:23:26] jstransky: has joined #RubyOnRails
[01:23:28] rafaelfranca: has joined #RubyOnRails
[01:24:32] arooni-mobile: has joined #RubyOnRails
[01:24:42] SteenJobs: has joined #RubyOnRails
[01:24:51] arooni: has joined #RubyOnRails
[01:26:20] tweeeaks: is there any way to re-create fixture yamls based off the schema?
[01:30:56] Radar: tweeeaks: fixture yamls would contain data, whereas the schema is only what fields are in the table and so there is no data to build the fixture yamls.
[01:32:38] weaksauce: has joined #RubyOnRails
[01:33:14] tweeeaks: Radar: ya, currently the fixture yamls are empty, so looking for a way to populate the structure of the schema - same way the generator does
[01:34:07] Radar: tweeeaks: Any automated solution is going to populate it with a heap of junk data. I would recommend against doing such a thing.
[01:34:11] Pupeno: has joined #RubyOnRails
[01:34:16] Radar: Fixtures / factories built by hand tend to be easier to maintain
[01:34:26] tweeeaks: Radar: 10-4
[01:34:52] arooni: has joined #RubyOnRails
[01:34:55] arooni-mobile: has joined #RubyOnRails
[01:36:18] Darmani: Radar: Okay it's done using the Rails forms.
[01:36:40] Darmani: I still don't know how to what you want though. Merging those two categories together like that...
[01:37:06] Darmani: https://gist.github.com/mfifth/2725fffcdcd3c37ff0cec247a66bcad9#file-show-html-erb
[01:37:35] Radar: <%= collection_select(:size, :variant_id, @shirt.variants, :id, :name) %>
[01:37:36] Radar: Just that.
[01:37:47] Radar: Because someone will be picking a variant, which is a combination of size / colour
[01:38:21] Darmani: Wait, so you're saying I should rename the variants and call them "Small / Blue"?
[01:38:34] Radar: You already have a name field for variants. That's what should be displaying in the select box.
[01:39:09] Darmani: Radar: Well if we're doing it like that we don't even need fields for the size or the color we just need the name don't we?
[01:39:49] Radar: Darmani: yeah I guess it is a doubling up of information in that case and it's not yet currently useful to know the colours / sizes seperately.
[01:40:23] Darmani: Radar: Roger that.
[01:40:29] ekinmur: has joined #RubyOnRails
[01:40:46] roamingdog: has joined #RubyOnRails
[01:44:31] blackmesa: has joined #RubyOnRails
[01:45:04] arooni-mobile: has joined #RubyOnRails
[01:50:21] Darmani: Radar: <%= collection_select(:name, :variant_id, @shirt.variants, :id, :name), class: "collect" %>
[01:50:54] Darmani: I can't style it though. I get an error for having that "class" at the end :[
[01:51:26] timdotrb: has joined #RubyOnRails
[01:54:56] arooni: has joined #RubyOnRails
[01:55:08] arooni-mobile: has joined #RubyOnRails
[02:04:54] arooni-mobile: has joined #RubyOnRails
[02:04:57] arooni: has joined #RubyOnRails
[02:06:19] roamingdog: has joined #RubyOnRails
[02:09:44] Radar: Check your brackets.
[02:10:37] Pupeno: has joined #RubyOnRails
[02:12:21] jahbrewski: has joined #RubyOnRails
[02:13:51] sypheren: has joined #RubyOnRails
[02:15:10] arooni-mobile: has joined #RubyOnRails
[02:18:38] rafaelfranca: has joined #RubyOnRails
[02:18:38] rafaelfranca: has joined #RubyOnRails
[02:20:16] Ayey_: has joined #RubyOnRails
[02:22:58] lalalaaa: has joined #RubyOnRails
[02:23:30] lalalaaa: Radar, sevenseacat: Could I take over Forem?
[02:32:45] ur5us: has joined #RubyOnRails
[02:38:54] ElFerna: has joined #RubyOnRails
[02:47:08] Pupeno: has joined #RubyOnRails
[02:48:48] blackmesa: has joined #RubyOnRails
[02:52:54] triptec: has joined #RubyOnRails
[02:53:09] calmchaos: has joined #RubyOnRails
[02:54:51] pvertenten: has joined #RubyOnRails
[03:01:35] justrohu: has joined #RubyOnRails
[03:05:09] Rodya_: has joined #RubyOnRails
[03:08:32] justrohu: has joined #RubyOnRails
[03:08:46] arooni: has joined #RubyOnRails
[03:09:47] pvertenten: has joined #RubyOnRails
[03:13:18] fcser_: has joined #RubyOnRails
[03:15:19] arooni: has joined #RubyOnRails
[03:17:29] flashpoint9: has joined #RubyOnRails
[03:19:53] pawnbox: has joined #RubyOnRails
[03:20:16] pur3eval: has joined #RubyOnRails
[03:20:54] PotatoChipz: has joined #RubyOnRails
[03:20:59] Ayey_: has joined #RubyOnRails
[03:21:10] sevenseacat: has joined #RubyOnRails
[03:22:06] kevr: has joined #RubyOnRails
[03:22:45] akira616: has joined #RubyOnRails
[03:24:36] braincras: has joined #RubyOnRails
[03:25:20] arooni: has joined #RubyOnRails
[03:26:22] Radar: lalalaaa: https://github.com/rubysherpas/forem#no-longer-maintained
[03:32:39] dopamean_: has joined #RubyOnRails
[03:35:20] arooni: has joined #RubyOnRails
[03:35:36] Spami: has joined #RubyOnRails
[03:39:19] jahbrewski: has joined #RubyOnRails
[03:43:29] zacts: has joined #RubyOnRails
[03:46:09] Rodya_: has joined #RubyOnRails
[03:47:24] guest56: has joined #RubyOnRails
[03:48:14] Rodya_: has joined #RubyOnRails
[03:48:27] Spami: has joined #RubyOnRails
[03:48:38] Trynemjoel: has joined #RubyOnRails
[03:49:43] dtzuzu: has joined #RubyOnRails
[03:52:24] tjbiddle: has joined #RubyOnRails
[03:52:33] h7br1x: has joined #RubyOnRails
[03:52:38] calmchaos: has joined #RubyOnRails
[03:53:26] blackmesa: has joined #RubyOnRails
[03:54:15] jishankai: has joined #RubyOnRails
[03:54:58] h7br1x_: has joined #RubyOnRails
[03:56:24] Rodya_: has joined #RubyOnRails
[03:57:57] crystal77: has joined #RubyOnRails
[04:00:17] snowy: has joined #RubyOnRails
[04:05:36] xlegoman: has joined #RubyOnRails
[04:05:47] Rodya_: has joined #RubyOnRails
[04:06:53] xibalba: has joined #RubyOnRails
[04:17:37] mytrile: has joined #RubyOnRails
[04:19:20] Rodya_: has joined #RubyOnRails
[04:19:50] enitiz: has joined #RubyOnRails
[04:21:45] Ayey_: has joined #RubyOnRails
[04:25:39] hahuang61: has joined #RubyOnRails
[04:25:59] Liothen: has joined #RubyOnRails
[04:26:02] Liothen: has joined #RubyOnRails
[04:26:07] SteenJobs: has joined #RubyOnRails
[04:26:55] pawnbox: has joined #RubyOnRails
[04:27:42] max1: has joined #RubyOnRails
[04:29:29] Rodya_: has joined #RubyOnRails
[04:36:26] duncannz: has joined #RubyOnRails
[04:37:49] duncannz: has joined #RubyOnRails
[04:38:41] duncannz: has joined #RubyOnRails
[04:40:42] Rodya_: has joined #RubyOnRails
[04:40:49] Devalo: has joined #RubyOnRails
[04:41:20] banisterfiend: what exactly does the --database=postgresql flag do when creating a new rails app?
[04:44:05] Radar: banisterfiend: configures database.yml to use postgresql as the database, and also uses the `pg` gem in the Gemfile.
[04:45:26] guest56: has joined #RubyOnRails
[04:48:45] AndrewIsHere: has joined #RubyOnRails
[04:48:54] Pupeno: has joined #RubyOnRails
[04:49:53] rogue_koder: has joined #RubyOnRails
[04:51:42] Rodya_: has joined #RubyOnRails
[04:51:47] alfiemax: has joined #RubyOnRails
[04:55:14] blackmesa: has joined #RubyOnRails
[04:57:18] EasyCo: has joined #RubyOnRails
[04:57:24] zacts: has joined #RubyOnRails
[04:58:21] Atomic2: has joined #RubyOnRails
[05:00:55] pur3eval: has joined #RubyOnRails
[05:01:41] gambl0re: has joined #RubyOnRails
[05:01:41] gambl0re: has joined #RubyOnRails
[05:01:45] Devalo: has joined #RubyOnRails
[05:11:59] the_drow: has joined #RubyOnRails
[05:15:07] Rodya_: has joined #RubyOnRails
[05:16:11] fvthree: has joined #RubyOnRails
[05:16:14] pur3eval: has joined #RubyOnRails
[05:16:23] Macaveli: has joined #RubyOnRails
[05:16:52] fvthree: hi people, anyone know how to download all ruby gems
[05:17:12] fvthree: because i dont have internet connection at my place.
[05:17:25] roelof: has joined #RubyOnRails
[05:18:09] alfiemax: fvthree, all ruby gems?? like everything ???
[05:18:20] roelof: Is there a way I can check if a json request contains { , or [ . I try to validate it so it will not end up in the database
[05:18:49] flashpoint9: has joined #RubyOnRails
[05:19:18] roelof: I tried a regex and a json scheme but on both do not do the job. Or I see no error messages or things like "{test} " are validated which is wrong
[05:20:03] dtzuzu: has joined #RubyOnRails
[05:20:11] fvthree: alfiemax, if ever there is. maybe a zip file that contains most commonly used ruby gems
[05:20:52] Ropeney: has joined #RubyOnRails
[05:21:34] Radar: fvthree: define "Commonly used" :)
[05:21:41] Radar: fvthree: there's about 580gb of gems (iirc)
[05:22:08] fvthree: Radar, omg nvm. i just download manually
[05:22:17] Radar: Good idea.
[05:22:39] fvthree: it is just hard to find a ruby job here in our place
[05:22:45] Ayey_: has joined #RubyOnRails
[05:23:05] deecross: has joined #RubyOnRails
[05:23:34] roelof: fvthree: and where is our place for you ?
[05:24:12] fvthree: roelof what do u mean
[05:24:29] Radar: fvthree: where do you live?
[05:24:51] fvthree: i live in the Philippines
[05:26:16] hahuang61: has joined #RubyOnRails
[05:26:18] fvthree: what are the minimum skills needed to get an entry ruby level job?
[05:26:30] Radar: knowledge about Ruby
[05:27:01] Radar: That you understand the basic syntax of Ruby and you can build Ruby programs based on ideas that you have
[05:27:13] Radar: fvthree: The Well Grounded Rubyist book is good for learning how to do that.
[05:27:46] fvthree: ok thanks Radar!
[05:28:55] lessless: has joined #RubyOnRails
[05:29:17] EasyCo: Hey team, I'm looking at the most efficient way to join tables via polymorphic association. I'd really appreciate your input: https://gist.github.com/trev/09fa7be23421065a349275280cd2794a
[05:29:36] Radar: It isn't so Easy... Co.
[05:30:13] EasyCo: I see what you did there :)
[05:31:13] EasyCo: @Radar yeah, I've noticed that. Haha.
[05:33:42] Ropeney: Radar, 230gb of gems
[05:33:53] Radar: Ropeney: Is that all?
[05:34:41] Ropeney: sorry, 239gb with todays update
[05:34:48] EasyCo: I've just been basically stacking JOINS for every profileable type
[05:34:55] Ropeney: 3gb of gemspecs
[05:35:43] triptec: has joined #RubyOnRails
[05:38:12] roelof: Is there a way I can check if a json request contains { , or [ . I try to validate it so it will not end up in the database
[05:38:17] roelof: I tried a regex and a json scheme but on both do not do the job. Or I see no error messages or things like "{test} " are validated which is wrong
[05:38:29] Radar: roelof: !xy
[05:38:29] helpa: roelof: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[05:39:40] roelof: Radar: oke, how can I reprase it then so im asking about my problem
[05:39:53] roelof: I m reading that page now
[05:40:02] helpa: ¯\_(ツ)_/¯ Sorry, Radar is not able to help you any further as they do not know.
[05:40:26] Radar: There has to be a reason why you're doing that. That reason hasn't been explained yet. Hence why you got !xy'd.
[05:40:26] roelof: oke, lets try
[05:40:36] alfiemax: has joined #RubyOnRails
[05:40:37] utal: has joined #RubyOnRails
[05:40:52] roelof: im making a api where people can enter financial accounts
[05:41:18] roelof: now I want only that the name part is a string that does not contain [ , {
[05:41:23] TeaVirus: has joined #RubyOnRails
[05:41:33] roelof: I wonder what the best way to achieve this ?
[05:41:35] Radar: "name part"?
[05:42:00] rvanlieshout: has joined #RubyOnRails
[05:42:12] roelof: the financial account has a model name where the name of the account is mentioned
[05:42:19] Radar: Do you have an example?
[05:42:36] roelof: example of a json request ?
[05:42:38] fox_mulder_cp: roelof: gsub and regex?
[05:42:40] Radar: Of anything?
[05:42:52] Radar: roelof: I need to see some actual code/data to understand this I think
[05:46:07] matt_d: roelof: do you want to accept only validated, error free JSON before saving it to persistent storage?
[05:50:01] roelof: matt_d: yep, that is the idea that I try to make
[05:50:03] AndrewIsHere: has joined #RubyOnRails
[05:51:36] roelof: Radar: oke, let's say I have this json request to my api : curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -H "Postman-Token: 5c88a90e-8470-852e-074e-1a1eb1a8d56a" -d 'account[category]=Bezittingen langer dan 1 jaar&account[name]="test" ' "http://paytime-rails5-wissel.c9users.io/account/"
[05:51:39] ur5us: has joined #RubyOnRails
[05:52:05] dminuoso: has joined #RubyOnRails
[05:52:16] roelof: this one schould be stored in the database because the account[name] has no { [ or ,
[05:52:16] The_Phoenix: has joined #RubyOnRails
[05:52:25] roelof: Radar: so far so good ?
[05:52:49] Radar: roelof: yes
[05:52:49] watersoul: has joined #RubyOnRails
[05:52:51] lalalaaa: has joined #RubyOnRails
[05:52:54] Radar: roelof: So isn't this just a model validation?
[05:53:16] matt_d: roelof: the json-schema does what you're looking for. if i understand your issue.
[05:53:17] jiblet: has joined #RubyOnRails
[05:53:36] roelof: I think it is : the account model has two fields . Name and category
[05:54:03] Radar: validates :name, format: <some arcane regex goes here>
[05:54:44] roelof: I did that one validates :name :format /[a-zA-Z] , message : "illigial input"
[05:54:57] dionysus69: has joined #RubyOnRails
[05:55:19] roelof: but I do not see that message on the json output here : render json: { errors: @account.errors,status: 422}
[05:55:27] rvanlieshout: has joined #RubyOnRails
[05:55:47] Radar: What's the rest of the controller action?
[05:55:56] Radar: Did you attempt to save the record before displaying its errors?
[05:56:02] roelof: matt_d: I have now this code : https://gist.github.com/rwobben/153c0175e47f9755226e9ca68dea8b09
[05:56:23] roelof: but then "{test}" is also validated , which is wrong
[05:56:59] blackmesa: has joined #RubyOnRails
[05:57:00] Radar: roelof: Sounds like you need to write some tests for that validation.
[05:57:43] roelof: this is my controller : https://gist.github.com/rwobben/3677af190d864048a2df75c1a8fa6386
[05:57:52] roelof: Radar: ^^^^
[05:58:06] Radar: Ok, so yes you are doing that.
[05:58:09] Radar: [15:57:00] <Radar> roelof: Sounds like you need to write some tests for that validation.
[05:58:28] tego101: has joined #RubyOnRails
[05:58:55] roelof: oke, so make a custom validation function, Radar ?
[05:59:13] rafaelfr_: has joined #RubyOnRails
[05:59:17] Radar: roelof: That is not what I said.
[06:00:00] roelof: sorry, I have wrote some test and with the regex I do not see the custom error message so the test is failing
[06:00:21] yfeldblum: has joined #RubyOnRails
[06:02:01] yfeldblum: has joined #RubyOnRails
[06:03:03] roelof: at some wierd way I cannot place the message "Illigial input" into the json output, If I can do it , I would be very happy
[06:03:04] lalalaaa: Radar: Didn't a lot of maintainers volunteer?
[06:03:22] lalalaaa: Radar: Also, maybe development slowed down because Forem is already so perfect.
[06:03:38] Radar: lalalaaa: Read the README please.
[06:03:47] lalalaaa: Well, except for the changes I want to make to it. Clean its views, remove JS components etc.
[06:03:57] helpa: http://i.imgur.com/m9m3wr9.gif
[06:03:57] Radar: lalalaaa: Fork it and improve it then. rubysherpas/forem is dead.
[06:05:02] roelof: Radar: can I do something like this : render json: { errors: @account.errors, messages: message, status: 422} ?
[06:05:13] Radar: roelof: @account.errors should already contain the errors. If it's not, then something's wrong.
[06:05:40] Radar: roelof: As I have been recommending: write a test for the validation. Check that when you set account.name to an invalid value, that account.errors does indeed contain an error message
[06:05:45] Radar: I think that is the root of this problem.
[06:06:29] roelof: Radar: oke, I will go back to the regex idea and see if I can see the custom error message
[06:07:00] utal: has joined #RubyOnRails
[06:07:21] sevenseacat: oh man this problem is still going
[06:09:25] alfiemax: has joined #RubyOnRails
[06:09:28] baweaver: Also when using render json you need to keep status outside of the main hash
[06:09:43] baweaver: render json: message, status: :unprocessable_entity
[06:11:34] baweaver: the hash variant is because I really hate memorizing status codes, they feel like magic numbers so I tend to use the full text version when I can.
[06:11:42] baweaver: easier to read through later and understand as well.
[06:13:14] lalalaaa: Radar: Thredded is not a Forem fork right?
[06:13:27] Radar: lalalaaa: No, it is not a forem fork
[06:13:29] lalalaaa: Radar: And, apart from UI, does Thredded have anything Forem doesn't?
[06:13:43] Radar: lalalaaa: they are two separate projects
[06:13:51] Radar: its like asking if facebook and myspace are the same
[06:13:58] kevr: has joined #RubyOnRails
[06:14:10] lalalaaa: Just figured it might be a Spree fork like Solidus
[06:14:29] Radar: oh, no that's not the case at all
[06:14:32] lalalaaa: Either way you've been the top contributor and imho that's the most important thing
[06:14:42] pur3eval: has joined #RubyOnRails
[06:15:20] lalalaaa: I'm gonna fork Forem and clean it up
[06:15:28] lalalaaa: hopefully you'll make a comeback at some point
[06:15:38] Rodya_: has joined #RubyOnRails
[06:15:50] lalalaaa: http://motherfuckingwebsite.com/ => Forem v2
[06:16:02] rafaelfranca: has joined #RubyOnRails
[06:16:47] Ayey_: has joined #RubyOnRails
[06:17:06] zacts: has joined #RubyOnRails
[06:17:23] roelof: pff, syntax error here : validates :name, :format '/[a-zA-Z]/' , message : "iligale input" , the , after name is not good :(
[06:17:43] Radar: format: '/[a-zA-Z]/'
[06:17:46] Radar: and no quotes.
[06:20:40] roelof: oke, that part is working
[06:20:47] baweaver: and you spelled illegal wrong
[06:21:12] baweaver: also you really want to use a better message than that
[06:21:17] baweaver: illegal is vague
[06:21:31] Radar: "name should only contain alphanumeric characters"
[06:21:43] baweaver: well in this case alphabetical
[06:22:02] Oliphaunte: has joined #RubyOnRails
[06:22:04] dtzuzu: has joined #RubyOnRails
[06:24:26] moei: has joined #RubyOnRails
[06:25:32] roelof: oke, that is only for the test but no problem for another message
[06:26:21] Ponyo: has joined #RubyOnRails
[06:28:15] enitiz: has joined #RubyOnRails
[06:28:46] finnnnnnnnnnn: has joined #RubyOnRails
[06:29:26] dminuoso: has joined #RubyOnRails
[06:32:25] Guest: has joined #RubyOnRails
[06:32:33] DrYockel1: has joined #RubyOnRails
[06:32:42] DrYockel1: has left #RubyOnRails: ()
[06:32:46] roelof: Radar: still problems with the regex : When I do : validates :name, :format => {:with => /[A-Za-z]/},:message => "name should only contain alphanumeric characters"
[06:32:48] DrYockel1: has joined #RubyOnRails
[06:32:57] Radar: !validations
[06:32:57] helpa: The Active Record Validations Guide - http://guides.rubyonrails.org/active_record_validations.html - Written by Jaime Iniesta
[06:33:10] Radar: http://guides.rubyonrails.org/active_record_validations.html#format
[06:33:22] Radar: The example even shows you exactly what you want.
[06:33:40] Radar: Phew was in the wrong channel. TEST POST PLEASE IGNORE.
[06:34:32] roelof: I see this error message : Unknown validator: 'MessageValidator'
[06:34:54] aganov: has joined #RubyOnRails
[06:35:13] Radar: roelof: Please look at the docs I just linked.
[06:35:14] Radar: http://guides.rubyonrails.org/active_record_validations.html#format
[06:36:43] roelof: oke, and now some old test are failing, I have to see why
[06:36:45] arBmind: has joined #RubyOnRails
[06:37:15] conta: has joined #RubyOnRails
[06:37:16] the_drow: has joined #RubyOnRails
[06:37:44] dionysus69: please take a look at this. any hints appreciated. I am unable to submit images as a nested params, I am using cacoon and my log says <<< Unpermitted parameter: news_images >>> https://gist.github.com/webzorg/d1ca948c26a1940c7df4c58ab4f3c209
[06:38:16] dionysus69: submitted image is ending up to be a default > missing.png (using paperclip)
[06:38:18] Radar: dionysus69: Did you refresh your browser?
[06:38:21] SteenJobs: has joined #RubyOnRails
[06:38:31] calmchaos: has joined #RubyOnRails
[06:38:32] Radar: I can't see a reason for the attributes to come through as news_images_attributes other than a possibly cached form.
[06:38:33] dionysus69: well ye I restarted server cleared cache everywhere
[06:39:13] calmchaos: has joined #RubyOnRails
[06:39:50] dionysus69: I usually refresh page with ctrl + f5 which ignores cache
[06:39:56] alfiemax: has joined #RubyOnRails
[06:40:58] atomx: has joined #RubyOnRails
[06:41:58] roelof: very wierd, I have this as output : {:name=>"Example account", :category=>"Bezittingen langer dan 1 jaar"}
[06:42:32] roelof: and sending it to this validation : validates :name, :format => {:with => /[A-Za-z]/,:message => "name should only contain alphanumeric characters"}
[06:43:22] roelof: and I see the error message. but Example Account is only alphanumeric characters so it schould be valid
[06:43:30] Pazician: has joined #RubyOnRails
[06:43:32] Radar: roelof: Did you write some tests yet?
[06:44:00] roelof: yep, this is a old test which is failing , which has worked before
[06:45:37] GoranPavlovic: has joined #RubyOnRails
[06:45:58] triptec_: has joined #RubyOnRails
[06:46:11] mark_66: has joined #RubyOnRails
[06:47:26] mytrile: has left #RubyOnRails: ()
[06:48:35] ferr: has joined #RubyOnRails
[06:49:19] comrad: has joined #RubyOnRails
[06:50:05] ferr: Hey, I have local database in production server, but I need to import Users model from remote database. It's all fine with database.yml, but how would I configure my User model to be imported from remote?
[06:50:23] roelof: I think I see the problem, Im using Example Account which has a space in it. A space is not a alphanumeric character
[06:50:32] Radar: roelof: ding ding ding
[06:50:34] roelof: so I have to change the regex
[06:51:01] Pupeno: has joined #RubyOnRails
[06:51:14] neanderslob: has joined #RubyOnRails
[06:53:24] agit0: has joined #RubyOnRails
[06:53:52] fairyeye: has joined #RubyOnRails
[06:55:49] baweaver: sure you don't want numbers as well?
[06:56:44] fairyeye: are you use rails5?
[06:57:26] Radar: HELPA HAS SPOKEN
[06:57:39] dminuoso: has joined #RubyOnRails
[06:58:13] Hyuk: has joined #RubyOnRails
[06:58:26] baash05: has joined #RubyOnRails
[06:58:40] pawnbox: has joined #RubyOnRails
[06:58:46] blackmesa: has joined #RubyOnRails
[06:58:57] roelof: baweaver: is this a question for me ?
[06:59:03] roelof: at this moment , no
[07:00:58] davidklsn: has joined #RubyOnRails
[07:01:26] roelof: im going to hit the books how to make a regex which says alpanumeric and spaces are allowed
[07:01:33] roelof: Thanks all for the help so far
[07:02:32] helpa: http://rubular.com - Ruby regular expression test site
[07:02:52] sevenseacat: https://regex101.com/ is also great for learning about regex
[07:05:06] roelof: thanks, this one seems to work : [a-zA-Z|" "]
[07:08:08] dionysus69: sevenseacat: can you help me with my issue please if you have a minute ? :S
[07:08:55] roelof: and here it do not do what I was expecting : validates :name, :format => {:with => /[a-zA-Z|" "]/,:message => "name should only contain alphanumeric characters"}
[07:09:01] roelof: time for a break
[07:09:12] DrYockel: has joined #RubyOnRails
[07:09:22] Radar: [17:02:33] <helpa> http://rubular.com - Ruby regular expression test site
[07:09:22] max1: has joined #RubyOnRails
[07:09:23] Radar: [17:02:52] <sevenseacat> https://regex101.com/ is also great for learning about regex
[07:09:24] Radar: roelof: ^
[07:09:48] roelof: I have done that course a time ago
[07:09:49] tvw: has joined #RubyOnRails
[07:10:01] Radar: roelof: Ok yeah time for a break. You're not getting it at all.
[07:10:09] Radar: http://rubular.com Try out your regex here: http://rubular.com
[07:10:10] roelof: but still wierd that on rubalar it works and on the rails code it do not
[07:12:15] dminuoso: roelof: By the way, you should really be using the Ruby hash syntax since 1.9
[07:12:26] dminuoso: i.e. format: {} as opposed to :format => {}
[07:12:31] fairyeye: has left #RubyOnRails: ()
[07:13:33] baash05: I'm trying to move some serializers into a sub folder.
[07:13:35] chipotle: has joined #RubyOnRails
[07:13:44] darutoko: has joined #RubyOnRails
[07:13:49] baash05: I don't want to have to namespace the classes.
[07:14:06] baash05: I'm getting this error
[07:14:09] dminuoso: baash05: then you cant use a subfolder with autoloading.
[07:14:12] baash05: constant Api::V2::AdditionalExpenseSerializer, expected /home/dave/Documents/work/airtasker/app/serializers/api/v2/additional_expense_serializer.rb
[07:14:21] deecross: has joined #RubyOnRails
[07:14:28] baash05: But sometimes I can..
[07:14:34] dminuoso: baash05: for example?
[07:14:54] Pupeno: has joined #RubyOnRails
[07:15:07] baash05: Here's my auto load
[07:15:08] baash05: config.autoload_paths += Dir[Rails.root.join('app', 'serializers', 'api', 'v2', 'user')]
[07:15:21] baash05: and my serializer
[07:15:22] baash05: class UserSerializer < ActiveModel::Serializer
[07:15:29] baash05: and this one loads perfectly.
[07:15:40] Radar: baash05: is there more to that error than what you're showing us?
[07:15:44] tophattom: has joined #RubyOnRails
[07:15:54] dminuoso: baash05: I'm guessing that class is located in app/serializers/api/v2/user/user_serializer.rb ?
[07:16:02] Oliphaunte: has joined #RubyOnRails
[07:16:26] dminuoso: baash05: Have you read the rails guide on autoloading and reloading constants?
[07:16:29] daumie: has joined #RubyOnRails
[07:16:37] baash05: /home/dave/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:495:in `load_missing_constant': Unable to autoload constant Api::V2::AdditionalExpenseSerializer, expected /home/dave/Documents/work/airtasker/app/serializers/api/v2/additional_expense_serializer.rb to d
[07:16:48] baash05: That's the error...
[07:16:54] dminuoso: baash05: and where is the class located?
[07:17:13] baash05: /home/dave/Documents/work/airtasker/app/serializers/api/v2/additional_expense_serializer.rb
[07:17:13] dminuoso: Hello tophattom.
[07:18:00] samuelkadolph: has joined #RubyOnRails
[07:18:10] tophattom: I was wondering if someone here could help me with Rails 5 upgrade
[07:18:11] ur5us: has joined #RubyOnRails
[07:18:12] dminuoso: baash05: gist your full rails config files.
[07:18:19] pawnbox: has joined #RubyOnRails
[07:18:54] dminuoso: baash05: also, are you running spring?
[07:19:08] tophattom: Everything seems to be working expect for tests. When running them I get a bunch of NoMethodErrors
[07:19:42] dminuoso: baash05: and in the gist, also include the output for: (MyRailsApp::Application.config.autoload_paths + MyRailsApp::Application.config.eager_load_paths + MyRailsApp::Application.config.autoload_once_paths).uniq
[07:19:53] dminuoso: replacing MyRailsApp with whatever your rails app is called.
[07:20:15] dminuoso: tophattom: Alright. Start with a gist including a) the full stack trace of your error message, and b) any related code you think may be relevant to this.
[07:20:52] Radar: dminuoso: !rule3 ;)
[07:20:52] helpa: dminuoso: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[07:21:01] daumie: has joined #RubyOnRails
[07:21:17] dminuoso: Radar: Oh that is nice. Is there a list of things I can force helpa to say?
[07:21:22] Radar: dminuoso: !tops
[07:21:23] Radar: dminuoso: !tips
[07:21:23] helpa: dminuoso: Just the tips: http://logs.ryanbigg.com/tips
[07:21:29] dminuoso: Appreciated, thanks.
[07:21:35] Radar: Should probably have a "best of" list for the tips.
[07:21:44] dminuoso: That is actually fine.
[07:22:30] daumie: has joined #RubyOnRails
[07:22:52] dtzuzu: has joined #RubyOnRails
[07:23:18] DoubleMalt: has joined #RubyOnRails
[07:23:42] tophattom: dminuoso: https://gist.github.com/tophattom/d38f78c13c41271d446c868a30a04bab
[07:23:57] tophattom: No idea what may be causing these
[07:24:07] daumie: has joined #RubyOnRails
[07:24:27] Radar: tophattom: Probably the Rails 5 upgrade
[07:24:50] Dimik: has joined #RubyOnRails
[07:24:51] Radar: tophattom: Rails 5 removed dynamic finders. Instead of find_or_create_by_user_id it should be where(user_id: user_id).first_or_create iirc
[07:25:23] Radar: I don't know about most of those other errors.
[07:25:29] Radar: Would be good to see app/models/concerns/act_as_some_entry.rb:11 that code
[07:26:20] tophattom: find_or_create_by_user_id is defined in related classes
[07:26:29] tophattom: Ok, wait a second
[07:27:17] tophattom: Radar: Here you go: https://gist.github.com/tophattom/fe0331fdcff40dc01b52a37ff137ae97
[07:27:33] Radar: warn isn't mentioned anywhere.
[07:28:02] Radar: tophattom: Run one of those tests, see if you get a NoMethodError. I don't particularly mind which one. Hoping to narrow it down to a single chunk of code rather than YOUR ENTIRE APP
[07:28:09] tophattom: Yeah, but I don't see how it originates from line 11
[07:29:52] dminuoso: Radar: I like how one of the command ends up linking a gist that recommends creating this alias: git commit -am "`curl -s http://whatthecommit.com/index.txt`"
[07:30:00] dminuoso: That is quite useful...
[07:31:52] antgel: has joined #RubyOnRails
[07:32:06] tophattom: Radar: Here's only one test run with -b flag
[07:32:08] tophattom: https://gist.github.com/tophattom/3c55e19f79c11af04043e7c3e7782f42
[07:32:31] Radar: That's more like it!
[07:32:37] dminuoso: tophattom: please also include the spec :)
[07:32:42] dminuoso: *test I mean.
[07:33:04] Radar: tophattom: That line is logger.warn... Did you set ActiveRecord::Base.logger to nil at any point?
[07:33:40] dminuoso: tophattom: Don't. You need to use doubles/stubbing when testing.
[07:33:44] Radar: hash-tag-well-there's-your-problem
[07:35:17] fvthree: has joined #RubyOnRails
[07:35:38] tophattom: This test suite is far from using only stubs =D So is there a way to supress SQL logs without setting Logger to nil?
[07:36:01] Radar: ActiveRecord::Base.logger = Logger.new("/dev/null") ?
[07:36:31] fvthree: anyone know where to download agile web development with rails 5th edition?
[07:36:34] sevenseacat: the thing is, it's trying to write some kind of warning to the logger - I think you need to see that
[07:36:49] sevenseacat: fvthree: https://pragprog.com/book/rails5/agile-web-development-with-rails-5
[07:37:13] fvthree: anyone have a free ebook version?
[07:37:23] Radar: fvthree: We don't encourage pirating in this channel.
[07:37:28] Radar: If you want to read it, buy it.
[07:37:41] Radar: !r4ia is a better book anyway
[07:37:41] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[07:37:51] fvthree: ok thanks!
[07:37:52] Radar: Even if it's not Rails 5, it'll still get you most of the way there.
[07:38:19] sevenseacat: I should go see how much of it doesnt work with Rails 5 - I suspect it will be minimal, just maybe some gem versions need to be updated
[07:39:42] tophattom: sevenseacat: Seems like the warnings are about overwriting a scope defined in parent class
[07:40:00] sevenseacat: seems like an important thing to know
[07:40:32] tophattom: Yeah, well, it's by design ;)
[07:40:46] sevenseacat: well I hate to say it, but
[07:40:54] sevenseacat: seems like the design could be improved
[07:41:41] tophattom: Might be. Anyways, thank you guys very much for your help! :)
[07:41:46] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[07:42:51] tophattom: s/guys/folks/
[07:48:29] arBmind: has joined #RubyOnRails
[07:49:01] artto: has joined #RubyOnRails
[07:49:59] dionysus69: has joined #RubyOnRails
[07:50:16] fermonkus: has joined #RubyOnRails
[07:53:17] Spami: has joined #RubyOnRails
[07:54:06] finnnnnnnnnnn: has joined #RubyOnRails
[07:56:18] hahuang61: has joined #RubyOnRails
[07:57:01] jsrn: has joined #RubyOnRails
[07:59:02] daumie: has joined #RubyOnRails
[08:00:32] blackmesa: has joined #RubyOnRails
[08:01:17] roshanavand: has joined #RubyOnRails
[08:02:52] Pumukel: has joined #RubyOnRails
[08:10:07] Oliphaunte: has joined #RubyOnRails
[08:10:57] finnnnnnnnnnn: what do people generally do for date filtering in URLs? /model/datefrrom/dateto or should I just use a quesry string? /model?datefrom=&dateto=
[08:11:12] max1: has joined #RubyOnRails
[08:13:28] the_drow: has joined #RubyOnRails
[08:13:38] Ropeney: has joined #RubyOnRails
[08:17:30] tbuehlmann: finnnnnnnnnnn: I have an abstraction library for that where I provide that as /models?your_date_min=&your_data_max=
[08:18:00] kitsuneyo: has joined #RubyOnRails
[08:18:35] finnnnnnnnnnn: tbuehlmann: that seems sensible, thanks
[08:18:49] tbuehlmann: I'll leave this here: https://github.com/tbuehlmann/lappen/wiki/Comparable
[08:19:16] pur3eval: has joined #RubyOnRails
[08:20:19] finnnnnnnnnnn: tbuehlmann: awesome will check it out
[08:20:24] Macaveli: I'm getting an error "syntax error, unexpected ':', expecting ')' (SyntaxError)" for this code https://gist.github.com/DelawareConsulting/ddc7f5e1479777d0e860b442b996c45a
[08:20:29] dminuoso: finnnnnnnnnnn: use the URL to specify a resource, and params for everything else.
[08:21:03] finnnnnnnnnnn: Macaveli: find_or_create_by(name: name("PRIVACY_URL")
[08:21:32] dminuoso: finnnnnnnnnnn: So as long as "datefrom" or "dateto" are not required to specify the resource you are describing, they do not belong into the URL itself.
[08:21:43] finnnnnnnnnnn: dminuoso: good advice, thanks
[08:23:25] AntiSpamMeta: has joined #RubyOnRails
[08:23:32] dtzuzu: has joined #RubyOnRails
[08:25:53] abhvl: has joined #RubyOnRails
[08:26:45] abhvl: can i do CLASS.where(:one=:two=:three=somejb.id)
[08:26:57] abhvl: ori have to do three seperate conditions
[08:29:51] AmiMoench: has joined #RubyOnRails
[08:30:06] ngw_: has joined #RubyOnRails
[08:30:10] daumie: hello guys...How do I go past the tutorials and books to actually like develop something of my own?
[08:30:56] marr: has joined #RubyOnRails
[08:32:59] shinnya: has joined #RubyOnRails
[08:33:31] pur3eval_: has joined #RubyOnRails
[08:33:50] pawnbox: has joined #RubyOnRails
[08:35:11] alfiemax: daumie, start developing something on your own..
[08:35:40] blackmesa: has joined #RubyOnRails
[08:35:50] kitsuneyo: has joined #RubyOnRails
[08:36:31] davidklsn: has joined #RubyOnRails
[08:37:19] JamieD: has joined #RubyOnRails
[08:41:42] raja: has joined #RubyOnRails
[08:42:52] raja: I wnat to know where I will find solutions to the railstutorials.org problems excercises?
[08:43:03] arup_r: has joined #RubyOnRails
[08:43:24] raja: please reply
[08:45:12] dminuoso: abhvl: !sub
[08:45:13] helpa: abhvl: IRC is not a substitute for experimenting with your code. If you ask 'will <random idea> work?' most ofthe time you will be told to try it out for yourself and see.
[08:48:56] arup_r: hi, I am trying to implement some external page. The thing is i would like to share the url of the page to those users, and then we will click url and do their work. All things are fine, but the url is becoming to big and looks so weird. I am looking for some url shortening process, so that actual url can be made small and share, and someone click the url, he will see the same page. All encode and decoding of url I will do in backend. Any
[08:48:56] arup_r: gems or ideas about this?
[08:49:03] xcesariox: has joined #RubyOnRails
[08:49:24] xcesariox: anyone advice when is it a good time to migrate existing rails 4.2.6 projects to 5?
[08:49:35] dminuoso: arup_r: Why do you care about an URL?
[08:49:38] xcesariox: sevenseacat ?
[08:49:43] dminuoso: arup_r: Browsers have started to even hide URLs from users.
[08:50:09] arup_r: dminuoso: url is too big, and when it is being pasted in the outlook email it is getting broken
[08:50:17] dminuoso: xcesariox: If you are not an adventerous type, I would wait a few weeks so people have gotten experience with it.
[08:50:47] xcesariox: dminuoso : so in a few weeks time everyone should star to migrate over to rails 5?
[08:51:32] dminuoso: xcesariox: Well, in a few weeks I would look at what problems might arise when upgrading.
[08:51:41] dminuoso: And then decide, based on the estimated workload.
[08:52:04] arup_r: dminuoso: that is why I am thinking to encode the actual url and give it. But in browser how should I decode it, no idea :)
[08:52:34] daumie: alfiemax: I have no idea on the starting point
[08:52:37] arup_r: or I probably need to think completely different approach.
[08:52:49] daumie: alfiemax: Personally how did you start?
[08:52:58] dminuoso: arup_r: which outlook version?
[08:53:22] arup_r: I didn't ask that to my client. Should I ask that?
[08:53:54] arup_r: I mean does the version will help any? He has shown me the issue and I srated thinking about it
[08:54:15] dminuoso: arup_r: since Outlook 2007 the limit is 1033 characters, with 2013 having no limitation.
[08:54:28] dminuoso: arup_r: it was outlook 2003 that had a severe 256 character length limit on hyperlinks.
[08:54:41] dminuoso: So unless you really want to support 2003, you should tell them to upgrade their shitty old software.
[08:54:56] arup_r: then probably then using older..
[08:56:00] dminuoso: arup_r: But there is gems like "shortener" around, perhaps that or another gem might suit your needs.
[08:56:11] arup_r: dminuoso: where u found this information so quick. Can you give me the link? :)
[08:56:30] arup_r: I mean that outlook information
[08:56:31] dminuoso: arup_r: https://www.google.com/
[08:56:39] dminuoso: On both accounts.
[08:56:45] phredus: has joined #RubyOnRails
[08:56:50] arup_r: ok, I am there also. let me type some more words there
[08:57:08] AimlessRAven: has joined #RubyOnRails
[08:57:15] Palsson: has joined #RubyOnRails
[08:59:23] AimlessRAven: when i add avatar uploader and avatar field to my users - using Devise .. now what is the good way to define this new parameter to User
[08:59:26] AimlessRAven: rails generate devise:controllers
[08:59:43] AimlessRAven: or add custom controller and make devise route link to this controller
[08:59:46] AimlessRAven: or something else
[08:59:52] AimlessRAven: i need the good practice
[09:00:47] universa1: AimlessRaven: did you check the docs and the wiki?
[09:00:53] alfiemax: AimlessRaven, whaat???
[09:00:56] yfeldblum: has joined #RubyOnRails
[09:01:03] dminuoso: AimlessRaven: If you think that adding fields to models has anything to do with controllers, then you really should forget everything you know and read a basic introdoctionary tutorial.
[09:01:14] alfiemax: dminuoso, +1
[09:02:04] Pupeno: has joined #RubyOnRails
[09:03:15] jenrzzz: has joined #RubyOnRails
[09:06:30] finnnnnnnnnnn: has joined #RubyOnRails
[09:09:55] yardenbar: has joined #RubyOnRails
[09:12:53] srinidhi: has joined #RubyOnRails
[09:14:37] Pupeno: has joined #RubyOnRails
[09:17:11] frojnd: has joined #RubyOnRails
[09:17:13] pawnbox: has joined #RubyOnRails
[09:17:14] frojnd: Hi there.
[09:17:29] ur5us: has joined #RubyOnRails
[09:17:43] c355E3B: has joined #RubyOnRails
[09:17:52] Pumukel: has joined #RubyOnRails
[09:19:12] bruce_lee: has joined #RubyOnRails
[09:19:58] flashpoint9: has joined #RubyOnRails
[09:21:19] bob_f: has joined #RubyOnRails
[09:22:14] pawnbox: has joined #RubyOnRails
[09:24:18] dtzuzu: has joined #RubyOnRails
[09:25:00] conta: has joined #RubyOnRails
[09:26:11] AimlessRAven: im using carrierwave uploader .. everything is done but
[09:26:20] AimlessRAven: when my user dont upload avatar
[09:26:31] AimlessRAven: when i rend current_user.avatar.thumb
[09:26:40] AimlessRAven: there stay empty thumb
[09:26:52] AimlessRAven: how to hide this unless user upload avatar
[09:27:07] njero: has joined #RubyOnRails
[09:27:41] arcy: has joined #RubyOnRails
[09:28:00] ferr1: has joined #RubyOnRails
[09:28:07] AzaToth: has joined #RubyOnRails
[09:28:13] daumie: has left #RubyOnRails: ("see you later..need to rub")
[09:31:37] pawnbox: has joined #RubyOnRails
[09:32:23] quazimodo: has joined #RubyOnRails
[09:34:23] finnnnnnnnnnn: has joined #RubyOnRails
[09:36:26] Kedare: has joined #RubyOnRails
[09:36:56] JamieD: has joined #RubyOnRails
[09:37:50] kies: has joined #RubyOnRails
[09:44:44] daumie: has joined #RubyOnRails
[09:46:43] dionysus69: anyone familiar with cocoon, link_to_add_association asks for a different partial than link_to_remove_association, is it positive that they need different partials? if I have _news_images_fields.html.erb for remove link_to then add link_to asks for _news_image_fields.html.erb says the partial is missing...
[09:51:53] sevenseacat: link_to_remove_association does not expect a partial
[09:51:59] pur3eval: has joined #RubyOnRails
[09:52:07] atrius: has joined #RubyOnRails
[09:52:19] AndrewIsHere: has joined #RubyOnRails
[09:52:27] artto: has joined #RubyOnRails
[09:53:36] sicn: has joined #RubyOnRails
[09:54:19] sicn: hi, wondering if any of you might know how I can dynamically add routes in Ruby on Rails based on a table in the database? My naive approach was to create a model and in routes.rb I simply did DynamicUrls.find_each do |urlToAdd| #... end, but that seems to make the application not start (and doesn't even make it possible to do a rake db:migrate)
[09:55:28] dionysus69: ok I think I boiled down a problem. I am still stuck on same thing that I was yesterday. paperclip images don't get saved because they are getting built with incorrect parameter...
[09:56:02] dminuoso: sicn: What do you mean with "dynamically add routes" ?
[09:56:05] jhass: sicn: just add a route like get "/:foo" => "dynamic_stuff#show" to the bottom
[09:56:21] jhass: and have a DynamicStuffController that does whatever you want
[09:56:33] jhass: (choose better names)
[09:56:44] sicn: hehe, hi jhass ;)
[09:57:02] hahuang61: has joined #RubyOnRails
[09:58:17] Oliphaunte: has joined #RubyOnRails
[09:59:30] alfiemax: has joined #RubyOnRails
[10:04:26] nettoweb: has joined #RubyOnRails
[10:05:50] jenrzzz: has joined #RubyOnRails
[10:06:04] frojnd: What am I doing wrong with paths? WHen I run rake test I get no route matches /about https://gist.github.com/anonymous/34e24e9e78ed07d73a9f991114ad3ad7 This is my test file: https://gist.github.com/025cc9adae9016e1d4a608549e31dc0c And this is the rake routes output: https://gist.github.com/4d49f8d5ba57d3663d35e3b093a35a48 Why I get no route matches error in test?
[10:07:10] universa1: frojnd: you can add all files to one gist... makes it a lot easier to read.
[10:08:26] frojnd: universa1: OK will do that next time I gist something.
[10:09:56] helpa: has joined #RubyOnRails
[10:10:45] frojnd: universa1: will you check the gist if I merge them into one gist?
[10:11:14] universa1: frojnd: in controller tests/specs you don't do get some_path, you do: get 'some_action'
[10:11:25] universa1: or get :some_action
[10:12:01] universa1: right now you're doing: get "/about", which results in rails trying to look for a route with the action "/about" and not "about" !
[10:13:59] Quintasan: https://gist.github.com/Quintasan/89972a3674c52c1f0a85f4a2b73861ac -> somehow my nested resource doesn't pass its parent resource id from the URL into the newly created nested resource. Did this behaviour change in Rails 5 or I am doing something horribly wrong
[10:14:54] universa1: Quintasan: i guess that is your library, and has nothing to do with rails.
[10:15:14] frojnd: universa1: thank you
[10:15:17] Pupeno: has joined #RubyOnRails
[10:15:42] universa1: Quintasan: so whatever provides expose...
[10:16:04] Quintasan: It's decent_exposure, I guess the maintainer was too eager to dispose of my bug report.
[10:17:06] universa1: Quintasan: https://github.com/hashrocket/decent_exposure#build
[10:17:33] universa1: build / build_params / scope should allow you to do whatever you want
[10:17:42] universa1: s/whatever/what/
[10:18:16] Detch: has joined #RubyOnRails
[10:18:32] binaryplease2: has joined #RubyOnRails
[10:20:21] universa1: Quintasan: my bet being on scope.
[10:23:26] artto_: has joined #RubyOnRails
[10:25:02] dtzuzu: has joined #RubyOnRails
[10:25:33] artto: has joined #RubyOnRails
[10:26:05] atrius_: has joined #RubyOnRails
[10:26:56] Hyuk: has joined #RubyOnRails
[10:27:03] workmad3: has joined #RubyOnRails
[10:28:14] arBmind: has joined #RubyOnRails
[10:30:35] daumie: has joined #RubyOnRails
[10:32:42] artto_: has joined #RubyOnRails
[10:33:32] ur5us: has joined #RubyOnRails
[10:34:02] basex: has joined #RubyOnRails
[10:34:33] siaw23: can anyone help me get rid of these deprecation messages? https://gist.github.com/siaw23/58167615059f2930a47d7e9616d7fdb7
[10:34:52] blackmesa: has joined #RubyOnRails
[10:35:26] dminuoso: siaw23: Please attach the offending code to your gist.
[10:37:53] siaw23: dminuoso: https://gist.github.com/siaw23/58167615059f2930a47d7e9616d7fdb7
[10:38:07] artto: has joined #RubyOnRails
[10:41:16] jenrzzz: has joined #RubyOnRails
[10:44:29] snowy: has joined #RubyOnRails
[10:46:15] dminuoso: siaw23: are you using shoulda-matchers?
[10:46:30] dminuoso: siaw23: What version?
[10:47:14] dminuoso: siaw23: You need to update to 3.1.1 at least.
[10:47:21] dminuoso: That will fix the underlying issue.
[10:48:00] dminuoso: Or rather, I suspect this to be the issue.
[10:48:01] siaw23: got this in my gemfile lock shoulda-matchers (3.1.1)
[10:48:49] siaw23: yes i know this is a hard one. i have spent weeks on this
[10:49:03] dminuoso: siaw23: Well its quite easy to figure out where it comes from.
[10:49:08] camonz: has joined #RubyOnRails
[10:49:15] dminuoso: siaw23: Let me just find out one thing real quick.
[10:49:38] camonz: Hello, I'm having an issue requiring rgeo-geojson on my rails app even though it's on my Gemfile
[10:50:19] camonz: tried adding it to an new Rails app and it works without issue, so I'm guessing there's some kind of conflict for why Rails says it can't load/find 'rgeo/geo_json'
[10:50:26] camonz: any clues on how to solve / debug this?
[10:52:02] dminuoso: siaw23: Use byebug or pry to break into the method in active_support/deprecation/reporting.rb
[10:52:17] dminuoso: siaw23: Look at the callstack to find out which part is trying to use the deprecated method.
[10:52:23] jenrzzz: has joined #RubyOnRails
[10:52:23] Oliphaunte: has joined #RubyOnRails
[10:53:16] quazimodo: has joined #RubyOnRails
[10:53:20] GodFather: has joined #RubyOnRails
[10:53:38] Velizar: has joined #RubyOnRails
[10:53:41] roelof: has joined #RubyOnRails
[10:53:43] artto: has joined #RubyOnRails
[10:54:16] blackhuey: has joined #RubyOnRails
[10:54:20] dminuoso: CamonZ: Gist your Gemfile, the code that tries to use it, and the exact error message with a complete stack trace.
[10:55:24] deecross: has joined #RubyOnRails
[10:55:55] conta1: has joined #RubyOnRails
[10:56:37] camonz: dminuoso: https://gist.github.com/CamonZ/c372252fb222944ab7d6ae4bd76541fb
[10:57:53] dminuoso: CamonZ: One hint, you do not need to prepend "bundle exec" for rails. The rails bin stub does that for you automatically.
[10:58:08] camonz: old habits
[10:58:25] roelof: why do I see this error : {:errors=>{:category=>["is not included in the list"]}, :status=>422} on a item which is on the valiidation list : https://gist.github.com/rwobben/ee02f1ac6777513497cc311ce24f9bb9
[10:58:48] dminuoso: CamonZ: Since I noticed, end your rails console, stop spring, restart your rails console.
[10:58:51] dminuoso: See if the problem persists.
[10:58:58] dminuoso: In fact, throw out Spring altogether.
[11:00:42] camonz: dminuoso: how?
[11:01:18] jenrzzz: has joined #RubyOnRails
[11:01:34] dminuoso: CamonZ: By removing the gem from your Gemfile and deleting the binstub.
[11:02:00] dminuoso: It offers no real benefits and just creates opaque problems. Possibly even causing yours right now.
[11:03:50] camonz: thank you :)
[11:04:06] camonz: killed all spring processes and restarted the rails console
[11:04:14] deecross: has joined #RubyOnRails
[11:04:18] roelof: dminuoso: does Rails 5 also uses spring ?
[11:04:34] camonz: roelof: yes
[11:04:57] dminuoso: CamonZ: So it solved your problem?
[11:05:14] roelof: hmm, then maybe it can be the culprit of my problems I described earlier in this channel
[11:05:21] dminuoso: CamonZ: Remove spring entirely while you are at it. :)
[11:05:36] roelof: a rspec which fails where it schould have been correct
[11:06:15] dminuoso: roelof: If you have an issue, there is a simple checklist you can follow: 1) Do you have Turbolinks? If yes, does disabling it solve your problem? 2) Do you have Spring? If yes, does restarting it solve your problem? 3) Ask in this channel.
[11:07:09] roelof: turbolinks : nope , I do not use it
[11:07:33] roelof: Spring is used so I have to find out how to restart, delete it
[11:07:36] camonz: hahahaha love that checklist
[11:07:39] umdstu: has joined #RubyOnRails
[11:08:16] camonz: roelof: before committing to deleting it, bundle exec spring stop
[11:08:39] camonz: or the old fashioned way of ps -e | grep spring and kill -9 those pids
[11:08:50] AimlessRAven: has joined #RubyOnRails
[11:09:02] AimlessRAven: what is the easy way to ransack sort link association
[11:09:19] camonz: dminuoso is right tho, that problem I just had was incredibly opaque
[11:09:26] roelof: I did bundle exec spring stop and the problem still exist
[11:10:13] roelof: why do I see this error : {:errors=>{:category=>["is not included in the list"]}, :status=>422} on a item which is on the valiidation list : https://gist.github.com/rwobben/ee02f1ac6777513497cc311ce24f9bb9
[11:11:16] dminuoso: CamonZ: No, you should commit to deleting it regardless.
[11:11:23] dminuoso: Spring is buggy and shit.
[11:11:55] dminuoso: And it attempts to address a problem that shouldn't matter to you. If you restart your rails application every minute, then there's something wrong with you.
[11:12:02] dionysus69: I really need help with cocoon and paperclip! https://gist.github.com/webzorg/41dec030ee68e43e58036ce006474962 here are all relevant files. I mostly blame create action for not saving the image. or strong parameters. any hints appreciated!
[11:12:14] workmad3: roelof: you're not passing any attributes into your Account object...
[11:13:58] roelof: workmad3: sorry, can you explain what you mean ?
[11:14:07] artto: has joined #RubyOnRails
[11:14:27] camonz: roelof: https://gist.github.com/rwobben/ee02f1ac6777513497cc311ce24f9bb9#file-accounts_controller-rb-create-L3
[11:14:49] workmad3: CamonZ: thanks :)
[11:14:53] roelof: I see: I have to do : @account = Account.new(account_params)
[11:16:17] workmad3: roelof: yup
[11:16:29] roelof: and I have looked at the code for some time
[11:16:30] JamieD: has joined #RubyOnRails
[11:16:35] roelof: thanks all
[11:21:12] AntiSpamMeta: has joined #RubyOnRails
[11:25:51] dtzuzu: has joined #RubyOnRails
[11:26:41] roelof: another question. I have this regex [a-zA-Z| " "] . now im feeding it with "{test}" . I expect a failure but I see a success. Why ?
[11:27:17] camonz: roelof: test it with http://reggyapp.com/
[11:27:25] roelof: has joined #RubyOnRails
[11:27:42] camonz: roelof: test it with http://reggyapp.com/
[11:29:26] roelof: I have tested it with http://rubular.com/ and there only the characters are chosen not the {
[11:30:57] ldnunes: has joined #RubyOnRails
[11:31:22] roelof: I cannot test reggy. Im working on Windows and I cannot open tbz files :(
[11:33:39] allcentury: has joined #RubyOnRails
[11:33:55] jeffmess: has joined #RubyOnRails
[11:33:55] camonz: the moment you realize you've been doing too much javascript: "if feature.geometry.geometry_type !== RGeo::Feature::Point"
[11:34:38] camonz: it's prob very similar to rubular
[11:36:13] camonz: roelof: try with [\w|"]+
[11:37:22] flashpoint9: has joined #RubyOnRails
[11:37:26] universa1: roelof: no boundary in your regex, so start/end of string ;)
[11:38:53] flashpoi_: has joined #RubyOnRails
[11:38:55] Guest: has joined #RubyOnRails
[11:39:04] dblessing: has joined #RubyOnRails
[11:40:05] rodfersou: has joined #RubyOnRails
[11:42:15] roelof: no boundries
[11:42:39] universa1: yes, so \w will match "{abcd}"
[11:43:12] roelof: thinbgs like "Exampel Account" are good. the only things that are bad are { , [ so everything you do not use in a string
[11:43:42] universa1: sorry, i'm lost.
[11:44:16] finnnnnnnnnnn: has joined #RubyOnRails
[11:44:31] universa1: roelof: what is it that you want to do?
[11:44:36] roelof: oke, the name can be test or Test but not {test} or [test] or {test1, test2}
[11:46:32] Oliphaunte: has joined #RubyOnRails
[11:46:51] xhoy: has joined #RubyOnRails
[11:47:10] roelof: the [\w|"]+ seems to do the job. I see a validation error :)
[11:50:24] roelof: sorry: I do not work, I still see a malformed record and a status 200 instead of 422
[11:52:20] pvertenten: has joined #RubyOnRails
[11:53:33] dblessing: has joined #RubyOnRails
[11:53:34] AndrewIsHere: has joined #RubyOnRails
[11:53:41] dionysus69: does cocoon require for related model to be named by single word?
[11:55:07] dionysus69: if news would be news_attributes in permited params what would news_images be? I have it as news_images_attributes and I get this error, Unpermitted parameter: news_images. I also have this in a has_many model accepts_nested_attributes_for :news_images, allow_destroy: true.
[11:56:42] jottr: has joined #RubyOnRails
[11:57:47] hahuang61: has joined #RubyOnRails
[12:04:12] harfangk: has joined #RubyOnRails
[12:06:21] roelof: universa1: my question comes to this : how can I take care that only alphanumeric characters are valid , so if something contains a { or a [ it must be invalid
[12:06:34] roelof: so test is valid , {test} must be invalid
[12:07:07] dkam: has joined #RubyOnRails
[12:07:28] roelof: better said "test" is valid "{test}" or "[test]" are invalid
[12:07:57] dkam: has joined #RubyOnRails
[12:08:46] dkam: Hey guys. Getting my controller tests working with rails 5. How do you set session variables - EG to similulate that you're logged in?
[12:10:07] SteenJobs: has joined #RubyOnRails
[12:10:22] Varun_krishna: has joined #RubyOnRails
[12:10:30] USvER: has joined #RubyOnRails
[12:10:30] matthewd: roelof: If rubular.com is showing matches, then you need to change your regexp: you want 'No matches'
[12:13:21] roelof: matthewd: oke, some more puzzeling to do . I have to make a regex that says something must begin with a alphanumeric character ,from the second it can be a alphanumeric character or a space
[12:14:45] matthewd: dkam: The simplest option is to actually log in
[12:15:17] dkam: matthewd: in a controller test? That sounds more like an integration test?
[12:16:03] universa1: hasn't rails 5 dropped controller tests? ;)
[12:16:20] dkam: universa1: Seems the might be heading that way....
[12:16:36] fmcgeough: has joined #RubyOnRails
[12:16:50] camonz: dkam: (they have)
[12:17:04] camonz: use a request spec
[12:17:14] camonz: test the full vertical for the app
[12:17:21] camonz: s/full/entire
[12:20:08] dkam: ahh - just noticed they don't have an integration test section on rails guides - just a controller section, so it seems controller tests have been replaced by integration tests.
[12:20:19] jmignault: has joined #RubyOnRails
[12:20:39] rubyonrails742: has joined #RubyOnRails
[12:21:10] rubyonrails742: what is the best way to cache API response
[12:21:40] srinidhi: has joined #RubyOnRails
[12:21:56] universa1: dkam: http://guides.rubyonrails.org/testing.html#functional-tests-for-your-controllers -- hmm it inherits from integration test ;)
[12:22:52] universa1: dkam: so even though it is called controller test and named functional test, it is an integration test! and therefore you should login through posting to the login action/filling out the login form ;)
[12:23:27] dkam: universa1: Yeah - seems that's the way to go. Ta!
[12:23:35] matthewd: dkam: I thought you could access the session anyway, though
[12:24:11] camonz: has joined #RubyOnRails
[12:24:27] universa1: matthewd: the guide says yes, but only after a request has been made and processed (haven't tried rails 5 yet, so can only repeat what the guide says )
[12:24:39] dkam: matthewd: if you inhert from ActionController::TestCase you probably can. But now it's moving to key word args to get / post / put - and there seems to be none for setting session variables
[12:26:36] dtzuzu: has joined #RubyOnRails
[12:27:41] matthewd: dkam: ... was it previously possible to set session variables via an argument to get/post ? :/
[12:28:32] dkam: matthewd: Yep - in controller tests ( which I'm now fixing for rails 5).
[12:29:07] dkam: matthewd: you could just set session variables to simulate a logged in user.
[12:30:27] camonz: dkam: how are you authenticating users, devise?
[12:34:15] roamingdog: has joined #RubyOnRails
[12:34:45] matthewd: > there seems to be none for setting session variables
[12:35:01] matthewd: Where are you looking, to draw that conclusion?
[12:35:39] dminuoso: matthewd: Yes there is actually.
[12:35:41] alpha: has joined #RubyOnRails
[12:36:01] bbrowning: has joined #RubyOnRails
[12:36:03] dminuoso: matthewd: The third argument sets headers and session variables.
[12:36:09] harfangk: has joined #RubyOnRails
[12:36:25] pwnd_nsfw`: has joined #RubyOnRails
[12:36:38] matthewd: dminuoso: That was a quote
[12:38:31] quazimod1: has joined #RubyOnRails
[12:39:13] sirius: has joined #RubyOnRails
[12:39:15] dkam: matthewd: There currently is - that's what I'm using. I was wondering how you do it now. The Testing guide doesn't mention setting session variables ( as far as I can tell )
[12:40:16] matthewd: dkam: As you noted, the testing guide doesn't mention AC::TestCase at all; the golden path is to use AD::IntegrationTest for everything
[12:40:30] Oliphaunte: has joined #RubyOnRails
[12:40:43] matthewd: dkam: But if you're using AC::TestCase, it does support a session: kwarg. I'm trying to work out what made you think it doesn't.
[12:41:28] dtzuzu: has joined #RubyOnRails
[12:42:24] dkam: matthewd: Oh right - great.
[12:44:48] dkam: matthewd: I couldn't see it documented
[12:45:20] tvw: has joined #RubyOnRails
[12:45:21] matthewd: AC::TestCase isn't documented at all :/
[12:48:46] blackmesa: has joined #RubyOnRails
[12:53:18] grn: has joined #RubyOnRails
[12:54:41] finnnnnnnnnnn: has joined #RubyOnRails
[12:55:14] sevenseacat: has joined #RubyOnRails
[12:55:58] dminuoso: matthewd: Oh, nevermind. :)
[12:56:50] pawnbox: has joined #RubyOnRails
[12:57:10] Pumukel: has joined #RubyOnRails
[12:57:40] grn: has joined #RubyOnRails
[12:57:57] Palsson: has joined #RubyOnRails
[12:58:00] grn: has joined #RubyOnRails
[12:58:40] grn: has joined #RubyOnRails
[13:00:02] evansbee: has joined #RubyOnRails
[13:00:17] flashpoint9: has joined #RubyOnRails
[13:01:33] fermonkus: has joined #RubyOnRails
[13:02:15] ramortegui: has joined #RubyOnRails
[13:03:20] cd-rum: has joined #RubyOnRails
[13:07:42] diegoviola: has joined #RubyOnRails
[13:10:03] lalalaaa_: has joined #RubyOnRails
[13:11:53] allcentury: has joined #RubyOnRails
[13:12:48] orolo: has joined #RubyOnRails
[13:15:17] chouhoulis: has joined #RubyOnRails
[13:16:17] deecross_: has joined #RubyOnRails
[13:17:53] SteenJobs: has joined #RubyOnRails
[13:18:08] moep: has joined #RubyOnRails
[13:18:48] ekinmur: has joined #RubyOnRails
[13:19:04] AimlessRAven: has joined #RubyOnRails
[13:19:11] AimlessRAven: how to set nested resource go to different controller
[13:19:18] AimlessRAven: of this resource controller
[13:19:57] universa1: the same as if it is not nested?
[13:22:16] AimlessRAven: universa1: not exacly
[13:22:31] AimlessRAven: i have comment whitch i want to control in one controlelr for post/events/gallery ..
[13:22:40] AimlessRAven: and want to make nested resource who goes to same controller
[13:23:18] aegis3121: has joined #RubyOnRails
[13:23:33] GodFather: has joined #RubyOnRails
[13:26:19] universa1: AimlessRaven: so?
[13:26:19] tjbiddle: has joined #RubyOnRails
[13:26:39] universa1: what is the actual problem? code? ...
[13:26:47] harfangk: has joined #RubyOnRails
[13:26:49] Rodya_: has joined #RubyOnRails
[13:27:18] AimlessRAven: universa1: how to define nested resources whitch go to one controller - comments
[13:28:39] AimlessRAven: universa1: https://gist.github.com/anonymous/67ab10dcac3355f1c815db3e283d7f1d
[13:28:41] universa1: resources :bla do; resources :comments; end
[13:29:29] universa1: where do you have that controllerS idea from?
[13:29:37] asheinfeld: has joined #RubyOnRails
[13:30:12] universa1: http://guides.rubyonrails.org/routing.html#nested-resources
[13:30:32] macsteps: has joined #RubyOnRails
[13:30:45] Rodya__: has joined #RubyOnRails
[13:32:27] Parutz: has joined #RubyOnRails
[13:32:29] adlerdias: has joined #RubyOnRails
[13:33:42] snowy: has joined #RubyOnRails
[13:34:37] Oliphaunte: has joined #RubyOnRails
[13:35:22] AimlessRAven: universa1: i do it :)
[13:35:52] Parutz: hi rails ppl :)
[13:36:00] JakFrist: has joined #RubyOnRails
[13:36:40] eval: has joined #RubyOnRails
[13:37:13] pawnbox: has joined #RubyOnRails
[13:37:51] SteenJobs: when querying through more than one association, in my case User has_many Purchases and Item has_many Purchases, and i want to query all of the Items the User has purchases, is there a more accepted/better way to do it than by just doing something like user.purchases.map! { |x| x.item }?
[13:38:42] dminuoso: SteenJobs: has_many :through
[13:39:10] dminuoso: SteenJobs: Then you can simply say: user.purchased_items :-)
[13:39:17] SteenJobs: dminuoso: haha right. which i’ve used many a time, totally forgot it gives you those AR methods
[13:39:30] arBmind1: has joined #RubyOnRails
[13:39:30] SteenJobs: but for educational purposes, let’s say AR was good but not THAAAT good
[13:39:54] SteenJobs: how would you make that query without any SQL (which would be pretty standard)
[13:40:27] SteenJobs: as an aside, the rails guides for associations is really top notch
[13:41:09] dminuoso: SteenJobs: Unrelated to your question: Why do you use map!
[13:41:26] dminuoso: And also, you could have used .map(&:item) (not that it would make this any better)
[13:41:34] SteenJobs: dminuoso: meaning as opposed to map?
[13:41:39] SteenJobs: i usually do what you just wrote
[13:41:45] SteenJobs: was being a bit lazy/habitual ha
[13:42:04] matthewd: +1 don't use map! without a specific reason
[13:42:16] SteenJobs: i know i know, it was habit guyssss
[13:42:25] dminuoso: SteenJobs: Then unhabit it.
[13:42:53] matthewd: SteenJobs: We're saying you shouldn't have that habit / trying to understand why you've formed it
[13:43:06] SteenJobs: but yes. generally i won’t alter the contents of being mapped in place
[13:43:39] matthewd: user.purchases.includes(:item).map(&:item); Item.where(id: user.purchases.select(:item_id))
[13:43:43] SteenJobs: honestly i think it’s residual from when i first first first started coding and wasn’t really aware at the time what the difference was
[13:44:08] SteenJobs: matthewd: yea the first is what i had originally written
[13:44:13] matthewd: I'd like there to be a Relation API method that allows you to 'dynamically' do the equivalent of hm:t, but there currently isn't one
[13:44:26] SteenJobs: i like the second query on the Item model :)
[13:46:08] dminuoso: SteenJobs: I only use has_many through for strongly normalized tables usually, and try to prefer what matthewd wrote.
[13:47:03] flashpoint9: has joined #RubyOnRails
[13:47:05] iamvery: has joined #RubyOnRails
[13:47:19] SteenJobs: matthewd: right - that’s kind of what i was looking for, some API method that does the same - but the two queries you wrote - is that what hm:t implements under the hood?
[13:47:29] SteenJobs: dminuoso: how come you avoid them unless the table is strongly normalized?
[13:48:28] matthewd: SteenJobs: I think the second one is a fair approximation of what hm:t does.. I'd have to check to be sure
[13:48:32] SteenJobs: dminuoso: hm:t might not even work - i forgot, purchases and items are a habtm relationship
[13:49:07] SteenJobs: matthewd: nice. seems reasonable. wasn’t sure if there was a faster way to do it, but i guess with the includes part of the query, the map is just iterating through already queried objects
[13:50:40] SteenJobs: oh ha, the includes is in the first one
[13:51:09] quakephil: has joined #RubyOnRails
[13:51:13] quakephil: Rails/ar question... I have a model called group (can't change the name) with a relationship to user, and I'm trying to do user.group.select.etc but its failling on the .group part with"The method .group() must contain arguments"
[13:51:38] quakephil: I guess its trying to do a group by instead of finding the relationship, is there any way I can give ar a hint to use a relationship instead
[13:51:44] blackmesa: has joined #RubyOnRails
[13:52:05] dminuoso: SteenJobs: "salesman has_many addresses_where_his_customers_customers_live_at" simply does not belong into my model
[13:52:17] matthewd: habtm is about where a more native method would start to help; with the select(:item_id) form, you're doing a bit too much of the query-building for yourself (even though it's not in SQL), so you have to be more aware of the 'real' DB structure than you ought
[13:52:19] dminuoso: SteenJobs: It does not describe my model in the slightest, but something that a controller or service might care about.
[13:52:25] rails747: has joined #RubyOnRails
[13:52:58] SteenJobs: you wouldn’t like iOS development. there are SDK methods whose names are pretty much complete sentences
[13:53:20] rails747: Have anyone successfully done resquejobs without loading the whole rails environment and loading only the necessary files?
[13:53:24] dminuoso: quakephil: use [] instead of .group
[13:53:29] matthewd: quakephil: AR's group method is on the class / relation; your association will be on the instance.
[13:54:05] matthewd: quakephil: But I'd really really consider changing the name
[13:54:32] prithaj: has joined #RubyOnRails
[13:55:16] SteenJobs: matthewd: yea i totally hear that. although i’m not sure what the alternative would be given that Item <-> Purchase, yet User -> Purchase. seems like select(:item_id) is the only good way - although i agree, specifying the FK attribute requires more awareness than i’d prefer
[13:55:30] quakephil: I figured it out... I was doing model.relationship.relationship2 which is nonsense, model.relationship2 worked
[13:55:51] rails747: The solution is given in http://www.morellon.com.br/2011/07/tuning-resque-workers-memory-usage.html . I tried it but not working. The workers are not seen available in resque
[13:56:26] harfangk: has joined #RubyOnRails
[13:56:37] sk0r: has joined #RubyOnRails
[13:57:50] rails747: Hello anyone. Does anyone have answer on resque question?
[13:58:24] lexileo: has joined #RubyOnRails
[13:58:33] hahuang61: has joined #RubyOnRails
[13:59:57] artto: has joined #RubyOnRails
[14:01:23] rails747: Hello, have I successfully posted the question, Is my question visible in the chat room?
[14:01:31] eljimmy: has joined #RubyOnRails
[14:02:05] Spami: has joined #RubyOnRails
[14:02:16] dminuoso: rails747: !patience
[14:02:16] helpa: rails747: Patience, young grasshopper
[14:02:51] dminuoso: rails747: !rule3
[14:02:51] helpa: rails747: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[14:04:27] conta: is it possible to do sth similar to Model.includes(:some_other_model_scope) ?
[14:04:52] dminuoso: conta: You don't include scopes, you include declared relationships
[14:05:19] dminuoso: conta: but! a scope can use includes! ;-)
[14:05:58] dminuoso: In fact this can be fairly useful if you have some common includes chains that you use in multiple controllers.
[14:06:07] conta: well I have scope (where: bla bla) and I am doing on another model includes model2 where the where is the same
[14:07:17] dionysus69: has joined #RubyOnRails
[14:08:06] blackmesa: has joined #RubyOnRails
[14:08:25] camilasan: has joined #RubyOnRails
[14:09:05] prawnApprentice: has joined #RubyOnRails
[14:09:39] prawnApprentice: Hello! Are there any concrete rails applications using prawn-graph on github/blogs? I have tried the examples on the website https://ryanstenhouse.jp as well as the github https://github.com/HHRy/prawn-graph but they are not working..
[14:11:00] dopamean_: has joined #RubyOnRails
[14:13:59] finnnnnnnnnnn_: has joined #RubyOnRails
[14:14:00] xpl0iter: has joined #RubyOnRails
[14:15:04] xpl0iter: Hi, I am trying to submit a form from a page to a different controller's action. But I need to get the current page's parameter to submit along with the form. So how do I get the parameter from the current URL?
[14:15:07] xpl0iter: Can someone please help me?
[14:15:10] Oliphaunte: has joined #RubyOnRails
[14:15:48] matthewd: conta: !code please
[14:15:48] helpa: conta: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[14:16:15] hck89: has joined #RubyOnRails
[14:16:22] matthewd: xpl0iter: params ?
[14:17:48] xpl0iter: matthewd, this is my code for the form: http://pastie.org/private/a6cl80yl9evsqcm9sjlv6a and the current url is http://127.0.0.1:3000/segments/fa8fbe65-089e-4749-8513-9a5296d45e2d
[14:18:13] xpl0iter: I need to submit the value "fa8fbe65-089e-4749-8513-9a5296d45e2d" as a hidden value along with the form
[14:18:21] xpl0iter: So how do I get that part?
[14:19:27] conta: matthewd https://gist.github.com/hovancik/8c3a55b48977841e65f3628a98d5c441
[14:25:20] matthewd: conta: Category.include(:products).merge(Product.available_for_customer(current_customer))
[14:25:48] tinco: has joined #RubyOnRails
[14:25:58] tinco: hi guys :)
[14:26:04] matthewd: xpl0iter: Presumably your route is putting that into a parameter
[14:26:47] conta: matthewd: that's awesome, thanks!
[14:26:59] tinco: hey matthewd, thanks for merging my PR! I just wrote a blog post about how we found the issue: https://blog.phusion.nl/2016/07/07/actioncable-under-stress-p1/
[14:27:59] matthewd: conta: I'm a little confused that that's ending up in a variable named @products, but whatever ;)
[14:28:32] matthewd: tinco: Thanks for testing it and fixing the problem :)
[14:28:37] conta: matthewd: it's because in the end it's just list of products by category
[14:28:38] xpl0iter: matthewd, yes, so how do I get it? Sorry if my question seems to be stupid.
[14:28:57] matthewd: tinco: I think you have another one still open that I need to get back to, too
[14:29:02] mrodrigues: has joined #RubyOnRails
[14:29:03] SteenJobs: dminuoso: heh, hm:t worked despite purchase and items being habtm
[14:29:15] matthewd: xpl0iter: Show the relevant line from routes.rb ?
[14:29:52] tinco: matthewd: yeah, that one is a bit more involved I think, the blog post is mainly about that one, was interesting because we didnt expect that to happen on linux
[14:33:48] xpl0iter: matthewd, get '/segments/:id' => 'segments#show'
[14:34:00] matthewd: xpl0iter: Okay, so it should be in params[:id]
[14:34:21] Devalo: has joined #RubyOnRails
[14:36:44] daumie: has joined #RubyOnRails
[14:37:33] mrodrigues: Hey folks! I released recently a new authorization gem (https://github.com/mrodrigues/know_it_all) heavily inspired on Pundit (https://github.com/elabs/pundit), and I'm doing some research to understand how people usually enforce authorization. Do you use any kind of gem for authorization in your applications? If yes, which one? If not, do you follow any defined pattern?
[14:38:14] blackmesa: has joined #RubyOnRails
[14:40:24] AntiSpamMeta: has joined #RubyOnRails
[14:42:26] artto: has joined #RubyOnRails
[14:43:47] mdw: has joined #RubyOnRails
[14:44:05] dminuoso: has joined #RubyOnRails
[14:44:33] alfiemax: has joined #RubyOnRails
[14:45:47] treaki: has joined #RubyOnRails
[14:47:12] ekinmur: has joined #RubyOnRails
[14:48:58] mustmodify: has joined #RubyOnRails
[14:49:51] mustmodify: has left #RubyOnRails: ()
[14:50:13] zacts: has joined #RubyOnRails
[14:52:11] zave: has joined #RubyOnRails
[14:52:40] artto: has joined #RubyOnRails
[14:53:08] qejk: has joined #RubyOnRails
[14:55:05] dionysus69: I am trying to use =begin =end for multi line comments in environments/development.rb and it gives an error in server. Why? syntax error, unexpected '='
[14:58:07] kitsuneyo: has joined #RubyOnRails
[15:00:37] dopamean_: has joined #RubyOnRails
[15:01:23] agit0: has joined #RubyOnRails
[15:01:45] mustmodify: has joined #RubyOnRails
[15:03:27] aegis3121: has joined #RubyOnRails
[15:09:07] kitsuneyo: has joined #RubyOnRails
[15:11:41] benlieb: has joined #RubyOnRails
[15:15:30] JakFrist: has joined #RubyOnRails
[15:16:57] upsell5: has joined #RubyOnRails
[15:18:05] artto: has joined #RubyOnRails
[15:20:48] aegis3121: has joined #RubyOnRails
[15:20:50] daumie: has joined #RubyOnRails
[15:20:50] bga57: has joined #RubyOnRails
[15:21:11] disgrntld: has joined #RubyOnRails
[15:24:19] Dimik: has joined #RubyOnRails
[15:24:19] one_zero: has joined #RubyOnRails
[15:24:23] jahbrewski: has joined #RubyOnRails
[15:29:18] AndrewIsHere: has joined #RubyOnRails
[15:30:57] the_drow: has joined #RubyOnRails
[15:31:55] mustmodify: has left #RubyOnRails: ()
[15:32:26] macsteps: has joined #RubyOnRails
[15:33:22] dikons: has joined #RubyOnRails
[15:33:40] flashpoint9: has joined #RubyOnRails
[15:35:13] dikons: well brian
[15:36:25] SteenJobs: dionysus69: are there spaces preceding the “=“?
[15:39:14] dikons: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[15:39:40] voker57: has joined #RubyOnRails
[15:39:56] dikons: has joined #RubyOnRails
[15:40:51] dikons: has joined #RubyOnRails
[15:41:21] allcentury: has joined #RubyOnRails
[15:41:27] dionysus69: SteenJobs: there were yes, that was the reason of syntax error :) I couldn't expect that would be the reason for it, it is very unintuitive x)
[15:43:11] adavia: has joined #RubyOnRails
[15:43:21] yaewa: has joined #RubyOnRails
[15:44:44] sypheren: has joined #RubyOnRails
[15:49:05] Rodya_: has joined #RubyOnRails
[15:51:04] grn: has joined #RubyOnRails
[15:53:53] Devalo: has joined #RubyOnRails
[15:54:27] moei: has joined #RubyOnRails
[15:55:24] blackmesa: has joined #RubyOnRails
[15:58:18] ekinmur: has joined #RubyOnRails
[15:59:16] hahuang61: has joined #RubyOnRails
[16:01:33] p8m: has joined #RubyOnRails
[16:02:51] agent_white: has joined #RubyOnRails
[16:03:21] tophattom: has left #RubyOnRails: ("WeeChat 1.3")
[16:04:07] whathappens: has joined #RubyOnRails
[16:07:26] [Butch]: has joined #RubyOnRails
[16:07:29] matthewd: tinco: btw, on the socket closing issue... they would've been auto-closed at some point when they got GCed, right?
[16:08:42] chouhoulis: has joined #RubyOnRails
[16:09:23] GragHarker: has joined #RubyOnRails
[16:13:24] daumie: has joined #RubyOnRails
[16:16:18] pur3eval: has joined #RubyOnRails
[16:21:25] finnnnnnnnnnn: has joined #RubyOnRails
[16:23:21] Devalo: has joined #RubyOnRails
[16:24:05] tego101: has joined #RubyOnRails
[16:25:09] wldcordeiro: has joined #RubyOnRails
[16:28:59] pawnbox: has joined #RubyOnRails
[16:29:37] mdw: has joined #RubyOnRails
[16:29:38] Sashimi: has joined #RubyOnRails
[16:37:55] SteenJobs: has joined #RubyOnRails
[16:39:19] cschneid_: has joined #RubyOnRails
[16:40:32] The_Phoenix: has joined #RubyOnRails
[16:40:39] Pupeno: has joined #RubyOnRails
[16:40:39] Pupeno: has joined #RubyOnRails
[16:41:33] upsell5: does params[:abc] allow any atribute? if you want to be safe then create your params.permit method?
[16:45:01] grn: has joined #RubyOnRails
[16:46:28] sebstrax: has joined #RubyOnRails
[16:46:29] manfrin_: has joined #RubyOnRails
[16:47:12] oystersauce8: has joined #RubyOnRails
[16:54:29] eljimmy: has joined #RubyOnRails
[16:56:24] Spami: has joined #RubyOnRails
[16:56:29] JakFrist: has joined #RubyOnRails
[16:57:19] iamvery: has joined #RubyOnRails
[16:58:26] blackmesa: has joined #RubyOnRails
[16:58:31] yfeldblum: has joined #RubyOnRails
[16:58:35] tego101: has joined #RubyOnRails
[16:58:44] artto: has joined #RubyOnRails
[17:00:02] hahuang61: has joined #RubyOnRails
[17:00:31] pwnd_nsfw: has joined #RubyOnRails
[17:01:44] aegis3121: has joined #RubyOnRails
[17:08:10] weaksauce: has joined #RubyOnRails
[17:08:18] timdotrb: has joined #RubyOnRails
[17:10:59] shinnya: has joined #RubyOnRails
[17:12:15] agit0: has joined #RubyOnRails
[17:13:11] JakFrist: has joined #RubyOnRails
[17:15:08] yardenbar: has joined #RubyOnRails
[17:15:20] sneakers: has joined #RubyOnRails
[17:19:46] SteenJobs: has joined #RubyOnRails
[17:20:00] wldcordeiro: has joined #RubyOnRails
[17:22:58] calmchaos: has joined #RubyOnRails
[17:23:30] daumie: has left #RubyOnRails: ("WeeChat 1.4")
[17:26:53] dikons: has joined #RubyOnRails
[17:27:22] macsteps: has joined #RubyOnRails
[17:28:05] Didac: has joined #RubyOnRails
[17:31:01] dikons: has joined #RubyOnRails
[17:31:45] dikons: has left #RubyOnRails: ()
[17:31:49] dikons: has joined #RubyOnRails
[17:33:06] ekinmur: has joined #RubyOnRails
[17:34:56] calmchaos: has joined #RubyOnRails
[17:35:16] pwnd_nsfw`: has joined #RubyOnRails
[17:36:18] roamingdog: has joined #RubyOnRails
[17:37:59] cnk: has joined #RubyOnRails
[17:38:17] timdotrb: Morning, all
[17:38:33] mdw7: has joined #RubyOnRails
[17:39:58] timdotrb: I’m having an issue with a habtm relationship that I have, joining a model onto itself. I have a model called guides, and I need the guides to have associated guides, so at the end of one I can provide links to the others. I feel like I’m close to having it working, but I’m getting an error when there are guides present to select as associations: https://gist.github.com/willc0de4food/bd62466992c51dd52aae79a5aecae094
[17:41:18] mdw: has joined #RubyOnRails
[17:42:35] tinco: matthewd: yeah I guess, maybe my language is a little bit too strong, it could still manifest itself as an issue on a busy server I think
[17:44:54] cnk: timdotrb: that query should have produced ON `guides`.`id` = `guides_guides`.`guider_id`
[17:44:57] matthewd: tinco: Yep, definitely agree.. just wanted to check there isn't actually some form of "Passenger keeps hijacked IOs alive, and thus open, when the app carelessly discards them" thing going on [as well]
[17:45:05] akira616: has joined #RubyOnRails
[17:45:11] timdotrb: cnk: any idea why it didn’t?
[17:45:12] cnk: did you edit your relationship after creating your association?
[17:45:25] timdotrb: I haven’t created any associations
[17:45:35] timdotrb: I just reset the db & created a single guide
[17:46:04] manfrin_: has joined #RubyOnRails
[17:46:07] cnk: Sorry, I had not scrolled down far enough to see your migration
[17:48:30] matthewd: timdotrb: Your habtm definitions need association_foreign_key
[17:49:36] timdotrb: @matthewd: sweet! that worked
[17:49:37] allcentury: has joined #RubyOnRails
[17:51:01] matthewd: No worries!
[17:51:14] deecross: has joined #RubyOnRails
[17:52:40] Sashimi: has joined #RubyOnRails
[17:53:52] dagelf: has joined #RubyOnRails
[17:55:46] flashpoint9: has joined #RubyOnRails
[17:56:12] estiens: has joined #RubyOnRails
[17:58:59] nettoweb: has joined #RubyOnRails
[17:59:12] estiens: anyone particularly good with weird nested to_xml calls? trying to avoid writing a bunch of custom serializers for what I hope is a tiny change
[18:00:09] Pumukel: has joined #RubyOnRails
[18:01:00] Velizar: has joined #RubyOnRails
[18:01:27] blackmesa: has joined #RubyOnRails
[18:06:51] estiens: anyone? anyone?
[18:07:46] havenwood: estiens: Gist an example of what you have and what you want?
[18:09:03] Terens: has joined #RubyOnRails
[18:09:26] gusrub: has joined #RubyOnRails
[18:10:06] dionysus69: has joined #RubyOnRails
[18:11:05] estiens: @havenwood https://gist.github.com/estiens/c3607b846dc674bd2d504c4de9dc46fd
[18:11:19] estiens: Basically I’m serializing a parent object and including associated objects
[18:11:26] estiens: However now I have a soft delete on those objects
[18:11:44] estiens: so I need to somehow filter the association to only include the non-soft deleted objects
[18:11:51] estiens: There’s a bunch of these includes
[18:11:54] deecross: has joined #RubyOnRails
[18:12:04] estiens: and I’m trying to avoid having to write a new association for each one
[18:12:22] kriptonium: has joined #RubyOnRails
[18:12:49] ekinmur: has joined #RubyOnRails
[18:12:56] estiens: but passing that conditions key doesn’t seem to do anything
[18:13:02] estiens: so not sure it actually is possible
[18:15:29] cnk: estiens: how about setting up a relationship on the clinical_protocol model that is only the non-deleted thoughts, Fragments, etc
[18:15:39] cnk: then you don't need the conditions in the xml
[18:15:57] SteenJobs: has joined #RubyOnRails
[18:16:02] estiens: yeah that was my next step, it just requires changes to about 12 models in two separate apps so was trying to avoid it if at all possible
[18:16:04] cnk: include: active_thoughts or whatever you call it
[18:16:05] AmiMoench: has joined #RubyOnRails
[18:16:51] estiens: I already hae a scope: thoughts.active so it’s not hard, just annoying ;) because I can call thoughts.active wherever I need to the only place this new association will be used is the serializer
[18:17:10] estiens: I could also use a default scope I guess but that causes me lots of other problems, I hate default scopes
[18:17:42] cnk: I guess but any time I have done a soft delete I wanted the default to be any not deleted
[18:18:24] cnk: if ever there was a use case for default scopes, soft deletes is it
[18:20:22] cnk: estiens: wild idea, does include: { :'thoughts.active' => {} .... work?
[18:21:02] macsteps: has joined #RubyOnRails
[18:21:41] estiens: i’ll check, just assumed it wouldn’t :)
[18:22:30] cnk: oh well
[18:29:14] manfrin_: has joined #RubyOnRails
[18:30:59] pawnbox: has joined #RubyOnRails
[18:31:46] fl4sh_: I'm currently locking down my rails app. Which directories does an app need write permission for in order to function properly?
[18:32:32] matthewd: fl4sh_: Production at runtime? log and tmp.
[18:32:51] max2: has joined #RubyOnRails
[18:33:18] matthewd: fl4sh_: At ~deploy time, also db/schema.rb and public/assets/
[18:33:25] kriptonium: has joined #RubyOnRails
[18:33:52] yardenbar: has left #RubyOnRails: ("Leaving")
[18:33:59] fl4sh_: Any reason why rake db:create want's to write to my gemfile.lock? o.o
[18:34:58] fl4sh_: Erm *wants. Now my spelling is fading as well ---
[18:35:45] matthewd: That'll be bundler
[18:36:19] Rodya_: has joined #RubyOnRails
[18:36:35] matthewd: Presumably you're doing a 'bundle exec'.. but I wouldn't normally expect that to write to an existing lockfile (unlike, say, bundle update)
[18:37:15] matthewd: If it's failing, you should have a backtrace that tells you exactly what/where is writing
[18:38:12] estiens: has joined #RubyOnRails
[18:39:22] Oliphaunte: has joined #RubyOnRails
[18:41:30] AndroidLoverInSF: has joined #RubyOnRails
[18:44:25] Pupeno: has joined #RubyOnRails
[18:44:25] Pupeno: has joined #RubyOnRails
[18:44:38] xpl0iter: has joined #RubyOnRails
[18:45:42] xpl0iter: Hi, I am trying to save a profile to profiles table. But it shows this: http://pastie.org/private/m0rb8sndnp70tdkyrevbsw instead of the insert statement. Can someone please help me to figure out why this happens?
[18:45:55] umdstu: trying to parse some data from a mongodb store, and after cleaning it up, and i trying to render it as json in a response, I get “Encoding::UndefinedConversionError (“\xD9” from ASCII-8BIT to UTF-8):; even after i called to_s.encode(‘UTF-9’) on the values being cleaned up.
[18:46:45] Pupeno: has joined #RubyOnRails
[18:47:09] macsteps: has joined #RubyOnRails
[18:47:29] pur3eval: has joined #RubyOnRails
[18:49:50] fl4sh_: matthewd: Well, I'm calling rake and rails from command line. But using their path bin/rails won't help either
[18:49:56] deecross: has joined #RubyOnRails
[18:49:57] fl4sh_: Still complaining about that lockfile
[18:50:40] matthewd: fl4sh_: Copy the file, give it access, then diff to see what it wants to change?
[18:56:16] fl4sh_: kk, it's ruby writing platform-entries and nokogiri gem versions for ruby rather than that mingw stuff
[18:56:28] fl4sh_: Guess that's why you shouldn't develop your app under windows x)
[18:58:29] daumie: has joined #RubyOnRails
[18:59:27] pur3eval: has joined #RubyOnRails
[19:00:45] hahuang61: has joined #RubyOnRails
[19:01:09] mcr-credil: has joined #RubyOnRails
[19:01:47] chouhoulis: has joined #RubyOnRails
[19:03:45] emachnic: has joined #RubyOnRails
[19:03:46] jstransky: has joined #RubyOnRails
[19:03:56] blackmesa: has joined #RubyOnRails
[19:05:48] Darkman738: has joined #RubyOnRails
[19:06:44] Darkman738: hi all, I'm sure I'm missing something simple. I've got a download link I've setup using send_file however when I click the link it renders the file in the browser as if I had "render inline: filename" Any idea what I'm doing wrong?
[19:07:13] Darkman738: it's literally one line, a link_to a download action and send_file in the controller
[19:07:34] matthewd: fl4sh_: Hah. I've never quite understood the details of bundler + platform stuff, but I think the theory is if you commit that change back, then bundler-on-windows should attempt to keep the linux entries up to date thereafter
[19:07:35] Coldblackice: has joined #RubyOnRails
[19:07:46] matthewd: fl4sh_: Basically, once it knows linux is a thing it's supposed to care about
[19:09:08] matthewd: darkman738: Per http://api.rubyonrails.org/classes/ActionController/DataStreaming.html#method-i-send_file, `disposition: :attachment` should be the default
[19:10:40] Darkman738: specifying that I still get the same result
[19:11:23] Darkman738: wonder if it's a browser issue
[19:12:01] Darkman738: no, still does it in Safari
[19:12:21] matthewd: darkman738: Check the content-disposition header is making it to the browser
[19:12:49] matthewd: Are you going through nginx/apache/whatever, or talking straight to the app?
[19:13:34] Darkman738: Content-Disposition: attachment; filename="" in the response headers when I click the link
[19:14:06] matthewd: With no filename? :/
[19:14:09] cnk: needs to have a filename for download
[19:14:22] Darkman738: no, I omitted it sorry
[19:14:29] Darkman738: should have said
[19:14:52] Darkman738: but it's in the actual value
[19:15:07] Darkman738: Content-Disposition: attachment; filename="file.ext"
[19:15:08] matthewd: Try a different file [format]
[19:15:29] matthewd: e.g., an image
[19:16:01] matthewd: (I assume your current file is a PDF)
[19:17:08] Darkman738: you mean a different actual file or specifying a file with the :type option?
[19:17:16] macsteps: has joined #RubyOnRails
[19:17:27] Darkman738: because it was doing this with 'text\csv' as well
[19:18:00] matthewd: > renders the file in the browser
[19:18:52] matthewd: Is that "shows the file in a file-appropriate way", or "treats the binary file as a bunch of characters in a big long string"?
[19:19:30] Darkman738: "treats the binary file as a bunch of characters in a big long string"
[19:20:00] Darkman738: as it's a zip that is what I would expect it to do with "render inline" but I'm a bit of a n00b so...
[19:20:06] tomeara: has joined #RubyOnRails
[19:21:55] Darkman738: send_file command is : send_file file_name, :filename => File.basename(file_name), :type=>"application/zip", disposition: :attachment, :x_sendfile=>true
[19:22:27] matthewd: [04:42:48] <matthewd> Are you going through nginx/apache/whatever, or talking straight to the app?
[19:23:16] Darkman738: WebBrick, local instance
[19:23:23] Oliphaunte: has joined #RubyOnRails
[19:23:35] matthewd: Does turning off x_sendfile help?
[19:24:01] Darkman738: I tried flipping it true/false and removing it
[19:25:27] matthewd: Hmm.. really, if your browser is seeing the disposition: attachment, I'm not sure how it can be a server problem
[19:25:35] SteenJobs: has joined #RubyOnRails
[19:25:36] JakFrist: has joined #RubyOnRails
[19:25:42] Darkman738: but multiple browsers?
[19:25:48] Darkman738: not saying your wrong
[19:26:13] SteenJobs: has joined #RubyOnRails
[19:31:01] srinidhi: has joined #RubyOnRails
[19:32:36] roamingdog: has joined #RubyOnRails
[19:35:10] kriptonium: has joined #RubyOnRails
[19:36:11] nettoweb: has joined #RubyOnRails
[19:36:11] upsell5: has joined #RubyOnRails
[19:40:08] Pupeno: has joined #RubyOnRails
[19:40:08] Pupeno: has joined #RubyOnRails
[19:40:35] k1t: has joined #RubyOnRails
[19:40:42] Miccet: has joined #RubyOnRails
[19:41:07] xpl0iter: Hi, is there anyway I can do a presence check in the model based on which action is calling it?
[19:42:25] elementaru: has joined #RubyOnRails
[19:44:33] antgel: has joined #RubyOnRails
[19:46:49] meoblast001: has joined #RubyOnRails
[19:47:09] lalalaaa: has joined #RubyOnRails
[19:49:21] Darkman738: yeah, idk, I just tried someone else's machine with the same results too
[19:49:24] arBmind: has joined #RubyOnRails
[19:52:56] futilegames: has joined #RubyOnRails
[19:53:42] Pupeno: has joined #RubyOnRails
[19:53:59] Pupeno: has joined #RubyOnRails
[19:54:35] whathappens: has joined #RubyOnRails
[19:55:22] yfeldblum: has joined #RubyOnRails
[19:56:15] Spami: has joined #RubyOnRails
[19:56:29] danjam: has joined #RubyOnRails
[19:56:37] solars: has joined #RubyOnRails
[19:57:53] danjam: I'm scratching my head about a really weird bug. Not sure if it's an issue with the rails guides site, firefox, my pc or what. https://www.youtube.com/watch?v=bdM6BPyjIH4
[19:58:50] mello: has joined #RubyOnRails
[19:58:57] matthewd: danjam: Huh.
[19:59:25] Miccet: what happens if you zoom the page, does it appear?
[19:59:26] matthewd: danjam: Does playing with any of the margin/padding on relevant-looking elements make it appear?
[19:59:33] cnk: xpl0iter: You do not have access to controller informatino inside the model. But you can check if something is created yet - if you want to differentiate between create and update
[19:59:48] danjam: matthewd: lemme check
[19:59:58] fox_mulder_cp: screen of Web Hosting Control Panel, made ​​by me https://1drv.ms/i/s!AvS3PCPMZNLuiJNOML9mXkGHIgTeNw
[20:00:11] danjam: matthewd: it works fine on my laptop, with the same browser and os (though different versions)
[20:01:04] fox_mulder_cp: first milestone done
[20:01:15] matthewd: danjam: Something else to check: other versions of the same guide
[20:01:22] Miccet: i have the same in firefox danjam
[20:01:50] danjam: I mean the html is fine... I thought it was a type and went to github to fix it, but it's fine there
[20:02:25] danjam: playing with padding doesn't seem to do anything
[20:02:33] Miccet: switching the font makes it appear
[20:02:48] calmchaos: has joined #RubyOnRails
[20:03:05] Miccet: if i force it to Arial I can see the underscore
[20:03:30] danjam: how to you force a font change? just a html edit?
[20:03:53] Miccet: yea just add a font-family: Arial!important to the code tag
[20:04:07] Miccet: or uncheck the fonts that are set
[20:04:14] Terens: Hello. In case you had to run an oauth2 server and use RoR would you use a ruby one like https://github.com/nov/rack-oauth2 or a more popular one and write some logic in RoR?
[20:04:23] fox_mulder_cp: it's a html/css scope, not rails :)
[20:04:42] matthewd: What about http://edgeguides.rubyonrails.org/active_record_migrations.html ?
[20:04:45] danjam: yeah, ariel fixes it for me too. what the hell
[20:05:01] Miccet: probably an issue with the imported font on certain platforms i guess
[20:05:11] matthewd: miccet: Are you on Linux too?
[20:05:23] mrodrigues: has joined #RubyOnRails
[20:05:43] danjam: matthewd: it's exactly the same with that url, and arial makes it work there too
[20:06:39] danjam: Yeah seems like a font issue, but the underscore renders correctly on the rest of the page
[20:08:18] matthewd: Does it also appear when you double-click?
[20:08:44] danjam: Yup, it does
[20:08:48] Miccet: same here
[20:08:53] calmchaos: has joined #RubyOnRails
[20:10:00] antgel: has joined #RubyOnRails
[20:10:14] mdw: has joined #RubyOnRails
[20:10:54] Darmani: has joined #RubyOnRails
[20:12:24] matthewd: I guess make an issue with some screenshots, and some version numbers, and hopefully someone can work out how to fix it
[20:12:55] jenrzzz: has joined #RubyOnRails
[20:13:48] danjam: Where should I open an issue? Rails guides? Firefox?
[20:14:39] matthewd: rails/rails -- the guides are in the main repo
[20:15:11] danjam: Okay, will do
[20:15:46] matthewd: Thanks! Hopefully we can save a future-someone some confusion
[20:17:11] SteenJobs: has joined #RubyOnRails
[20:17:57] bjreath: has joined #RubyOnRails
[20:18:48] bjreath: has joined #RubyOnRails
[20:23:38] workmad3: has joined #RubyOnRails
[20:29:06] macsteps: has joined #RubyOnRails
[20:40:35] maxx88_: has joined #RubyOnRails
[20:40:54] eljimmy: has joined #RubyOnRails
[20:41:01] roamingdog: has joined #RubyOnRails
[20:41:42] bradflaugher: has joined #RubyOnRails
[20:42:56] Darmani: ACTION looks for jhass
[20:43:14] snowy: has joined #RubyOnRails
[20:43:31] pur3eval: has joined #RubyOnRails
[20:47:13] pvertenten: has joined #RubyOnRails
[20:47:17] pur3eval_: has joined #RubyOnRails
[20:47:29] Scriptonaut: has joined #RubyOnRails
[20:50:08] CausaMortis: has joined #RubyOnRails
[20:53:01] jenrzzz: has joined #RubyOnRails
[20:54:23] mello: is there a way to make like an onclick event that triggers a rails action?
[20:54:50] Pupeno: has joined #RubyOnRails
[20:57:44] asheinfeld: has joined #RubyOnRails
[20:58:30] Scriptonaut: has left #RubyOnRails: ()
[20:59:52] jahbrewski: has joined #RubyOnRails
[21:01:32] hahuang61: has joined #RubyOnRails
[21:06:12] ivanskie: has joined #RubyOnRails
[21:06:13] pawnbox: has joined #RubyOnRails
[21:06:14] zacts: has joined #RubyOnRails
[21:16:58] blackmesa: has joined #RubyOnRails
[21:22:41] Rainbow-Sapphire: has joined #RubyOnRails
[21:23:10] oystersauce8: has joined #RubyOnRails
[21:23:16] USvER: has joined #RubyOnRails
[21:23:38] roamingdog: mello: http://guides.rubyonrails.org/working_with_javascript_in_rails.html
[21:23:44] cnk: mello - sure you can make an ajax call from a click
[21:25:02] akira616: has joined #RubyOnRails
[21:26:58] pawnbox: has joined #RubyOnRails
[21:27:45] pur3eval: has joined #RubyOnRails
[21:28:51] mello: cnk: problem is that the the destroy call triggers every time even if i dont press the link, but if i do a basi alert "hi" that only triggers when i press the link
[21:29:27] whathappens: has joined #RubyOnRails
[21:31:35] moep: has joined #RubyOnRails
[21:31:54] quazimodo: has joined #RubyOnRails
[21:32:10] cnk: are you using the defalt rails unobtrusive JS? and the delete with warning?
[21:32:26] cnk: that's how I would unless you have something specific you need to do
[21:32:27] marcules: has joined #RubyOnRails
[21:34:31] bruce_lee: has joined #RubyOnRails
[21:34:41] Darmani: Hey guys, how do I get my shirt variables into my order#show controller?
[21:34:42] Darmani: https://gist.github.com/mfifth/5c2d8a661d9ff3fdc86b47493e3932eb#file-orders_controller-rb-L7
[21:35:09] Darmani: I have a foreign key for my variants but I need to get the "shirts" in there somehow too...
[21:38:51] havenwood: Darmani: Are you wanting?: @order.shirts
[21:39:21] havenwood: Darmani: Is this right?: https://gist.github.com/mfifth/5c2d8a661d9ff3fdc86b47493e3932eb#file-shirt-rb-L6
[21:39:32] Darmani: havenwood: That would be the simplest solution but I don't have a foreign key for my shirts in my orders.
[21:39:44] Darmani: Cause technically they are ordering "variants".
[21:40:21] havenwood: Darmani: https://gist.github.com/mfifth/5c2d8a661d9ff3fdc86b47493e3932eb#file-order-rb-L3-L4
[21:40:33] havenwood: Darmani: http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
[21:41:03] Darmani: havenwood: I wasn't sure if the has_many through: was the best solution... Does that work?
[21:41:10] Darmani: I just threw that in there.
[21:41:45] crdpink: has joined #RubyOnRails
[21:43:02] havenwood: Darmani: Study how the example has it. Check the line I questioned above. Then try it in your REPL!
[21:43:27] Darmani: havenwood: Couldn't just give me a simple yes or no could you? xP
[21:44:01] roamingdog: i definitely heard a 'no' implied in there
[21:44:26] Darmani: roamingdog: Do you speak Havenwood bro? I haven't studied that language yet =p
[21:44:45] roamingdog: Darmani: if you're tracking variant purchases, then an order will have variants, not shirts
[21:45:17] ur5us: has joined #RubyOnRails
[21:45:32] Darmani: roamingdog: yeah but my "shirts" are where I have the photo of the shirt stored.
[21:46:09] roamingdog: Darmani: i'd expect you get to the photo with @variant.shirt.photo
[21:46:44] Darmani: roamingdog: No way, it can't be that simple.
[21:46:47] Darmani: I'll eat my hat
[21:47:05] roamingdog: Darmani: if you have it set up so variant belongs to shirt, sure
[21:47:33] Darmani: roamingdog: I suppose that logic is sound...
[21:47:53] Darmani: lemme try dat
[21:48:38] crdpink: has joined #RubyOnRails
[21:48:59] SteenJobs: has joined #RubyOnRails
[21:55:14] Darmani: roamingdog: I think that worked... I ran into a different problem but that one didn't give me an error =p
[21:55:16] Darmani: so thanks lol
[21:55:23] roamingdog: enjoy your hat
[21:57:09] roamingdog: has joined #RubyOnRails
[21:57:55] Darmani: roamingdog: funny :p
[21:59:31] creyes: has joined #RubyOnRails
[21:59:55] Pupeno: has joined #RubyOnRails
[22:00:40] cd-rum: has joined #RubyOnRails
[22:03:02] wldcordeiro: has joined #RubyOnRails
[22:04:24] pawnbox: has joined #RubyOnRails
[22:04:35] gusrub: has joined #RubyOnRails
[22:04:40] pramodv: has joined #RubyOnRails
[22:04:50] upsell5: has joined #RubyOnRails
[22:05:18] Rainbow-Sapphire: has joined #RubyOnRails
[22:05:52] Darmani: I don't think I'm actually adding anything to my order with this method.
[22:05:53] Darmani: https://gist.github.com/mfifth/5c2d8a661d9ff3fdc86b47493e3932eb#file-orders_controller-rb-L10
[22:05:59] cd-rum: has joined #RubyOnRails
[22:06:25] Rainbow-Sapphire: has joined #RubyOnRails
[22:06:34] Darmani: how2fixit.jpg?
[22:08:08] manfrin_: has joined #RubyOnRails
[22:09:23] pramsky: has joined #RubyOnRails
[22:12:09] roamingdog: Darmani: @order.variants << @variant
[22:12:37] ekinmur: has joined #RubyOnRails
[22:12:43] roamingdog: actually not sure about that...
[22:13:08] Darmani: roamingdog: yeaaaaaahh....
[22:13:18] roamingdog: do try it though
[22:13:47] Darmani: roamingdog: Variant(#70317570955300) expected, got NilClass(#17170380)
[22:14:31] roamingdog: it's progress, look at the params, find out why it's not finding a variant
[22:15:56] zacts: has joined #RubyOnRails
[22:16:40] roamingdog: Darmani: wait, won't several shirts have the same combos of size and color?
[22:17:11] Darmani: roamingdog: yeah...
[22:17:36] Darmani: So by name?
[22:17:43] Darmani: No because even the names are somewhat similar...
[22:17:51] Darmani: Maybe by id?
[22:20:20] roamingdog: do you have a shirt_id handy? in params?
[22:20:25] macsteps: has joined #RubyOnRails
[22:20:58] Darmani: roamingdog: https://gist.github.com/mfifth/5c2d8a661d9ff3fdc86b47493e3932eb#file-show-html-erb
[22:21:19] roamingdog: then you could do Shirt.find(params[:shirt_id].find_by(color: ....) maybe
[22:21:47] roamingdog: Shirt.find(params[:shirt_id]).find_by(color: ....) rather
[22:22:12] roamingdog: no variant_id either i guess?
[22:22:33] Darmani: roamingdog: No.. I didn't realize I needed those things >.<
[22:23:15] roamingdog: you do, from the collection_select, you should be able to get the variant_id
[22:23:43] Darmani: roamingdog: Really? :o
[22:24:29] Darmani: So... @variant = Variant.find_by(name: params[:name], variant_id: params[:variant_id])?
[22:25:08] roamingdog: Variant.find([params[:variantid])
[22:25:14] roamingdog: Variant.find([params[:variant_id])
[22:25:39] roamingdog: id is enough to get one variant
[22:26:16] Darmani: roamingdog: record not found... D:
[22:26:51] roamingdog: what's the value of params[:variant_id]?
[22:27:23] Darmani: roamingdog: goddamn it I actually have to go.
[22:27:26] Darmani: But you are amazing.
[22:27:32] roamingdog: no worries, later
[22:27:33] Darmani: And I'll be back in like 2 hours or so
[22:27:46] Darmani: anyway bbl
[22:29:30] jenrzzz: has joined #RubyOnRails
[22:32:01] KnownSyntax_: has joined #RubyOnRails
[22:32:01] KnownSyntax_: has joined #RubyOnRails
[22:42:19] pawnbox: has joined #RubyOnRails
[22:43:29] Scriptonaut: has joined #RubyOnRails
[22:47:04] lalalaaa: has joined #RubyOnRails
[22:48:32] Scriptonaut: I'm having some weird behavior. I have a form, with 3 inputs. 2 radio buttons, and a regular text input. When I submit the form, none of the input values show up in the parameters. Here is the form, and a snapshot of a session where I compare the query_string and the parameters.
[22:48:37] Scriptonaut: https://gist.github.com/robins35/0d0aa939f50fe07025147341052df1a8
[22:48:58] Scriptonaut: the query string has the parameters, but the params hash does not have them
[22:49:06] Scriptonaut: I've never had params not show up
[22:49:07] Radar: Scriptonaut: "action" is a reserved parameter name in Rails.
[22:49:27] Scriptonaut: what should I do? One of my models is Action
[22:49:43] CausaMortis: hey guys, total newb to ruby/rails here. playing around with rspec and vcr and I am having a hard time understanding how to test whether or not my response is of a certain http_status. I assume it fails because vcr stores everything in a file
[22:49:52] whathappens: has joined #RubyOnRails
[22:49:53] cnk: Scriptonaut: What kind of action?
[22:49:58] CausaMortis: so how would I test that it is infact a valid response?
[22:50:00] Radar: Scriptonaut: Rename the model, or use as: :some_other_action in your form
[22:50:01] cnk: I would rename your model
[22:50:10] Scriptonaut: ah, ok, I'll do that
[22:50:22] Scriptonaut: cnk, renaming the model would be a major refactor that I would have to discuss with my team
[22:50:28] Scriptonaut: this is a massive project I'm working on
[22:50:40] Scriptonaut: also, the Action model was around long before I joined this project
[22:50:51] cnk: Hmm then surprised this issue hasn't shown up before now
[22:51:03] Scriptonaut: I have no idea how the form was working before
[22:52:24] quazimodo: has joined #RubyOnRails
[22:52:50] Radar: I guess it had an as: parameter.
[22:53:33] jenrzzz: has joined #RubyOnRails
[22:54:50] Scriptonaut: awesome, that worked
[22:54:52] Scriptonaut: thank you guys
[22:55:22] Pupeno: has joined #RubyOnRails
[22:59:29] whathappens: has joined #RubyOnRails
[23:02:14] hahuang61: has joined #RubyOnRails
[23:02:50] pawnbox: has joined #RubyOnRails
[23:03:01] jstransky: has joined #RubyOnRails
[23:05:41] Velizar: has joined #RubyOnRails
[23:06:20] epitron: Hmmm... is there a way to guard against a has_one being unintentionally clobbered by build_<thing>?
[23:06:56] epitron: the AR internals are really complex.. i'm not where it would be safe to stick a monkeypatch
[23:07:04] epitron: is there a callback I can use or something?
[23:07:39] epitron: *i'm not sure where it would be safe
[23:08:31] dalbusch1t: has joined #RubyOnRails
[23:09:09] matthewd: epitron: Not really. Redefine build_foo, I guess?
[23:10:01] epitron: matthewd: unfortunately those methods are auto-generated
[23:10:21] epitron: i was interested in doing it for all has_ones
[23:10:22] matthewd: epitron: That doesn't prevent you from overriding it
[23:10:29] epitron: yeah, but that would be a lot of cruft
[23:11:02] matthewd: That sounds rather a lot like developer-proofing, which is more likely to cause confusion (by making your app behave not quite like AR)
[23:12:21] yfeldblum: has joined #RubyOnRails
[23:13:34] epitron: matthewd: i don't think anyone's paid much attention to has_one, because clobbering the record is pretty nutty :)
[23:13:51] dgynn: has joined #RubyOnRails
[23:13:54] matthewd: epitron: If you care, it's here: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations/singular_association.rb#L34-L39
[23:14:06] epitron: build_thing shouldn't clobber until you save it, at the very least
[23:14:33] epitron: assigning an unsaved record to the has_one destroys the record
[23:15:31] epitron: matthewd: i guess i should make a safe_has_one helper? :)
[23:16:04] Dreamer3: has joined #RubyOnRails
[23:16:14] zacts: has joined #RubyOnRails
[23:16:15] matthewd: ActiveRecord::Associations::SingularAssociation.prepend Module.new { def build(*); raise 'epitron says no' if reader; super; end }
[23:16:18] matthewd: Something like that
[23:16:35] epitron: hmm, ok, that works in a pinch
[23:16:38] svkurowski_: has joined #RubyOnRails
[23:16:42] jenrzzz: has joined #RubyOnRails
[23:17:27] epitron: sweet, thanks :)
[23:17:51] matthewd: You're welcome :)
[23:18:28] epitron: the cache doesn't get cleared when you do record.has_one_thing.destroy
[23:18:33] Scriptonaut: has left #RubyOnRails: ()
[23:18:34] epitron: it still looks like the record has one
[23:18:52] epitron: DHH must never use has_ones or something -- it seems neglected
[23:21:00] matthewd: grep says: 15, vs ~80 each for belongs_to and has_many.. so, less, but not none ¯\_(ツ)_/¯
[23:24:32] manfrin_: has joined #RubyOnRails
[23:26:48] Fernando-Basso: How should I test inserting posts that require a category? How do I set that in fixtures/posts.yml?
[23:29:30] SteenJobs: has joined #RubyOnRails
[23:30:40] pawnbox: has joined #RubyOnRails
[23:31:19] tw1sted: has joined #RubyOnRails
[23:31:44] phrozen77: has joined #RubyOnRails
[23:33:48] Fernando-Basso: Ah, that (:one) thing is the thing in the .yml file.
[23:34:59] PlasmaStar: has joined #RubyOnRails
[23:35:22] Scient: has joined #RubyOnRails
[23:37:00] quazimodo: has joined #RubyOnRails
[23:40:36] ur5us: has joined #RubyOnRails
[23:42:03] badeball: has joined #RubyOnRails
[23:43:46] kriptonium: has joined #RubyOnRails
[23:45:11] kriptonium: has joined #RubyOnRails
[23:50:10] akira616`: has joined #RubyOnRails
[23:52:47] USvER: has joined #RubyOnRails
[23:56:53] nettoweb: has joined #RubyOnRails
[23:59:05] eserror: has joined #RubyOnRails