« Back to channel list

#RubyOnRails - 14 March 2017

« Back 1 day Forward 1 day »
[00:00:43] matcouto: Hi guys, just a silly question, but can't get it out of my mind. Thinking restful, if there’s a feature that creates a Completion for a Visit, which is basically updating the completion details in this Visit in question, POST /visits/:visit_id/completion, and now you need to undo this completion, would you create a custom action for that or just implementing the same update, but removing the completion details, inside the Destroy metho
[00:00:44] matcouto: d would do?
[00:03:06] bitshift: matcouto: HTTP DELETE?
[00:03:15] bitshift: You could do shallow routes if you wanted too.
[00:03:49] das3in: has joined #RubyOnRails
[00:06:24] das3in: Can someone help me re-write this controller? I'm getting the error 'no such house_id' which is true - there is no house_id. (there's a join table user_houses) - it's pretty clear what I'm trying to achieve, jsut having a little trouble getting htere
[00:06:24] das3in: https://gist.github.com/das3in/21011ef317d62742c00ba5d5b71f8e19
[00:07:09] xaviergmail: has joined #RubyOnRails
[00:08:23] matcouto: bitshift: yeah DELETE is what I meant
[00:08:49] bitshift: matcouto: Or PUT/PATCH and change the doc.
[00:09:37] xaviergmail: Is there a way to automatically generate migrations based on model classes like Django does?
[00:10:10] matcouto: I think Delete makes more sense. Thanks bitshift
[00:15:36] czerasz: has joined #RubyOnRails
[00:15:45] doodlehaus: has joined #RubyOnRails
[00:16:26] pawnbox: has joined #RubyOnRails
[00:16:48] Ayey_: has joined #RubyOnRails
[00:17:17] cschneid_: has joined #RubyOnRails
[00:17:50] cnk: xaviergmail: no - but on the bright side, you don't have to figth with the migration machinery 'cause you wrote the migrations yourself
[00:19:59] mikecmpbll: has joined #RubyOnRails
[00:23:50] maguar: has joined #RubyOnRails
[00:41:20] orpl: has joined #RubyOnRails
[00:44:20] dopamean_: has joined #RubyOnRails
[00:46:11] brent__: has joined #RubyOnRails
[00:47:54] fourcolors: has joined #RubyOnRails
[00:52:37] benlieb: has joined #RubyOnRails
[00:54:41] das3in: anyone help with this controller? https://gist.github.com/das3in/21011ef317d62742c00ba5d5b71f8e19
[00:55:17] jhack: has joined #RubyOnRails
[00:57:27] thomashickey: has joined #RubyOnRails
[00:57:52] thomashickey: has joined #RubyOnRails
[01:01:20] nahtnam: has joined #RubyOnRails
[01:01:32] treefrob_: has joined #RubyOnRails
[01:03:03] benlieb: has joined #RubyOnRails
[01:05:54] pawnbox: has joined #RubyOnRails
[01:09:17] matcouto: has joined #RubyOnRails
[01:16:41] Olipro: has joined #RubyOnRails
[01:30:02] alfie: has joined #RubyOnRails
[01:32:48] arBmind: has joined #RubyOnRails
[01:41:05] maguar: has joined #RubyOnRails
[01:43:53] benlieb: has joined #RubyOnRails
[01:55:21] am55_: has joined #RubyOnRails
[01:58:29] benlieb: has joined #RubyOnRails
[01:59:22] Ayey_: has joined #RubyOnRails
[01:59:43] DoctorMonocular: has joined #RubyOnRails
[02:04:25] irishfromua: has joined #RubyOnRails
[02:04:34] Coldblackice: has joined #RubyOnRails
[02:08:35] chrickso: has joined #RubyOnRails
[02:08:58] alex88: has joined #RubyOnRails
[02:09:50] irishfromua: has joined #RubyOnRails
[02:11:37] shinnya: has joined #RubyOnRails
[02:15:33] jenrzzz: has joined #RubyOnRails
[02:18:07] treefrob_: has joined #RubyOnRails
[02:23:02] Jameser: has joined #RubyOnRails
[02:27:50] metadox: has joined #RubyOnRails
[02:29:31] _3dwardsharp: has joined #RubyOnRails
[02:40:17] Jameser`: has joined #RubyOnRails
[02:40:28] chimkan: has joined #RubyOnRails
[02:47:19] bruce_lee: has joined #RubyOnRails
[02:50:12] Jameser: has joined #RubyOnRails
[02:50:59] pwnd_nsfw: Did that guy just ask for help, post code, but not even identify the problem?
[02:51:24] pwnd_nsfw: I see an issue, but come on now. mices isn't even here
[02:56:39] hahuang61: has joined #RubyOnRails
[02:58:04] akshat: has joined #RubyOnRails
[03:05:27] hahuang61: has joined #RubyOnRails
[03:06:15] roflmyeggo: has joined #RubyOnRails
[03:06:52] libastral: has joined #RubyOnRails
[03:07:00] chouhoulis: has joined #RubyOnRails
[03:10:13] Ayey_: has joined #RubyOnRails
[03:14:34] pawnbox: has joined #RubyOnRails
[03:14:43] Duckily: has joined #RubyOnRails
[03:17:07] roflmyeggo: has joined #RubyOnRails
[03:17:13] Technodrome: has joined #RubyOnRails
[03:24:21] KnownSyntax: has joined #RubyOnRails
[03:27:02] Derperperd: has joined #RubyOnRails
[03:29:07] cschneid_: has joined #RubyOnRails
[03:30:35] jnoob22: has joined #RubyOnRails
[03:37:31] xaviergmail: has joined #RubyOnRails
[03:37:33] hakash: has joined #RubyOnRails
[03:40:15] xall_: has joined #RubyOnRails
[03:41:05] Ropeney: has joined #RubyOnRails
[03:42:44] xall: has joined #RubyOnRails
[03:44:14] duderonomy: has joined #RubyOnRails
[03:44:20] pawnbox: has joined #RubyOnRails
[03:47:00] irishfromua: has joined #RubyOnRails
[03:52:26] _djbkd: has joined #RubyOnRails
[03:52:58] Flwyd: has joined #RubyOnRails
[03:56:10] eclecticjohny: has joined #RubyOnRails
[04:05:00] Ayey_: has joined #RubyOnRails
[04:06:37] Jameser`: has joined #RubyOnRails
[04:07:07] matcouto_: has joined #RubyOnRails
[04:14:07] pawnbox: has joined #RubyOnRails
[04:21:32] ahrs_: has joined #RubyOnRails
[04:22:14] patarr: has joined #RubyOnRails
[04:23:16] robm: has joined #RubyOnRails
[04:28:58] Jameser: has joined #RubyOnRails
[04:31:51] Jameser: has joined #RubyOnRails
[04:33:32] pawnbox: has joined #RubyOnRails
[04:33:59] Ayey_: has joined #RubyOnRails
[04:34:30] hotpancakes: has joined #RubyOnRails
[04:43:36] ahrs: has joined #RubyOnRails
[04:45:48] raul782: has joined #RubyOnRails
[04:46:35] raul782: Hello guys, I still fighting against act_as_audited, but I haven't made progress on why my User table is not audited but all my other models are.
[04:49:50] raul782: Is there a way to override how that gem is setup? https://github.com/collectiveidea/audited/blob/master/lib/audited/audit.rb#L18
[04:51:00] Jameser: has joined #RubyOnRails
[04:52:05] pawnbox: has joined #RubyOnRails
[04:55:26] matcouto: has joined #RubyOnRails
[04:55:54] hakash: has joined #RubyOnRails
[04:56:04] Flwyd: has joined #RubyOnRails
[04:58:30] Jameser`: has joined #RubyOnRails
[05:00:46] metadox: has joined #RubyOnRails
[05:01:19] Jameser: has joined #RubyOnRails
[05:03:51] Ayey_: has joined #RubyOnRails
[05:08:55] Trynemjoel: has joined #RubyOnRails
[05:11:29] cschneid_: has joined #RubyOnRails
[05:13:00] Flwyd: has joined #RubyOnRails
[05:13:56] Flwydity: has joined #RubyOnRails
[05:14:10] matcouto: has joined #RubyOnRails
[05:20:35] itsgokul: has joined #RubyOnRails
[05:21:10] Guest77: has joined #RubyOnRails
[05:24:31] robm: has joined #RubyOnRails
[05:26:34] Technodrome: has joined #RubyOnRails
[05:31:48] xaviergmail: has joined #RubyOnRails
[05:32:27] hotpanca_: has joined #RubyOnRails
[05:32:56] pulkit4tech: has joined #RubyOnRails
[05:34:35] jeyraof^mbpr: has joined #RubyOnRails
[05:38:48] hexkey[m]: has joined #RubyOnRails
[05:39:31] czerasz2: has joined #RubyOnRails
[05:43:52] doodlehaus: has joined #RubyOnRails
[05:50:48] d0nn1e: has joined #RubyOnRails
[05:54:07] armyriad: has joined #RubyOnRails
[05:54:32] fourcolors: has joined #RubyOnRails
[06:03:09] pawnbox: has joined #RubyOnRails
[06:08:19] lightheaded: has joined #RubyOnRails
[06:11:12] jenrzzz: has joined #RubyOnRails
[06:14:20] nahtnam: has joined #RubyOnRails
[06:23:06] patarr: has joined #RubyOnRails
[06:25:09] robm: has joined #RubyOnRails
[06:32:24] nich: has joined #RubyOnRails
[06:33:50] nich: Hi. I'm having a bit of difficulty with i18n translations and date strings. How do I go from a string with a Thai month name: "15 เม.ย. 2017 12:30" to a date time object?
[06:34:11] nich: If I use `#to_datetime` it always makes the month march
[06:35:10] _3dwardsharp: has joined #RubyOnRails
[06:36:37] pawnbox: has joined #RubyOnRails
[06:37:09] hotpanca_: has joined #RubyOnRails
[06:45:30] hotpancakes: has joined #RubyOnRails
[06:48:57] fourcolors: has joined #RubyOnRails
[06:57:40] zero1one0: has joined #RubyOnRails
[06:59:12] dionysus69: has joined #RubyOnRails
[07:00:21] hotpancakes: has joined #RubyOnRails
[07:00:46] benlieb: has joined #RubyOnRails
[07:02:21] lightheaded: has joined #RubyOnRails
[07:04:28] gambl0re: has joined #RubyOnRails
[07:04:43] tarkor: has joined #RubyOnRails
[07:07:33] tarkor: Hello guys, I am currently upgrading from rails2 to rails3. And as I am clicking through my project there is one error that I cannot get rid off: "undefined method `protected_instance_variables'". Can anyone of you tell me where this error comes from?
[07:10:11] Cohedrin: has joined #RubyOnRails
[07:10:15] nich: has joined #RubyOnRails
[07:13:17] dionysus69: has joined #RubyOnRails
[07:14:28] hotpancakes: has joined #RubyOnRails
[07:14:58] Radar: tarkor: stacktrace?
[07:15:17] fourcolors: has joined #RubyOnRails
[07:15:46] tarkor: Radar: https://gist.github.com/anonymous/bc7354b7221d036b24decf03b38d9bc6
[07:17:51] Radar: tarkor: I don't know what would cause that. Can you reproduce it in a new app?
[07:18:08] sypheren: has joined #RubyOnRails
[07:18:29] tarkor: Radar: I will try
[07:25:20] hotpancakes: has joined #RubyOnRails
[07:26:06] robm: has joined #RubyOnRails
[07:26:17] lightheaded: has joined #RubyOnRails
[07:37:55] pawnbox: has joined #RubyOnRails
[07:39:03] artto: has joined #RubyOnRails
[07:43:27] conta: has joined #RubyOnRails
[07:48:56] oqui: has joined #RubyOnRails
[07:50:22] hotpancakes: has joined #RubyOnRails
[07:50:37] oqui: hello, am trying to create a service that starts/stops my ruby on rails app using upstart which I've written here. https://dpaste.de/rsbz however, I still don't get the app up and running. It's throwing unhelpful logs messages. What could be doing wrong? Thanks
[07:56:05] DrYockel: has joined #RubyOnRails
[07:56:12] matthewd: oqui: That's the output you see when running 'rails' outside an application directory
[08:00:13] oqui: matthewd: but in the pre-start script stanza, i clearly cd $HOME/registry/registrar-2.0
[08:01:33] artto: has joined #RubyOnRails
[08:02:23] artto_: has joined #RubyOnRails
[08:03:24] artto__: has joined #RubyOnRails
[08:05:18] matthewd: Well, that's just as clearly not doing what you intend it to
[08:09:09] oqui: matthewd: had to do this isntead chdir /home/dokwii/registry/registrar-2.0 outside of the pre-start script stanza and it works
[08:13:11] pawnbox_: has joined #RubyOnRails
[08:15:08] xaviergmail: has joined #RubyOnRails
[08:21:06] hotpancakes: has joined #RubyOnRails
[08:22:31] pLaTo0n: has joined #RubyOnRails
[08:23:58] patarr: has joined #RubyOnRails
[08:25:18] xall: has joined #RubyOnRails
[08:26:07] AimlessRAven: has joined #RubyOnRails
[08:26:19] AimlessRAven: https://gist.github.com/NikolayPetkov/e52011e79fab10cb0684ca11788d678a
[08:26:28] AimlessRAven: why me select initialize only first option to view
[08:28:43] robm: has joined #RubyOnRails
[08:31:01] mark_66: has joined #RubyOnRails
[08:34:56] Technodrome: has joined #RubyOnRails
[08:35:34] patientj: has joined #RubyOnRails
[08:38:10] patientj: has left #RubyOnRails: ()
[08:44:11] fourcolors: has joined #RubyOnRails
[08:47:57] artto: has joined #RubyOnRails
[08:54:42] zpe: has joined #RubyOnRails
[08:58:53] jsrn_: has joined #RubyOnRails
[09:01:21] lightheaded: has joined #RubyOnRails
[09:05:13] lightheaded: has joined #RubyOnRails
[09:07:04] nich: has joined #RubyOnRails
[09:07:05] gambl0re: has joined #RubyOnRails
[09:07:43] gambl0re: has joined #RubyOnRails
[09:08:42] nullshock: has joined #RubyOnRails
[09:10:59] Andr3as: good morning everyone.. i need to have a model method that returns just a string.. however i want that string to be translated and thought it might work with https://gist.github.com/awunder/4dba2830f72d9c223576f43fb37c3d14 - but it doesnt.. it throws an error "undefined method 't' for ..."
[09:11:11] Andr3as: anyone a hint for me? googling that proves difficult
[09:12:03] matthewd: Andr3as: Models shouldn't care about translations; they are a user interface concern
[09:12:32] Andr3as: matthewd: yeah, thing is i need to return a text..is there a way?
[09:12:44] Andr3as: its a best_in_place issue with a password field
[09:13:03] aperkins81: has joined #RubyOnRails
[09:13:13] Andr3as: i only can prevent it from showing the newly typed in passsword with using a "display_as: :change_pw"
[09:13:20] Andr3as: which gotta be a model method
[09:13:31] Andr3as: so i want it to show a text like "click to change"
[09:13:51] Andr3as: but that should be translated..
[09:14:37] matthewd: Looks like you want display_with
[09:16:04] Andr3as: do i? hmm? i have no idea how i would... you maybe have a hint?
[09:16:15] matthewd: Or actually, maybe value: "", placeholder: "click me"
[09:17:12] matthewd: Oh I see, that may not help after they edit it
[09:17:17] Andr3as: "..use an existing helper..." - does that imply its a helper method?
[09:17:32] matthewd: display_with: lambda { "click me" }
[09:17:37] Andr3as: right, value = no good or you have the pw in plain text afterwards
[09:17:55] Andr3as: that easy? hmpf..
[09:17:55] aganov: has joined #RubyOnRails
[09:18:05] Andr3as: i'll give it a shot.. thank you big time!
[09:19:52] Andr3as: hmm... wrong number of args.. given 1, expected 0
[09:20:32] matthewd: Oh sorry, we want a proc, not a lambda
[09:20:50] matthewd: (or add a |_| to ignore the arg)
[09:21:42] hotpancakes: has joined #RubyOnRails
[09:22:36] timdotrb: has joined #RubyOnRails
[09:23:33] Andr3as: matthewd: that did the trick - awesome!
[09:24:44] matthewd: Cool! There is a way to get translations from places you "shouldn't", though I don't recall it off the top of my head.. but much better if you can keep things in their place, as we have here.
[09:26:32] Andr3as: absolutely...
[09:26:42] Andr3as: thanks again, appreciate your help!
[09:27:18] srinidhi: has joined #RubyOnRails
[09:30:57] oqui: hello, am having trouble understanding why this piece of code is working this way; https://dpaste.de/bA6c I wonder why ns1.downcase! gives nil ? Though that changes value to lowercase if present.
[09:36:57] Jameser: has joined #RubyOnRails
[09:36:59] Andr3as: oqui: http://apidock.com/ruby/String/downcase!
[09:37:09] Andr3as: "...returning nil if no changes were made..."
[09:37:24] Andr3as: e.g. if all letters were downcase already
[09:38:18] oqui: Andr3as: how would you refactor this before_save { ns1.downcase! if !ns1.blank?} to accomodate for that fact
[09:38:20] pawnbox: has joined #RubyOnRails
[09:39:55] Andr3as: i may not be the best guy to ask, am just good at googling ;) - however, i'd ask myself why using the bang version of downcase instead of just plain downcase?
[09:40:33] matthewd: oqui: Why does it matter whether it returns nil in that case?
[09:41:05] Andr3as: i guess he#d save it as nil then, no?
[09:41:34] matthewd: No; downcase! *returns* nil if it didn't make a change. The string still contains whatever it did before.
[09:41:42] Andr3as: aah, thank you
[09:43:36] oqui: Andr3as: I think its this line that's having issue >> validates :ns1, presence: true, format: { with: VALID_DOMAIN_REGEX, message: "Valid domain name required"} because I can see errror "valid domain name required" in the browser. Rails is a bit of magic to me. I don't really understand that :ns1 in this case refers to. Is form params ns1? because am calling on that model from elsewhere not the form submission
[09:44:33] Andr3as: can you paste your class on gist?
[09:44:50] Andr3as: https://gist.github.com
[09:44:58] matthewd: oqui: From your earlier paste, it seems more likely to be failing the regex because of the trailing space
[09:45:00] Andr3as: hard to read in my irc client
[09:45:10] artto: has joined #RubyOnRails
[09:46:45] matcouto: has joined #RubyOnRails
[09:48:07] lxsameer: has joined #RubyOnRails
[09:48:54] kitsuneyo: has joined #RubyOnRails
[09:49:30] ferr1: has joined #RubyOnRails
[09:49:46] kitsuneyo: if i wanted to add metacritic ID attribute to an active record model, is it safe to call it metacritic_id or is that reserved for actual db associations?
[09:50:30] aperkins81: has joined #RubyOnRails
[09:51:03] matthewd: kitsuneyo: It's safe, but likely to surprise future developers. I'd avoid it where reasonable.
[09:51:32] kitsuneyo: matthewd thanks, what would you call it? i could just call it metacritic or metacritic_ref
[09:51:42] Jameser: has joined #RubyOnRails
[09:52:03] oqui: matthewd: nice catch. Guess i should add the strip method like this ns1.strip.downcase!
[09:52:08] matthewd: Yeah, I've used _ref or _identifier before
[09:52:26] matthewd: oqui: That won't do what you want, because strip doesn't mutate the value
[09:52:35] kitsuneyo: thanks matthewd, appreciate your help as always
[09:53:29] matthewd: No worries :)
[09:53:41] oqui: matthewd: but there's "!" at the end which as i've read mutates the object
[09:54:03] matthewd: strip! mutates the object; strip does not
[09:54:32] marr: has joined #RubyOnRails
[09:54:47] matthewd: oqui: You want either `ns1.strip!; ns1.downcase!` or `self.ns1 = ns1.strip.downcase`
[09:56:08] oqui: matthewd: thanks. so this should work before_save { ns1.strip!; ns1.downcase! if !ns1.blank?}
[09:56:39] pawnbox: has joined #RubyOnRails
[09:56:50] matthewd: That'll break if ns1 is nil. And if that's not a concern, you don't need the blank? check.
[09:57:00] Andr3as: fwiw matthewd.. had to look for a possibility to use i18 from inside a class... due to my datatables json thing - http://stackoverflow.com/a/21161672/6844761 says "... use I18n.t..." and this works like a charme..
[09:57:02] ags_: has joined #RubyOnRails
[09:57:30] kitsuneyo: i wish someone would write a good post on avoiding troublesome nils, or i could find it if it exists
[09:57:59] Fernando-Basso: has joined #RubyOnRails
[10:02:12] hotpancakes: has joined #RubyOnRails
[10:02:59] oqui: matthewd: if ns1 is nil, then the ns1.strip!; ns1.downcase! should not execute because ns1.blank? checks for empty? nil? and blank? AFAIK
[10:03:04] Andr3as: kitsuneyo: <ou mean like this piece from Sandi Metz? https://www.sandimetz.com/blog/2014/12/19/suspicions-of-nil
[10:04:24] kitsuneyo: Andr3as, bookmarked, thanks :)
[10:05:00] matthewd: oqui: The `if` applies to the statement it's attached to, not the whole line
[10:05:10] Andr3as: kitsuneyo: she's great, btw... has a great new book abt oop "99 bottles"
[10:06:38] kitsuneyo: Andr3eas, will check out the site first
[10:07:27] oqui: matthewd: so i've to change it to this then before_save { ns1.strip! if !ns1.blank?; ns1.downcase! if !ns1.blank?}
[10:08:17] matthewd: Or change it to a block if, or use the assignment form, yes.
[10:09:27] Fernando-Basso: has joined #RubyOnRails
[10:13:58] pawnbox: has joined #RubyOnRails
[10:17:33] lightheaded: has joined #RubyOnRails
[10:18:27] lheaded: has joined #RubyOnRails
[10:24:34] oqui: matthewd: look https://dpaste.de/bGuZ I've got a convinient method that does everything nicely. removes white space and lowercase values where applicable
[10:24:42] Fritz: has joined #RubyOnRails
[10:24:53] patarr: has joined #RubyOnRails
[10:25:01] srinidhi: has joined #RubyOnRails
[10:27:39] pickle_: has joined #RubyOnRails
[10:28:14] jenrzzz: has joined #RubyOnRails
[10:28:14] jenrzzz: has joined #RubyOnRails
[10:29:51] pawnbox: has joined #RubyOnRails
[10:31:26] manzo: has joined #RubyOnRails
[10:32:12] kitsuneyo: has joined #RubyOnRails
[10:33:00] kitsuneyo: has joined #RubyOnRails
[10:33:45] kitsuneyo: has joined #RubyOnRails
[10:34:02] rwsq1: has joined #RubyOnRails
[10:35:53] pickle_: has joined #RubyOnRails
[10:36:13] tedwing: has joined #RubyOnRails
[10:36:43] rwsq1: I have a need for a common menu item on a suite of microservices to switch between them. Is there a best practice for including code to be displayed from a different site? I realise I could just grab the rendered html from a remote rails app but this seems a bit ugly.
[10:38:17] rwsq1: basically I just want to write this menu once and have it show on many sites, but I don't want to have to redeploy any of those sites if/when it changes
[10:41:12] adlerdias__: has joined #RubyOnRails
[10:42:59] kitsuneyo: has joined #RubyOnRails
[10:43:14] artto: has joined #RubyOnRails
[10:45:41] artto: has joined #RubyOnRails
[10:46:35] zeel: has joined #RubyOnRails
[10:46:43] boshhead: has joined #RubyOnRails
[10:47:40] WinterBluFox: has joined #RubyOnRails
[10:48:26] Jasaka: has joined #RubyOnRails
[10:48:53] WinterBluFox: Is there any standard way in rails to have a ruby script that always runs and gets restarted if it crashes?
[10:48:59] tvw: has joined #RubyOnRails
[10:49:42] workmad3: rwsq1: you could consider using varnish and making use of edge-side includes to compose your page from microservices that serve HTML
[10:50:31] rwsq1: workmad3, interesting idea. Could that cope with different arrangements if user is logged in/out ?
[10:51:28] workmad3: rwsq1: the directive for the ESI would be put into the source by whatever was 'directly' behind the varnish request, which could then put a different directive in place for logged in/out
[10:52:32] rwsq1: ok, I'll have a dig around in that and see what it looks like, thanks
[10:52:49] timdotrb: WinterBluFox: check out god http://godrb.com/
[10:53:47] artto: has joined #RubyOnRails
[10:54:31] workmad3: WinterBluFox: process supervisors aren't really in scope for rails, so there's nothing built in... but there's dozens of options out there (like god as timdotrb suggested... or runit, monit, upstart, ...)
[10:55:38] dminuoso: ACTION pokes workmad3 
[10:55:43] dminuoso: How would you call a predicate factory?
[10:56:07] dminuoso: something you can use for container.select(&filterById(objectList))
[10:56:17] dminuoso: Im not sure about filterById
[10:58:46] workmad3: I'd probably go idFilter rather than filterById... filterById() implies a method that is performing the filter itself, while idFilter implies a method that is giving you back a 'filter' to use how you want
[11:01:10] dminuoso: workmad3: idExclude is poor though
[11:02:26] dminuoso: idExclude is basically an inverted idFilter to allow for collection.select(&idExclude(list)) rather than collection.reject(&idFilter(list))
[11:02:45] dminuoso: The reason for this is to keep these predicate generators comparable, and not be designed to be used with either reject or select
[11:03:03] lightheaded: has joined #RubyOnRails
[11:03:50] workmad3: well, they're both filters at that point... but one is an idInclusionFilter and the other is an idExclusionFilter :)
[11:04:07] workmad3: ('exclude' is not an inversion of 'filter')
[11:04:21] matthewd: collection.select(&~idFilter(list)) ?
[11:06:03] artto: has joined #RubyOnRails
[11:08:47] dminuoso: workmad3: Uh. Well basically one filter produces A ∩ B, and the other produces A \ B
[11:09:53] dminuoso: so from that perspective idUnionFilter and idDifferenceFilter maybe?
[11:10:07] dminuoso: no wait, not union
[11:10:13] dminuoso: idIntersectionFilter and idDifferenceFilter
[11:10:22] dminuoso: That actually computes in my head.
[11:10:38] dminuoso: It's very clear what they do
[11:12:13] netzfisch: has joined #RubyOnRails
[11:12:25] artto: has joined #RubyOnRails
[11:12:25] vadviktor: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[11:12:28] bbrowning: has joined #RubyOnRails
[11:15:32] jpterry: has joined #RubyOnRails
[11:21:28] harfangk: has joined #RubyOnRails
[11:22:46] patarr: has joined #RubyOnRails
[11:23:00] rwsq1: has joined #RubyOnRails
[11:25:25] Jameser: has joined #RubyOnRails
[11:28:39] cschneid_: has joined #RubyOnRails
[11:30:18] fox_mulder_cp: hi, folks. how i can in my index method get from database my Model.all plus dependent object (model.customer, model.type) etc?
[11:30:27] xaviergmail: has joined #RubyOnRails
[11:30:31] jenrzzz: has joined #RubyOnRails
[11:30:31] jenrzzz: has joined #RubyOnRails
[11:30:34] fox_mulder_cp: for use one sql request, not many
[11:30:38] fragamus: has joined #RubyOnRails
[11:35:23] kitsuneyo: has joined #RubyOnRails
[11:37:16] matthewd: fox_mulder_cp: includes
[11:37:55] Lyubo1: has joined #RubyOnRails
[11:41:59] artto: has joined #RubyOnRails
[11:43:39] pickle_: has joined #RubyOnRails
[11:43:53] augcesar: has joined #RubyOnRails
[11:43:59] artto: has joined #RubyOnRails
[11:46:03] artto: has joined #RubyOnRails
[11:46:56] aganov: has joined #RubyOnRails
[11:47:35] pwnd_nsfw`: has joined #RubyOnRails
[11:51:01] fabiob_: has joined #RubyOnRails
[11:51:35] fabiob_: Hi, is <div data-foo="<%= params[:foo] %>"> vulnerable to XSS?
[11:55:14] Robtop__: has joined #RubyOnRails
[11:56:11] ldnunes: has joined #RubyOnRails
[11:56:21] akshat: has joined #RubyOnRails
[11:59:20] pickle_: has joined #RubyOnRails
[11:59:41] HoierM: has joined #RubyOnRails
[12:00:22] kitsuneyo: has joined #RubyOnRails
[12:10:21] pawnbox: has joined #RubyOnRails
[12:11:09] srinidhi: has joined #RubyOnRails
[12:12:31] Jameser: has joined #RubyOnRails
[12:14:01] pawnbox: has joined #RubyOnRails
[12:15:29] arBmind: has joined #RubyOnRails
[12:23:10] zpe: has joined #RubyOnRails
[12:26:50] pulkit4tech: has joined #RubyOnRails
[12:27:32] srinidhi: has joined #RubyOnRails
[12:29:46] codelahoma: has joined #RubyOnRails
[12:30:02] pwnd_nsfw`: has joined #RubyOnRails
[12:32:39] Qchmqs: has joined #RubyOnRails
[12:33:02] jenrzzz: has joined #RubyOnRails
[12:33:02] jenrzzz: has joined #RubyOnRails
[12:33:26] koneko: has joined #RubyOnRails
[12:35:30] workmad3: fabiob_: yes
[12:35:36] Mia: has joined #RubyOnRails
[12:35:36] Mia: has joined #RubyOnRails
[12:35:42] Axy: has joined #RubyOnRails
[12:35:42] Axy: has joined #RubyOnRails
[12:37:32] Rodya_: has joined #RubyOnRails
[12:37:55] dminuoso: let's say you have two arrays A and B of objects of the form [{id:1}, {id:2}, ...more] and you want to produce A ∩ B, A ∪ B, A \ B or A Δ B, how would you phrase such operations? Would those be reducers you pass to Array.prototype.reduce?
[12:38:13] dminuoso: Would keyedIntersection('id', A, B) be sensible?
[12:38:32] spicerack: has joined #RubyOnRails
[12:39:45] dminuoso: or rather a plain idIntersection(A, B), idUnion(A, B), idComplement(A, B) and idDifference(A,B) ? (The need to specify a custom key is non-existent in my application)
[12:40:16] dminuoso: Originally I started out with A.filter(idDifference(B)) but that kind of looked silly
[12:41:12] dminuoso: A.reduce(union(A)) doesn't look too shabby however.
[12:41:28] dminuoso: Though I might as well go for straight union(A, B) I guess *shrugs*
[12:41:50] dminuoso: This was supposed to go to #javascript
[12:45:43] brent__: has joined #RubyOnRails
[12:47:07] Mia: has joined #RubyOnRails
[12:47:07] Mia: has joined #RubyOnRails
[12:47:08] Axy: has joined #RubyOnRails
[12:47:08] Axy: has joined #RubyOnRails
[12:49:48] tomasm-: has joined #RubyOnRails
[12:50:46] fox_mulder_cp: how i can create scope like this where(active: true, some.count > 0) ?
[12:52:21] fox_mulder_cp: where some - related model with has_many
[12:55:55] jordansz: has joined #RubyOnRails
[12:56:06] jordansz: hi everyone is it possible to create objects from a param variable? say I have params[:object] my goal is to do :object.new like @organisation.new
[12:56:35] jordansz: im trying to build a generic wizzard that takes param argument as base for the to be created object
[12:57:27] jonathanwallace1: has joined #RubyOnRails
[12:57:38] epochwolf: jordansz: that's a little bit dangerous, before I tell you how to do that, I'm going to have to recommend you make a list of the objects you want to create.
[12:58:00] epochwolf: And check against that list before you run the code.
[12:58:19] jordansz: i think its not really the rails way isent it. yes i know how to do that.
[12:58:33] jordansz: wizzards are always a big pain im trying to build a simple one now, don't want to use any gems
[12:59:02] epochwolf: objects = params.each{|k, v| SAFE_CLASSES.include?(k) ? k.camelize.constantize.new(v) : nil }.compact
[12:59:04] jordansz: i think i could do like admin/wizzard/organisation_wizzard, user_wizzard and have an wizzard::application_controller for generic stuff
[12:59:46] epochwolf: just FYI internally params has the keys as strings, not symbols. It just allows you to use symbols to access the string keys.
[12:59:47] jordansz: since you would also have problems with the object_params blocks in the controller having 1 controller for each object would solve this with advantage of an wizzard::ApplicationController for all generic logic right
[13:02:29] artto: has joined #RubyOnRails
[13:05:14] epochwolf: jordansz: Sure. I've done similar things. Though I prefer not to do as much generic code as I once did. Over-engineering is often just a waste of time.
[13:05:47] jordansz: need to determine some steps before,next etc which could be done in generic application controller think it will work out great
[13:06:00] hakash: has joined #RubyOnRails
[13:06:07] nettoweb: has joined #RubyOnRails
[13:07:31] matthewd: > don't want to use any gems
[13:07:59] chouhoulis: has joined #RubyOnRails
[13:08:30] epochwolf: matthewd: My main reason for avoiding gems is they can have more moving parts than I want to deal with (Devise)
[13:09:26] chouhoul_: has joined #RubyOnRails
[13:10:17] matthewd: epochwolf: Sure, but you're not trying to roll your own generic wizard framework
[13:11:50] matthewd: "I can replace the overly-abstracted parts of the gem that I'm actually using with 20 lines of code" is one thing; "please help me create my own generic framework because I don't want to use anyone else's" is.. different
[13:13:24] jhack: has joined #RubyOnRails
[13:16:05] epochwolf: matthewd: point
[13:17:38] artto: has joined #RubyOnRails
[13:18:37] keegnotrub: has joined #RubyOnRails
[13:20:33] agent_white: has joined #RubyOnRails
[13:21:05] agent_white: Mornin' folks
[13:21:33] epochwolf: agent_white: Mornin'
[13:23:44] tedwing: has joined #RubyOnRails
[13:27:29] doodlehaus: has joined #RubyOnRails
[13:31:00] fabiob_: workmad3: what's the best practice to mitigate that?
[13:32:52] DLSteve_: has joined #RubyOnRails
[13:33:06] xibalba_: has joined #RubyOnRails
[13:33:45] doodlehaus: has joined #RubyOnRails
[13:36:31] martinhez: has joined #RubyOnRails
[13:41:05] artto: has joined #RubyOnRails
[13:41:10] netzfisch: has joined #RubyOnRails
[13:41:20] tomasm-: has joined #RubyOnRails
[13:41:24] redhedded1: has joined #RubyOnRails
[13:42:03] rfoust: has joined #RubyOnRails
[13:43:33] jordansz: hi everyone wha would be the way to have multiple nested controllers? my ide gives me an error class Admin::Wizzard::OrganisationController < Admin::Wizzard::ApplicationController
[13:43:58] epochwolf: jordansz: you'll need to adjust the quantum resonance.
[13:44:01] jordansz: Admin::Wizzard::ApplicationController seems to link to the regular application_controller
[13:47:03] artto_: has joined #RubyOnRails
[13:48:30] jordansz: epochwolf how do you mean that?
[13:49:33] epochwolf: jordansz: I'm being snarky. Basically, without more information, like the error message, I can't offer any useful advice.
[13:50:14] pawnbox: has joined #RubyOnRails
[13:50:24] epochwolf: If you tell me your car isn't working... I'm just going to say to stop driving into trees. Cars don't work so good after getting all smashed up. :)
[13:51:32] lightheaded: has joined #RubyOnRails
[13:52:24] matthewd: jordansz: Wizard has one z
[13:52:38] matthewd: jordansz: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html#when-constants-aren-t-missed
[14:00:45] lightheaded: has joined #RubyOnRails
[14:03:49] lightheaded: has joined #RubyOnRails
[14:04:39] keerthana: has joined #RubyOnRails
[14:05:29] lightheaded: has joined #RubyOnRails
[14:07:31] jordansz: yes correct, thank you for that link matthewd i have it wrapped up almost
[14:07:57] jordansz: now only 1 thing is if I have @organisation and @organisation.organisation_profile, how could i init the 2nd upon doing a @organisation.new ?
[14:08:27] jordansz: i already have a accepts_nested_attributes_for :organisation_profile, allow_destroy: true
[14:08:29] jordansz: in my model
[14:10:23] artto: has joined #RubyOnRails
[14:11:50] jordansz: do something like this https://gist.github.com/jordanlance/2d3c5c4899603424146d91f848e240fa
[14:12:28] jordansz: @organisation.new, I expect the associated table to be created by the @organisation.new so I would have an @organisation.organisation_profile for the form to create a new but doesent work that way
[14:12:45] epochwolf: Try [:admin, @organisation.organisation_profile.new] ?
[14:13:37] lightheaded: has joined #RubyOnRails
[14:16:48] alex88: has joined #RubyOnRails
[14:17:00] jordansz: epochwolf I would call that kind of method for every related table i have for organisation in my controller?
[14:17:07] jordansz: i expected that @organisation.new with the right model setup would do this for me
[14:18:03] jordansz: my goal basically is to do @organisation.new and have all the related tables initiatlized for creation in a form like @organisation.organisation_settings / .organisation_profiles etc
[14:18:09] lightheaded: has joined #RubyOnRails
[14:20:13] jordansz: would one use a block like after_initialize :add_product def add_product self.product ||= Product.new if self.new_record? end?
[14:21:31] jordansz: it seems the way, no automatic way of doing it?
[14:22:32] lightheaded: has joined #RubyOnRails
[14:23:14] hive-mind: has joined #RubyOnRails
[14:23:56] jhack_: has joined #RubyOnRails
[14:24:25] jordansz: so it gets like this, https://gist.github.com/jordanlance/510b6145f66c2d252bdb2a48600e281f really the best option? i hoped i could do this automatically
[14:28:27] pawnbox: has joined #RubyOnRails
[14:32:18] mikecmpbll: has joined #RubyOnRails
[14:32:40] jhack: has joined #RubyOnRails
[14:34:11] fragamus: has joined #RubyOnRails
[14:34:38] jenrzzz: has joined #RubyOnRails
[14:34:38] jenrzzz: has joined #RubyOnRails
[14:37:01] envint: has joined #RubyOnRails
[14:37:54] tvw: has joined #RubyOnRails
[14:39:01] lightheaded: has joined #RubyOnRails
[14:40:53] jhack_: has joined #RubyOnRails
[14:42:06] kitsuneyo: has joined #RubyOnRails
[14:42:51] kitsuneyo: has joined #RubyOnRails
[14:44:24] kitsuneyo: has joined #RubyOnRails
[14:47:06] epochwolf: jordansz: that's... not ideal.
[14:50:15] jordansz: epochwolf how would you suggest doing it?
[14:50:38] epochwolf: jordansz: generally, I'd do that in the controller.
[14:51:02] jordansz: but isen't it a model related task, fat models small controllers?
[14:51:31] epochwolf: I'm not a fan of fat models. They really bite you in the ass if you have an application of any size.
[14:51:31] kitsuneyo: has joined #RubyOnRails
[14:51:52] jhack32: has joined #RubyOnRails
[14:51:58] cschneid_: has joined #RubyOnRails
[14:52:08] epochwolf: And no, the model doesn't actually need those things populated, your view does.
[14:54:05] alex88_: has joined #RubyOnRails
[14:56:40] envint: has joined #RubyOnRails
[14:59:42] lightheaded: has joined #RubyOnRails
[15:02:15] lightheaded: has joined #RubyOnRails
[15:03:14] eclecticjohny: has joined #RubyOnRails
[15:03:32] lheaded: has joined #RubyOnRails
[15:04:33] jhack: has joined #RubyOnRails
[15:04:33] jhack: has joined #RubyOnRails
[15:05:43] hive-mind: has joined #RubyOnRails
[15:06:37] doodlehaus: has joined #RubyOnRails
[15:08:01] lightheaded: has joined #RubyOnRails
[15:09:09] epochwolf: jordansz: you could also write a helper method like this def populate_assocation(model, assocation); model.send(assocation) || model.send(:"build_#association"); end
[15:09:29] epochwolf: :"build_#{association}" *
[15:09:51] alexfradiani: has joined #RubyOnRails
[15:11:45] xaviergmail: has joined #RubyOnRails
[15:15:25] benlieb: has joined #RubyOnRails
[15:15:48] doodleha_: has joined #RubyOnRails
[15:16:36] treefrob_: has joined #RubyOnRails
[15:20:14] naprimer_2: has joined #RubyOnRails
[15:26:04] patarr: has joined #RubyOnRails
[15:33:07] brent__: has joined #RubyOnRails
[15:33:53] ResidentBiscuit: has joined #RubyOnRails
[15:34:06] brent__: has joined #RubyOnRails
[15:34:22] brent__: has joined #RubyOnRails
[15:35:44] jenrzzz: has joined #RubyOnRails
[15:42:50] marahin: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[15:43:50] pawnbox: has joined #RubyOnRails
[15:48:45] Or1on: has joined #RubyOnRails
[15:51:37] artto: has joined #RubyOnRails
[15:51:46] teddysmoker: has joined #RubyOnRails
[15:57:23] juggler: has joined #RubyOnRails
[15:57:42] sjakalen: has joined #RubyOnRails
[15:58:34] s2013: has joined #RubyOnRails
[15:59:16] sjakalen: Hi! If i have a has_many / belongs_to relationship between two models - can't I just [Record of (has_many)] << [Record of (belongs_to)] ?
[15:59:58] epochwolf: sjakalen: because it's possible to have more than one has_many between two models.
[16:00:14] epochwolf: It wouldn't know which one to use.
[16:00:17] duderonomy: has joined #RubyOnRails
[16:01:51] koneko: has joined #RubyOnRails
[16:02:43] workmad3: has joined #RubyOnRails
[16:03:09] artto: has joined #RubyOnRails
[16:03:13] sjakalen: epochwolf: But; In the console I am specifying which records that have a relationship?
[16:03:17] Sylario: has joined #RubyOnRails
[16:03:31] epochwolf: sjakalen: what's the code and the error?
[16:03:43] futilegames: has joined #RubyOnRails
[16:04:06] [Butch]: has joined #RubyOnRails
[16:04:08] sjakalen: So I can say "Teacher1 << Pupil1" and afterwards I can state that "Teacher1 << Pupil2", right?
[16:04:42] sjakalen: undefined method `<<'
[16:05:02] sjakalen: Can't I? I can in a has_and_belongs_to_many relationship?
[16:05:26] epochwolf: You'd need to do Teacher1.pupils << Purpil1
[16:05:38] sjakalen: Omfg, I'm so stupid
[16:05:57] epochwolf: You have to specify the association. :)
[16:06:14] epochwolf: Because there can be more than one association between models.
[16:06:30] sjakalen: Yeah, I just figured - thanks a lot, and sorry for not understanding you the first time you explained it
[16:06:50] sjakalen: Iam a guy in need of examples :))
[16:07:02] Sylario: In an HABTM relation, like Post HABTM Users, is it possible through the attribute hash of an update action, to destroy a relation?
[16:07:11] Rodya_: has joined #RubyOnRails
[16:08:46] epochwolf: sylario: http://guides.rubyonrails.org/form_helpers.html#removing-objects
[16:09:01] patarr: has joined #RubyOnRails
[16:09:53] treefrob: has joined #RubyOnRails
[16:11:32] envint: has joined #RubyOnRails
[16:12:38] Sylario: epochwolf: i do not want to destroy a User, just the relation
[16:13:05] Sylario: I tried to add a has_many Posts_Users it does not worj
[16:17:04] rogue_koder: has joined #RubyOnRails
[16:18:42] epochwolf: sylario: yes, you'll want to set Post.user_ids to an array of the User ids you want. If you omit an id, it's relation will be removed.
[16:19:05] epochwolf: There's an old railscast on it.
[16:19:14] epochwolf: http://railscasts.com/episodes/17-habtm-checkboxes
[16:19:42] envint: has joined #RubyOnRails
[16:20:05] Sylario: epochwolf: ok, good to know, so rails assume that in a HABTM you only want to destroy the relation
[16:21:02] epochwolf: sylario: no... you just replace one array with another and it handles adding or removing things automatically.
[16:22:10] Sylario: Ok, it's what i understood, thanks for the railcast link
[16:22:21] epochwolf: You're welcome. :)
[16:22:33] mzo: has joined #RubyOnRails
[16:23:24] mzo: how do i get started with rails
[16:23:53] NoGodDamnIdea: has joined #RubyOnRails
[16:23:53] NoGodDamnIdea: has joined #RubyOnRails
[16:24:35] mzo: i have ruby 2.4 installed
[16:24:40] Sylario: mzo > depend on your knowledge
[16:25:01] mzo: i mean how do i get up and running
[16:25:12] sjakalen: can I run my seeds database operations in a sandbox environment?
[16:26:37] Sylario: mzo : http://guides.rubyonrails.org/getting_started.html
[16:27:06] epochwolf: sjakalen: Rails 4: bundle exec rake db:seed, Rails 5: bin/rails db:seed
[16:27:38] chouhoulis: has joined #RubyOnRails
[16:28:07] mzo: sylario: tks
[16:28:29] Sylario: mzo : just one question, are you on windows?
[16:28:34] patarr: has joined #RubyOnRails
[16:28:47] jordansz: has joined #RubyOnRails
[16:29:14] Sylario: great, you have an OS with a real terminal
[16:29:59] pawnbox: has joined #RubyOnRails
[16:30:14] mzo: `gem install rails` failed
[16:30:23] mzo: we are off to a good start here
[16:30:30] sjakalen: epochwolf: Doesn't db:seed alter the database permanently?
[16:31:17] epochwolf: sjakalen: yes
[16:31:34] arefaslani: has joined #RubyOnRails
[16:32:01] sjakalen: epochwolf: I just want to test the database in a sandbox environment so that I don't fuck it up permanently while I'm trying out things
[16:32:12] epochwolf: You can either edit the seeds.rb to run everything in a transaction and then abort at the end of the transaction or edit database.yml to run it against a database you don't care about.
[16:33:17] arefaslani: I have a problem using Rails with Postfix. I've set up Postfix as SMTP server on my production server. Everything works and I tested it by sending an email to Gmail from mail utility.
[16:33:48] arefaslani: But when I send same email by Rails using same address, message goes to spam folder...
[16:34:08] arefaslani: config.action_mailer.delivery_method = :smtp
[16:34:08] arefaslani: config.action_mailer.smtp_settings = {
[16:34:09] arefaslani: address: "127.0.0.1",
[16:34:12] arefaslani: enable_starttls_auto: false
[16:34:25] arefaslani: this is my ActionMailer configuration
[16:35:28] matthewd: arefaslani: !gist for multi-line stuff, please
[16:35:28] helpa: arefaslani: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[16:35:28] epochwolf: arefaslani: sounds like it's working fine.
[16:35:41] dannyh: has joined #RubyOnRails
[16:35:57] mzo: i thought rails was supposed to eliminate this kind of hassle
[16:36:12] mzo: i want it to Just Work™
[16:36:39] epochwolf: mzo: frameworks make routine taskes easier. They aren't easy to use or learn at first.
[16:36:57] jenrzzz: has joined #RubyOnRails
[16:36:57] jenrzzz: has joined #RubyOnRails
[16:37:14] epochwolf: Getting php up and running is a lot easier than getting rails up and running.
[16:37:43] arefaslani: This is my action mailer configuration:
[16:37:44] mzo: i cant even install the dang gem
[16:37:45] arefaslani: https://gist.github.com/arefaslani/bc819aecb34b9b98bf9ebdc36fbb9f6d
[16:38:00] epochwolf: arefaslani: You'll want to look into your DNS setup. Your rails configuration is fine.
[16:38:05] matthewd: mzo: Would you care to share what's going wrong?
[16:38:35] mzo: c compiler errors when it tries to build some native extension
[16:38:50] mzo: nokogiri
[16:39:19] Sylario: What is your OS mzo
[16:40:27] matthewd: I've personally only seen nokogiri fail to build when half the buildchain was missing, but it's not uncommon for people to have problems with it
[16:40:40] Sylario: cant'help on a Linux
[16:41:02] arefaslani: here is my DNS mail conf:
[16:41:03] epochwolf: matthewd: I've had nogokiri fail to compile after an OS upgrade.
[16:41:03] arefaslani: https://gist.github.com/arefaslani/338bf59ee69876dffb9242c8e768f0cf
[16:41:23] epochwolf: arefaslani: what email address are you sending from?
[16:42:04] arefaslani: @epochwolf: no-reply@pinato.ir. If this is a DNS issue, why can I send emails with mail utility on my server from same address?
[16:42:38] matthewd: arefaslani: If it's ending up in spam, then Rails is sending it just fine
[16:42:54] epochwolf: arefaslani: can you gist the raw email source for one that got into the spam folder and one that got in the inbox?
[16:42:58] mzo: what do u think i should do
[16:43:32] pawnbox: has joined #RubyOnRails
[16:43:34] matthewd: arefaslani: You don't have a mail-sending issue, you have a "why is mail A marked as spam while mail B is not?" issue
[16:43:42] Rodya_: has joined #RubyOnRails
[16:43:49] matthewd: arefaslani: And that's going to come down to the contents of the mail and/or its headersf
[16:43:52] fourcolors: has joined #RubyOnRails
[16:44:06] arefaslani: @epochwolf: Sorry I know this is a dumn question but what do you mean by raw email source? I have no idea...
[16:44:47] epochwolf: arefaslani: there should be a view source option in your email client.
[16:45:03] epochwolf: In gmail it's "Show Original".
[16:45:17] matthewd: mzo: Fix the problem that's causing the error, I guess ¯\_(ツ)_/¯
[16:45:22] arefaslani: ok please wait
[16:45:53] dannyh: has joined #RubyOnRails
[16:46:15] eclecticjohny: has joined #RubyOnRails
[16:46:16] arefaslani: https://mail.google.com/mail/u/0/?ui=2&ik=4e2d9f603a&view=om&th=15acdb5d73cf1c27
[16:46:42] arefaslani: is this public? can you see? or should I make a gist from it?
[16:46:59] dminuoso: matthewd: haha by the way -> turns out that after the 10th "function" I started looking around and noticed that there's a super popular library providing these exact abstractions: lodash
[16:47:01] epochwolf: Gist please :)
[16:47:14] dminuoso: Now all my predicate factories are gone.
[16:47:52] arefaslani: https://gist.github.com/arefaslani/0368a79cdd6e2c9661014d52ac724fd0
[16:48:00] dminuoso: uniq([...ary1, ...ary2]) reads sweet
[16:48:01] arefaslani: Sorry :) this is the gist
[16:48:14] dminuoso: or differenceWith(a, b, e => e.id)
[16:48:29] dminuoso: or differenceBy actually in that case.
[16:48:39] dionysus69: has joined #RubyOnRails
[16:49:09] epochwolf: arefaslani: Received-SPF: neutral (google.com: 79.175.163.70 is neither permitted nor denied by best guess record for domain of no-reply@pinato.ir) client-ip=79.175.163.70;
[16:49:39] mzo: i have no idea how to fix the thing
[16:49:49] arefaslani: Can you guide me how to change my SPF record?
[16:50:09] arefaslani: Should I mention the IP in the SPF?
[16:50:22] matthewd: mzo: You haven't shown us what's wrong, so we can't help
[16:50:53] pawnbox_: has joined #RubyOnRails
[16:52:58] epochwolf: arefaslani: I'm looking.
[16:53:50] mauro1254: has joined #RubyOnRails
[16:53:52] mzo: matthewd: http://termbin.com/yxc1
[16:54:14] zel: has joined #RubyOnRails
[16:54:28] mauro1254: Hi folks! Anyone with experience on Devise + Doorkeeeper + Oauth2
[16:54:44] epochwolf: arefaslani: It looks like the spf is correct. It works with the SPF tools.
[16:54:46] flopsec: has joined #RubyOnRails
[16:55:56] matthewd: mzo: https://github.com/sparklemotion/nokogiri/issues/1445 seems relevant
[16:56:34] epochwolf: arefaslani: I figured it out, it's sending from srv1.pinato.ir not pinato.ir. SPF doesn't match.
[16:57:07] matthewd: mzo: (it ultimately just points to http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x)
[16:57:29] benlieb: has joined #RubyOnRails
[16:58:06] arefaslani: @epochwolf: Now what should I do?
[16:58:17] epochwolf: arefaslani: I'm thinking.
[16:58:45] arefaslani: (I'm using postfix. let me show u configurations...)
[16:59:38] epochwolf: arefaslani: It should be working but I think gmail is doing something non-standard.
[17:00:06] arefaslani: I think it is my fault... wait...
[17:02:05] arefaslani: https://gist.github.com/arefaslani/d6b0a5fd60d2b525f33e0b8f176e6fca
[17:02:39] epochwolf: arefaslani: maybe.
[17:03:10] arefaslani: @epochwolf: I will test... Many thanks
[17:04:12] beingjohnm_: Curious if anybody has any experience including charts in PDFs in Rails? I use Prawn and it looks like there are a couple of ways to do so but neither does pie charts. (Squid looks pretty nice but no pie charts.) It looks like an option might be using wicked_pdf and using a javascript charting library but that would involve swapping out Prawn and using HTML to generate pdfs which doesn't sound ideal but also might not be as bad as I thi
[17:04:40] epochwolf: beingjohnm_: I prefer using html to generate pdfs.
[17:04:58] keegnotrub: has joined #RubyOnRails
[17:05:09] epochwolf: That's how ebooks work, it's just html in a zip file.
[17:05:28] beingjohnm_: epochwolf: have you had any issues with that? Rendering? Placement on page?
[17:05:41] beingjohnm_: do you use wicked_pdf?
[17:05:42] epochwolf: If you use something like wkhtml2pdf, you can specify page breaks.
[17:06:03] beingjohnm_: I think wicked is a wrapper for that
[17:06:12] hahuang61: has joined #RubyOnRails
[17:06:16] epochwolf: I haven't use wicked.
[17:07:23] epochwolf: It depends how picky you are on text placement. If you're okay with automatic overflow with text, you're fine.
[17:07:43] beingjohnm_: epochwolf: I'll give it a try then. As I said, there wasn't a whole lot coming up in a Google search.
[17:07:54] epochwolf: If you need something absolutely pixel perfect, just use JRuby with iText.
[17:08:04] koneko: has joined #RubyOnRails
[17:08:05] epochwolf: And cry, a lot.
[17:09:12] epochwolf: Also, with wkhtmltopdf, you'll need to make sure your linux server is up to date. You could have font rendering issues with X11.
[17:09:51] beingjohnm_: I think there would be some definite benefits to using HTML but if I make a switch I want to make sure that there aren't too many tradeoffs. Using Prawn does take a decent amount of time and I really need to start including some charts.
[17:09:58] epochwolf: That's the one real headache aside from not being able to control overflow.
[17:10:25] mzo: i got rails
[17:10:27] mzo: thanks matthewd
[17:11:02] epochwolf: beingjohnm_: you'll need to add a buildpack for the binary.
[17:11:03] beingjohnm_: And no longer really use Linux on my desktop. Really do want to go back though. Used it for almost 15 years prior to moving to Mac and now want to move back.
[17:11:08] _djbkd: has joined #RubyOnRails
[17:11:27] epochwolf: beingjohnm_: shun! Mac2life.
[17:11:48] dannyh: has joined #RubyOnRails
[17:12:32] Cache_Money: has joined #RubyOnRails
[17:13:05] beingjohnm_: my inner cyberpunk calls my outer businessman a sell out
[17:14:07] epochwolf: beingjohnm_: I just find html easier to deal with than using Prawn.
[17:14:30] epochwolf: As far as charts go, you might be better off looking at a library that spits out images.
[17:15:39] artto: has joined #RubyOnRails
[17:15:44] pawnbox: has joined #RubyOnRails
[17:15:52] beingjohnm_: epochwolf: Chartkick looks amazing and would probably be what I use should I use wickedpdf. Currently use nvd3 in the app.
[17:16:07] kitsuneyo: hey, i have a quick question for anyone that built a Rails JSON API with file uploads. how did you handle that? is base64 the best way?
[17:16:54] epochwolf: beingjohnm_: I make my charts in excel. :(
[17:17:30] beingjohnm_: Excel4Life! My career until a couple of years ago was due to my Excel skills.
[17:18:06] envint: has joined #RubyOnRails
[17:20:12] kitsuneyo: nobody? no worries :)
[17:23:56] envint: has joined #RubyOnRails
[17:24:50] cnk: has joined #RubyOnRails
[17:28:44] envint: has joined #RubyOnRails
[17:38:19] blackmesa: has joined #RubyOnRails
[17:42:32] dnyy: how can i use #select (or #reject) on an ActiveRecord::Relation and have it return a Relation instead of an array?
[17:42:58] matthewd: dnyy: You can't
[17:44:19] matthewd: A relation is a query, anything you would want to do with it afterwards relies on the fact it's a query, and manipulating it like an array invalidates that
[17:48:37] veloutin: has joined #RubyOnRails
[17:53:08] raul782: has joined #RubyOnRails
[17:54:21] dminuoso: ACTION pokes matthewd with a boomstick
[17:54:32] bilal80: has joined #RubyOnRails
[17:54:40] epochwolf: ACTION inserts dminuoso into the shred bin.
[17:54:57] dminuoso: ACTION is pending for shredding
[17:55:06] dminuoso: Sounds exciting!
[17:55:22] duderonomy: has joined #RubyOnRails
[17:57:03] raul782: Hello guys, could someone helped me figure it out when the variable audited_type is set for act_as_audited? https://github.com/collectiveidea/audited/blob/3.0-stable/lib/audited/auditor.rb#L216
[17:57:41] raul782: I can't find any code where this is set, but magically for some audited models it's filled when I debug the attributes of the audit model
[17:58:27] raul782: It's frustrating that I can't pinpoint where that happens, I feel like I'm missing some core concepts of rails
[17:58:31] jsrn_: has joined #RubyOnRails
[17:58:54] bitshift: has joined #RubyOnRails
[17:59:25] workmad3: raul782: that would be the standard polymorphic association `type` field, I'm guessing
[18:00:10] raul782: workmad3: Yes, I can see it here, https://github.com/collectiveidea/audited/blob/3.0-stable/lib/audited/audit.rb#L10
[18:00:25] raul782: My question is where does that type field is set
[18:00:47] raul782: Is there some convention for these types that I'm missing?
[18:00:48] jtdowney: has joined #RubyOnRails
[18:00:49] workmad3: raul782: inside ActiveRecord when you assign a model to a polymorphic association
[18:00:58] matthewd: raul782: When something sets auditable, both the _id and _type will get set
[18:01:40] benlieb: has joined #RubyOnRails
[18:02:23] akshat: has joined #RubyOnRails
[18:02:56] raul782: workmad3: When you say something, where can I find that something or should I look deeper in the ActiveRecord source code
[18:04:13] raul782: I'd love to see exactly where exactly this happens where the gem or AR is extracting the _id and _type
[18:04:21] raul782: Is that a convention then?
[18:04:32] meoblast001: has joined #RubyOnRails
[18:04:34] workmad3: raul782: it's the behaviour of a polymorphic association in AR
[18:04:44] bitshift: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[18:04:50] workmad3: raul782: so you'll need to go digging into AR for polymorphic associations
[18:05:59] jhack_: has joined #RubyOnRails
[18:06:04] epochwolf: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb#L14 Here's where _type is set.
[18:06:11] AzaToth: has joined #RubyOnRails
[18:08:27] raul782: workmad3: thanks for the help, epockwolf: great I'll take a look at that.
[18:09:42] workmad3: raul782: tbh, the code is harder to grok than the knowledge that a polymorphic association will store both the ID and the class in order to load the association correctly in the future
[18:10:22] workmad3: (not much harder though... it's mostly harder because it's dealing with configurability in AR)
[18:10:40] raul782: ok, sweet that makes sense. Is there a way I can piggy back/debug and find out why in one particular model, the _id and _type is being set as nil?
[18:20:57] gusrub: has joined #RubyOnRails
[18:22:34] Cohedrin: has joined #RubyOnRails
[18:24:44] matthewd: raul782: Find the place that sets auditable -- in the non-working case, it's either not getting called, or it's being given nil
[18:25:21] raul782: matthewd: Exactly that was the step I was looking for
[18:26:09] raul782: I've been looking through the code but I can't find where auditable is set, however I can see that all models are being saved with the proper polymorphic auditable type except for user
[18:26:19] raul782: https://github.com/collectiveidea/audited/blob/3.0-stable/lib/audited/adapters/active_record/audit.rb#L6
[18:26:45] xall: has joined #RubyOnRails
[18:27:25] Aherin: has joined #RubyOnRails
[18:27:37] raul782: humm, I might be on the right track here, https://github.com/collectiveidea/audited/blob/3.0-stable/lib/audited/auditor.rb#L73
[18:28:16] srinidhi: has joined #RubyOnRails
[18:29:42] matthewd: Yeah, looks like it's getting set on 216 there, by virtue of adding to the association
[18:30:25] Duckily: has joined #RubyOnRails
[18:31:47] raul782: right, so when I call self.audits.create(attrs), how does audits know what auditable_type it will capture
[18:33:12] matthewd: As you pointed to, audits is defined with as: :auditable, and :auditable is polymorphic
[18:33:43] envint: has joined #RubyOnRails
[18:33:47] matthewd: I think this is where I point out how old the versions you're using are :/
[18:33:47] FCser: has joined #RubyOnRails
[18:34:30] epochwolf: matthewd: time to push that long term support contract ;)
[18:34:34] raul782: ok, embarrassed moment I'm using rails 3.2 + ruby 1.9.3 and auditable gem is set for that version.
[18:35:04] username1: has joined #RubyOnRails
[18:35:39] jhack32: has joined #RubyOnRails
[18:36:48] fattuna: has joined #RubyOnRails
[18:37:36] jhack: has joined #RubyOnRails
[18:38:13] dopamean_: has joined #RubyOnRails
[18:39:00] jenrzzz: has joined #RubyOnRails
[18:39:29] epochwolf: raul782: at this point, it's going to be guess and check. I'd get very friendly with the debugger.
[18:40:59] dtzuzu: has joined #RubyOnRails
[18:41:30] raul782: epochwold: lol, yeah I'll do that, but just to not keep spinning on my wheels, for example when I call write_audit(:action => 'update', :audited_changes => changes, :comment => audit_comment)
[18:41:42] raul782: and this code is executed, self.audits.create(attrs
[18:42:19] zero1one0: has joined #RubyOnRails
[18:42:20] epochwolf: raul782: is self prehaps a new record?
[18:42:22] raul782: That means that the only attrs are the 3 arguments I passed, w/o considering audit_comment and associated
[18:43:27] zero1one0: has joined #RubyOnRails
[18:46:20] arefaslani: has joined #RubyOnRails
[18:49:03] [Butch]_: has joined #RubyOnRails
[18:51:25] raul782: Ok, I've extended the audit model, and I'm trying to override the private method write_audit
[18:51:57] invalidusrname: has joined #RubyOnRails
[18:52:12] raul782: however, I don't see the private method is overwritten, should this be a straigntforward step or am I missing something
[18:52:27] [Butch]: has joined #RubyOnRails
[18:53:30] blackmesa: has joined #RubyOnRails
[18:55:20] HoierM: has joined #RubyOnRails
[18:56:09] HoierM: has joined #RubyOnRails
[18:56:24] DoctorMonocular: has joined #RubyOnRails
[18:57:19] HoierM: has joined #RubyOnRails
[18:58:15] HoierM: has joined #RubyOnRails
[18:58:45] [Butch]: has joined #RubyOnRails
[19:02:39] superlou: has joined #RubyOnRails
[19:03:10] coldfront: has joined #RubyOnRails
[19:05:19] zacts: has joined #RubyOnRails
[19:06:05] raul782: If audited_recrod adapter uses this ::ActiveRecord::Base.send :include, Audited::Auditor, how can I override a private method from Auditor?
[19:07:02] epochwolf: raul782: you can reopen the Audited::Auditor class and redefine the method.
[19:07:39] raul782: got it, does it matter where I put it?
[19:07:58] raul782: like inside models folder, or i should create a separate folder?
[19:08:40] epochwolf: I'd do it in an initializer.
[19:09:05] xaviergmail: has joined #RubyOnRails
[19:09:34] coldfront: I am making an event sign up site in rails and have a activerecord model called events, with columns in the db start_date, end_time and status what would be a way to update the status from "started" to "finished after the end_time has passed?
[19:09:52] raul782: cool, thanks
[19:09:58] epochwolf: coldfront: cronjob
[19:10:33] coldfront: epochwolf cronjobs with a rake task?
[19:13:29] Coldbla2: has joined #RubyOnRails
[19:15:17] Jayson_Virissimo: has joined #RubyOnRails
[19:15:20] epochwolf: coldfront: a rake task is a good way to do it.
[19:15:46] Technodrome: has joined #RubyOnRails
[19:22:12] hotpancakes: has joined #RubyOnRails
[19:23:29] dionysus69: has joined #RubyOnRails
[19:23:48] raul782: epocwolf: I believe I find the issue, but I don't know how does this work.
[19:24:01] szulak_: has joined #RubyOnRails
[19:24:25] raul782: So when this calle is executed, https://github.com/collectiveidea/audited/blob/3.0-stable/lib/audited/auditor.rb#L216
[19:24:47] raul782: I've tested 2 audited models,
[19:25:12] raul782: user model which is not being audited and a module model that is being audited
[19:25:58] raul782: For the module model, when I call self.audits.create(attrs), I see the auditable _id and _type being set correctly
[19:26:00] _djbkd: has joined #RubyOnRails
[19:26:06] raul782: but not with the user model
[19:26:32] raul782: create is a method from AR correct?
[19:27:43] raul782: Somewhere inside create call for the user model, the polimorphic auditable is prevented to being set
[19:28:04] raul782: run_callbacks(:audit) { self.audits.create(attrs) }, does :audit has some context here?
[19:28:17] epochwolf: I don't know.
[19:28:18] raul782: or is it just a label for adding more callbacks
[19:29:31] raul782: it looks like it's a label, http://apidock.com/rails/ActiveSupport/Callbacks/run_callbacks
[19:31:45] Robtop__: has joined #RubyOnRails
[19:31:53] hotpancakes: has joined #RubyOnRails
[19:32:41] rikkipitt: has joined #RubyOnRails
[19:35:03] raul782: I understand now the problem :), so it looks like if you have two polymorphic associations, in this case, auditable and user
[19:35:14] raul782: when you call self.audits.create(attrs)
[19:35:40] envint: has joined #RubyOnRails
[19:35:45] raul782: It looks like, AR sets the first polymorphic as user_id
[19:36:03] raul782: and auditable is left hanging.
[19:36:54] raul782: I can patch that method, it's not pretty but I believe it would do the job,
[19:37:15] raul782: however, I wonder why that happens, I guess I'd need to look deeper in AR
[19:37:39] arBmind: has joined #RubyOnRails
[19:38:27] arefaslani: has joined #RubyOnRails
[19:39:14] jenrzzz: has joined #RubyOnRails
[19:40:05] matthewd: raul782: It may need an inverse_of option
[19:40:53] srinidhi: has joined #RubyOnRails
[19:40:58] srinidhi: has joined #RubyOnRails
[19:56:50] envint: has joined #RubyOnRails
[19:57:14] hahuang61: has joined #RubyOnRails
[19:58:53] _djbkd: has joined #RubyOnRails
[20:00:02] raul782: Thanks guys, I could finally patch this issue.
[20:02:11] pLaTo0n: has joined #RubyOnRails
[20:11:18] onkelhotte: has joined #RubyOnRails
[20:11:37] benlieb: has joined #RubyOnRails
[20:12:10] Technodrome: has joined #RubyOnRails
[20:15:08] envint: has joined #RubyOnRails
[20:15:19] netzfisch: has joined #RubyOnRails
[20:19:31] onkelhotte: has joined #RubyOnRails
[20:20:56] username1: has joined #RubyOnRails
[20:23:41] gusrub: has joined #RubyOnRails
[20:24:37] FLeiXiuS: has joined #RubyOnRails
[20:29:12] treefrob: has joined #RubyOnRails
[20:30:08] dopamean_: is it possible to see in the console the memory usage of an activerecord query?
[20:33:15] onkelhotte: has joined #RubyOnRails
[20:34:13] onkelhotte: has joined #RubyOnRails
[20:34:48] envint: has joined #RubyOnRails
[20:35:46] onkelhotte: has joined #RubyOnRails
[20:36:35] mzo: has joined #RubyOnRails
[20:37:06] dnyy: anyone in here using pg_search? trying to restrict multisearch to only search certain columns but can't find a way to do it. use case is "search only title for this text" instead of the default "search everything for this text"
[20:37:08] fourcolors: has joined #RubyOnRails
[20:38:58] workmad3: has joined #RubyOnRails
[20:39:28] envint: has joined #RubyOnRails
[20:40:48] arBmind: has joined #RubyOnRails
[20:42:24] apotry: has joined #RubyOnRails
[20:43:15] nya: has joined #RubyOnRails
[20:44:16] arefaslani: has joined #RubyOnRails
[20:46:19] apotry: has joined #RubyOnRails
[20:48:44] KnownSyntax: has joined #RubyOnRails
[20:50:00] gambl0re: has joined #RubyOnRails
[20:51:32] roadrunneratwast: has joined #RubyOnRails
[20:51:33] jenrzzz: has joined #RubyOnRails
[20:51:33] jenrzzz: has joined #RubyOnRails
[20:52:06] cpruitt: has joined #RubyOnRails
[20:52:19] roadrunneratwast: Hi. I cloned the project https://github.com/codeforamerica/ohana-api/blob/master/INSTALL.md . I get the message: ERROR: In file './docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.
[20:52:54] Duckily: has joined #RubyOnRails
[20:56:58] dminuoso: roadrunneratwast: Do you have a full stack trace?
[20:57:30] szulak_: has joined #RubyOnRails
[20:59:50] HoierM: has joined #RubyOnRails
[21:01:33] onkelhotte: has joined #RubyOnRails
[21:05:31] KnownSyntax: has joined #RubyOnRails
[21:13:33] patarr: Is there any way to start rails with ruby executable flags? like -I and -r?
[21:13:37] envint: has joined #RubyOnRails
[21:13:54] blackmesa: has joined #RubyOnRails
[21:15:46] roadrunneratwast: dminuoso no stack trace. This is the yml file https://github.com/codeforamerica/ohana-api/blob/master/docker-compose.yml
[21:17:29] d0nn1e: has joined #RubyOnRails
[21:18:45] lupine: has joined #RubyOnRails
[21:23:54] patarr: How do I access ruby vm flags when I have to execute something like rails or rake?
[21:24:03] pawnbox: has joined #RubyOnRails
[21:26:25] oryman: has joined #RubyOnRails
[21:31:05] hahuang61: has joined #RubyOnRails
[21:31:12] fourcolors: has joined #RubyOnRails
[21:32:14] gusrub: has joined #RubyOnRails
[21:35:38] Aherin: has joined #RubyOnRails
[21:35:45] sami: has joined #RubyOnRails
[21:36:27] hotpancakes: has joined #RubyOnRails
[21:37:27] sami: Hello, I need some help with datamapper. I've never used it but I'm trying to setup an existing project, Snorby which uses it. I'm trying to use dm-mysql-adapter and to connect to a remote mysql instance. When doing migrations it fails and only tried to connect via a socket.
[21:41:32] futilegames: has joined #RubyOnRails
[21:44:06] [Butch]: has joined #RubyOnRails
[21:53:43] KnownSyntax: has joined #RubyOnRails
[21:53:43] KnownSyntax: has joined #RubyOnRails
[21:57:04] pwnd_nsfw: has joined #RubyOnRails
[22:02:01] [Butch]_: has joined #RubyOnRails
[22:03:07] Ergo: has joined #RubyOnRails
[22:03:53] workmad3: has joined #RubyOnRails
[22:05:25] blackmesa: has joined #RubyOnRails
[22:11:16] pwnd_nsfw`: has joined #RubyOnRails
[22:13:44] pawnbox: has joined #RubyOnRails
[22:18:46] envint: has joined #RubyOnRails
[22:20:05] jaffejoe: has joined #RubyOnRails
[22:22:30] chopppe: has joined #RubyOnRails
[22:24:05] doodlehaus: has joined #RubyOnRails
[22:25:28] HoierM: has joined #RubyOnRails
[22:26:38] HoierM: has joined #RubyOnRails
[22:27:49] HoierM: has joined #RubyOnRails
[22:28:00] pwnd_nsfw`: has joined #RubyOnRails
[22:28:32] HoierM: has joined #RubyOnRails
[22:31:27] HoierM: has joined #RubyOnRails
[22:42:33] hotpanca_: has joined #RubyOnRails
[22:44:59] sypheren: has joined #RubyOnRails
[22:46:37] roadrunneratwast: has joined #RubyOnRails
[22:46:52] doodlehaus: has joined #RubyOnRails
[22:52:55] sneakers: has joined #RubyOnRails
[22:54:28] Technodrome: has joined #RubyOnRails
[22:54:58] Rodya_: has joined #RubyOnRails
[23:08:29] brent__: has joined #RubyOnRails
[23:09:47] hahuang61: has joined #RubyOnRails
[23:11:56] Axsuul: How do you guys serialize associations that are passed in via json api/?
[23:13:32] gusrub: has joined #RubyOnRails
[23:17:30] metadox: has joined #RubyOnRails
[23:20:53] WinterBluFox: has joined #RubyOnRails
[23:24:04] roadrunneratwast: has left #RubyOnRails: ()
[23:24:09] amincd: has joined #RubyOnRails
[23:26:29] amincd: Hi, I have a model with accepts_nested_attributes_for turned on. In Rails console, I can create create an associated record through the model, but only once. The second time nothing is created. I have to exit console and restart it to get it to work again. Any ideas on why this could be happening?
[23:31:07] benlieb: has joined #RubyOnRails
[23:31:46] ErhardtMundt: has joined #RubyOnRails
[23:33:32] pawnbox: has joined #RubyOnRails
[23:39:38] xaviergmail_: has joined #RubyOnRails
[23:47:10] Rodya_: has joined #RubyOnRails
[23:48:37] hotpancakes: has joined #RubyOnRails
[23:53:48] amincd: I figured it out, in the :reject_if proc I had a @count, that rejected the attributes if the @count > 1. In the second create command, the @count was greater than 1 so the attributes were being rejected. I haven't been able to find a way to reset the @count after the records are created
[23:54:23] amincd: * the reject_if proc of :accepts_nested_attributes_for
[23:55:26] Guest49955: has joined #RubyOnRails
[23:56:44] Guest49955: quick question.. if you were going to write a method with ModelName.all.map(blahh) where would you put that in a rails app? In the model as a class method?
[23:56:58] amincd: (though the @count method is redundant at this point since I'm using the 'limit' option)
[23:57:30] Guest49955: Im rewriting an enumerator