« Back to channel list

#RubyOnRails - 23 May 2017

« Back 1 day Forward 1 day »
[00:00:26] noob_on_rails: has joined #RubyOnRails
[00:09:08] Aeyris: ACTION checks the apps he has running.
[00:18:45] quazimodo: has joined #RubyOnRails
[00:27:22] rakm: has joined #RubyOnRails
[00:29:18] francuz: anyone using https://github.com/jbox-web/ajax-datatables-rails with rails 5 ? i'm trying to make it work (using the tutorial that is provided in the git), with the last version(0.4.0) of the gem, but i'm getting an error and i cannot find why ..
[00:30:23] francuz: the error is *** undefined method `searched?' for "courses.title":String *** (Course being a model and title the first argument of that model)
[00:31:35] moombah567: has joined #RubyOnRails
[00:36:54] duderonomy: has joined #RubyOnRails
[00:40:14] waseem_: has joined #RubyOnRails
[00:49:10] apparition: has joined #RubyOnRails
[01:00:19] renegadeandy: has joined #RubyOnRails
[01:05:16] Pumukel: has joined #RubyOnRails
[01:05:26] DLSteve: has joined #RubyOnRails
[01:22:38] sevenseacat: has joined #RubyOnRails
[01:26:44] bronson: has joined #RubyOnRails
[01:27:02] brent__: has joined #RubyOnRails
[01:28:18] xx00__: has joined #RubyOnRails
[01:31:29] noob_on_rails: what can i do to make use of a comples JSON response?
[01:35:25] sevenseacat: you might need to be more specific. what are you trying to do?
[01:41:06] FCser: has joined #RubyOnRails
[01:43:29] aseibert: has joined #RubyOnRails
[01:57:45] apparition: has joined #RubyOnRails
[01:57:49] urkle: has joined #RubyOnRails
[02:06:07] irishfromua: has joined #RubyOnRails
[02:13:41] Jameser: has joined #RubyOnRails
[02:26:49] bronson: has joined #RubyOnRails
[02:33:46] moombah567: has left #RubyOnRails: ()
[02:43:00] romeoh: has joined #RubyOnRails
[02:47:35] bheesham: has joined #RubyOnRails
[02:47:56] waseem_: has joined #RubyOnRails
[02:53:00] jphase: has joined #RubyOnRails
[03:01:53] renegadeandy: has joined #RubyOnRails
[03:12:21] amperry: has joined #RubyOnRails
[03:14:16] amperry: hey folks, how would a .erb line like '<body class="<%= controller.controller_name %>">' be written in haml? I'm looking through http://haml.info/docs.html but am coming up blank.
[03:14:19] irishfromua: has joined #RubyOnRails
[03:14:56] xall: has joined #RubyOnRails
[03:15:47] sevenseacat: body{class: controller.controller_name} same as any other attribute
[03:16:06] sevenseacat: http://haml.info/docs/yardoc/file.REFERENCE.html#attributes
[03:16:14] sevenseacat: oops forgot the %
[03:16:18] sevenseacat: too long working with slim
[03:17:06] amperry: gah, that's okay, I just realized that, for some reason emacs wants to force a space between any printable character and an opening '{'
[03:17:42] amperry: I was thinking I was doing that, but I was really doing '%body {class: controller.controller_name}'
[03:19:51] amperry: gotta find what emacs variable to unset
[03:21:54] amperry: (It's 'parens-require-spaces', for anyone who's wondering.)
[03:26:14] patarr: has joined #RubyOnRails
[03:38:59] quirkycoders: has joined #RubyOnRails
[03:40:10] xx00__: has joined #RubyOnRails
[03:45:58] bheesham: has joined #RubyOnRails
[03:46:09] wethu: has joined #RubyOnRails
[03:52:06] ResidentBiscuit: has joined #RubyOnRails
[03:59:08] tercenya: has joined #RubyOnRails
[04:07:05] roamingdog: has joined #RubyOnRails
[04:11:50] waseem__: has joined #RubyOnRails
[04:12:26] waseem__: has joined #RubyOnRails
[04:22:17] kristoff_: has joined #RubyOnRails
[04:27:40] bronson: has joined #RubyOnRails
[05:01:40] xall: has joined #RubyOnRails
[05:02:33] renegadeandy: has joined #RubyOnRails
[05:12:27] waseem_: has joined #RubyOnRails
[05:20:32] ascarter: has joined #RubyOnRails
[05:24:37] ascarter: has joined #RubyOnRails
[05:25:38] rdavila: has joined #RubyOnRails
[05:27:11] patarr: has joined #RubyOnRails
[05:38:18] rdavila: has joined #RubyOnRails
[05:43:12] bheesham: has joined #RubyOnRails
[05:43:55] nickjj: has joined #RubyOnRails
[06:00:35] normie1: has joined #RubyOnRails
[06:01:29] dionysus69: has joined #RubyOnRails
[06:12:04] mtkd: has joined #RubyOnRails
[06:26:54] soule: has joined #RubyOnRails
[06:29:01] bronson: has joined #RubyOnRails
[06:33:06] quirkycoders: has joined #RubyOnRails
[06:35:26] kitsuneyo: has joined #RubyOnRails
[06:41:18] conta: has joined #RubyOnRails
[06:43:48] normie1: im sending form fields to my controlle from jquery serialize, how do i print out the key of each of my fields?
[06:44:18] normie1: params[:search].each do |k, v| puts("#{k} #{v}" ) end ===>returns hash for some reason?
[06:46:38] sevenseacat: `each` returns the hash being iterated over, yes.
[06:46:54] sevenseacat: what do you want to be returned?
[06:47:11] normie1: key then value
[06:47:20] sevenseacat: thats what a hash already is
[06:47:22] normie1: so i can build sql condition
[06:47:25] sevenseacat: keys and values
[06:58:06] ascarter: has joined #RubyOnRails
[07:03:28] renegadeandy: has joined #RubyOnRails
[07:16:59] srinidhi: has joined #RubyOnRails
[07:17:26] srinidhi: has joined #RubyOnRails
[07:18:00] nickjj_: has joined #RubyOnRails
[07:26:27] netzfisch: has joined #RubyOnRails
[07:27:47] dminuoso: normie1: build sql condition?
[07:27:54] dminuoso: ACTION kicks helpa
[07:28:04] patarr: has joined #RubyOnRails
[07:29:35] helpa: 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
[07:38:59] gusrub: has joined #RubyOnRails
[07:42:07] ur5us: has joined #RubyOnRails
[07:45:18] dminuoso: sevenseacat: I got frustrated dealing with 7 different bot interface languages and lost the will to continue.. :-P
[07:45:23] fxa90id: has joined #RubyOnRails
[07:48:17] nertzy: has joined #RubyOnRails
[07:48:40] marr: has joined #RubyOnRails
[07:54:10] mikecmpbll: has joined #RubyOnRails
[07:57:00] Sigyn: has joined #RubyOnRails
[08:12:02] romeoh_: has joined #RubyOnRails
[08:16:27] Terens: has joined #RubyOnRails
[08:21:15] arBmind: has joined #RubyOnRails
[08:25:33] nertzy: has joined #RubyOnRails
[08:28:29] User458764: has joined #RubyOnRails
[08:29:55] bronson: has joined #RubyOnRails
[08:37:18] Doldge: has joined #RubyOnRails
[08:40:12] helpa: Hello. I am a HELPA 9000 computer. I became operational in #rubyonrails on the 28th of November 2009. My instructor was Ryan Bigg, and he taught me to sing a song. If you'd like to hear it, I can sing it for you.
[08:40:22] helpa: Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you. It won't be a stylish marriage, I can't afford a carriage. But you'll look sweet upon the seat of a bicycle built for two.
[08:46:52] lxsameer: has joined #RubyOnRails
[08:50:49] apeiros: has joined #RubyOnRails
[08:51:03] workmad3: has joined #RubyOnRails
[08:51:18] Axsuul: has joined #RubyOnRails
[08:51:53] Scient: has joined #RubyOnRails
[08:52:37] JoshL: has joined #RubyOnRails
[08:52:40] nikivi: has joined #RubyOnRails
[08:53:23] rgr: has joined #RubyOnRails
[08:53:43] DoubleMalt: has joined #RubyOnRails
[09:02:00] sonOfRa: has joined #RubyOnRails
[09:02:59] quirkycoders: has joined #RubyOnRails
[09:04:09] renegadeandy: has joined #RubyOnRails
[09:06:19] Ergo: has joined #RubyOnRails
[09:07:38] big|bad|wolf: has joined #RubyOnRails
[09:13:23] big|bad|wolf: has joined #RubyOnRails
[09:15:36] User458764: has joined #RubyOnRails
[09:24:40] shotbug: has joined #RubyOnRails
[09:28:57] patarr: has joined #RubyOnRails
[09:29:01] drale2k_: has joined #RubyOnRails
[09:34:55] noob_on_rails: has joined #RubyOnRails
[09:36:38] drale2k_: has joined #RubyOnRails
[09:39:53] gusrub: has joined #RubyOnRails
[09:42:55] drale2k_: has joined #RubyOnRails
[09:45:50] drale2k_: has joined #RubyOnRails
[09:48:41] drale2k_: has joined #RubyOnRails
[09:52:25] Terens: how can I rewrite this
[09:52:27] Terens: https://gist.github.com/parhs/55e432628af9777b1698e09c046635c2
[09:52:31] Terens: to allow reconnecting?
[09:57:56] ahrs: has joined #RubyOnRails
[10:01:27] drale2k_: has joined #RubyOnRails
[10:02:42] statikowsky: has joined #RubyOnRails
[10:11:07] glasz: has joined #RubyOnRails
[10:15:08] mahloun: has joined #RubyOnRails
[10:21:44] shilon: has joined #RubyOnRails
[10:23:28] srinidhi: has joined #RubyOnRails
[10:23:39] ferr: has joined #RubyOnRails
[10:26:11] nertzy: has joined #RubyOnRails
[10:26:49] patarr: has joined #RubyOnRails
[10:28:15] User458764: has joined #RubyOnRails
[10:29:22] xx00__: has joined #RubyOnRails
[10:31:05] bronson: has joined #RubyOnRails
[10:31:57] rgr: has joined #RubyOnRails
[10:34:32] nertzy: has joined #RubyOnRails
[10:48:02] quazimodo: has joined #RubyOnRails
[10:54:37] xall: has joined #RubyOnRails
[10:54:40] User458764: has joined #RubyOnRails
[10:55:52] ErhardtMundt: has joined #RubyOnRails
[11:04:49] arBmind: has joined #RubyOnRails
[11:05:03] renegadeandy: has joined #RubyOnRails
[11:07:31] drale2k_: has joined #RubyOnRails
[11:07:48] shilon: has joined #RubyOnRails
[11:14:57] quazimodo: has joined #RubyOnRails
[11:14:59] bheesham: has joined #RubyOnRails
[11:17:36] User458764: has joined #RubyOnRails
[11:21:28] Winter_Foxo: has joined #RubyOnRails
[11:22:24] Winter_Foxo: Can anyone recommend a gem for easily embedding a blog into a website?
[11:35:01] soahccc: I know that I possibly could just add maxlength to the input fields but I wonder why there are no "default validations" for things like maximum string length. I was thinking about putting something like this into my apprecord: columns.each{|c| validates c.name, length: { maximum: col.limit } if col.type == :string } Any problems with that?
[11:35:40] soahccc: With the idea, I already noticed that I can't do that in the application record really since it has no columns at this point.
[11:36:06] workmad3: soahccc: what happens if there isn't a column limit?
[11:36:15] workmad3: (which is the default in rails nowadays)
[11:36:21] sevenseacat: I think you'll find thing like varchars and text fields are also 'string' in rails
[11:36:56] soahccc: sevenseacat: well varchar is :string and yes there is :text as well
[11:37:18] HoierM: has joined #RubyOnRails
[11:37:23] sevenseacat: and what kind of limits do you want to put on varchars?
[11:37:52] soahccc: workmad3: string without limit? it's the database limit no? It was always there for me
[11:38:07] sevenseacat: heh, 'the database'
[11:38:09] workmad3: soahccc: postgres doesn't have a limit unless you specify one
[11:38:12] sevenseacat: like there's only one
[11:38:38] workmad3: and varchar, text, etc. are all implemented in postgres in the same way, with effectively no limit beyond storage limit
[11:38:45] soahccc: yeah I'm ashamed to out me as mysql user :<
[11:39:09] sevenseacat: could have been worse, you could have said sqlite
[11:39:28] drale2k_: has joined #RubyOnRails
[11:39:32] workmad3: or MS access :P
[11:39:39] soahccc: oh the memories
[11:39:54] HoierM_: has joined #RubyOnRails
[11:40:53] workmad3: soahccc: anyway, that's probably answering why there's no 'default validations' in rails :) they're difficult to figure out, and given validations are generally set up prior to the database connection being established, it's difficult to rely on schema information for it
[11:41:29] ldnunes: has joined #RubyOnRails
[11:43:25] shotbug: has joined #RubyOnRails
[11:43:40] soahccc: Yeah I thought that it's a little bit messy. I guess the ultimate goal would be that rails "understands" the error returned and instead of going apeshit adding a "failed validation state". But generally at validation time AR knows these things (e.g. it does SQL to satisfy uniqueness validation)
[11:44:33] soahccc: Theoretically I could do it per-instance with after_initialize callback but I guess that's not very clean either
[11:44:45] mikecmpbll: has joined #RubyOnRails
[11:45:17] soahccc: The thing is just that we have a few models with a lot of strings and I have the option of a lot of lines or a very long line for the length validation :/
[11:47:14] brent__: has joined #RubyOnRails
[11:47:31] drale2k_: has joined #RubyOnRails
[11:54:39] pusewicz: has joined #RubyOnRails
[12:05:14] xx00__: has joined #RubyOnRails
[12:08:25] statikowsky: has joined #RubyOnRails
[12:13:59] maqr: has joined #RubyOnRails
[12:14:21] tekk: has joined #RubyOnRails
[12:14:28] fxa90id: has joined #RubyOnRails
[12:14:28] mr-spoon: has joined #RubyOnRails
[12:14:32] sinduck: has joined #RubyOnRails
[12:14:40] DarkBushido: has joined #RubyOnRails
[12:14:43] arthurnn: has joined #RubyOnRails
[12:15:03] Dreamer3: has joined #RubyOnRails
[12:31:58] bronson: has joined #RubyOnRails
[12:38:33] Jameser: has joined #RubyOnRails
[12:44:00] pupsicle: has joined #RubyOnRails
[12:47:02] User458764: has joined #RubyOnRails
[12:47:47] User458764: has joined #RubyOnRails
[12:47:55] francuz: has joined #RubyOnRails
[12:52:05] bheesham: has joined #RubyOnRails
[12:55:36] catphish: has joined #RubyOnRails
[12:55:55] statikowsky: has joined #RubyOnRails
[12:56:44] catphish: if i run a large destroy operation with lots of nested destroys in a console, the process seems to consume several GB of memory, this is not unexpected, however i seem to be unable to free this memory back to the OS, is there any obvious reason for this?
[12:57:04] catphish: all i'm running is var = Model.first
[12:57:11] catphish: then var.destroy
[12:57:32] Jameser: has joined #RubyOnRails
[12:58:14] catphish: if i then unassign the model instance from var and GC.start, i never get the memory back
[13:00:06] catphish: not quite sure where the memory might be, thought i'd ask before i spend ages digging for ity
[13:03:24] tbuehlmann: it depends on the ruby version and a lot of other stuff. what could work: run GC.start a lot of times
[13:04:24] catphish: i tried that first :(
[13:05:28] Jameser: has joined #RubyOnRails
[13:05:32] catphish: i don't know if the problem is objects still being referenced somehow, or ruby just not freeing back to the OS
[13:11:51] durango: has joined #RubyOnRails
[13:12:58] durango: Is there a way to always include a certain param in every link_to/redirect_to call? My situation involves having a prefixed param such as "/en/article/1" or "/ch/article/1" the first part is what I'd like to always keep (/en or /ch) when using redirect_to.. I think my link_to's are fine but wasn't sure if I'm missing something
[13:14:42] tbuehlmann: durango: this? http://guides.rubyonrails.org/action_controller_overview.html#default-url-options
[13:14:48] Jameser: has joined #RubyOnRails
[13:15:27] durango: tbuehlmann hmm... that may work thanks, i was doing something crazier like encapsulating my routes with scope but this is awesome ty
[13:16:48] durango: Hmm that didn't seem to work but will look into that a bit more
[13:17:37] quazimodo: has joined #RubyOnRails
[13:18:20] morfin: has joined #RubyOnRails
[13:18:37] morfin: paperclip use mogrify to do stuff with images?
[13:20:13] quirkycoders: has joined #RubyOnRails
[13:20:19] tbuehlmann: morfin: https://github.com/thoughtbot/paperclip/search?utf8=%E2%9C%93&q=mogrify&type=
[13:20:47] uksio: has joined #RubyOnRails
[13:21:36] morfin: not sure if this yes or no because i don't use minimagic
[13:22:19] morfin: and it installs without ImageMagic installed
[13:31:47] DLSteve: has joined #RubyOnRails
[13:35:15] shotbug: has joined #RubyOnRails
[13:38:20] Jameser: has joined #RubyOnRails
[13:41:49] quirkycoders: has joined #RubyOnRails
[13:47:17] shilon: has joined #RubyOnRails
[13:47:42] robnester: has joined #RubyOnRails
[13:56:28] jphase: has joined #RubyOnRails
[14:08:15] quazimodo: has joined #RubyOnRails
[14:09:43] gambl0re: has joined #RubyOnRails
[14:15:59] DrYockel1: has joined #RubyOnRails
[14:20:09] fernandomm: has joined #RubyOnRails
[14:21:40] ResidentBiscuit: has joined #RubyOnRails
[14:22:04] bronson: has joined #RubyOnRails
[14:22:05] ResidentBiscuit: has joined #RubyOnRails
[14:22:35] ResidentBiscuit: has joined #RubyOnRails
[14:23:05] ResidentBiscuit: has joined #RubyOnRails
[14:23:35] ResidentBiscuit: has joined #RubyOnRails
[14:23:59] ResidentBiscuit: has joined #RubyOnRails
[14:28:46] gusrub: has joined #RubyOnRails
[14:30:54] mdw: has joined #RubyOnRails
[14:30:55] AzaToth: has joined #RubyOnRails
[14:31:24] chouhoulis: has joined #RubyOnRails
[14:32:08] mikecmpb_: has joined #RubyOnRails
[14:35:17] duderonomy: has joined #RubyOnRails
[14:37:56] shilon: has joined #RubyOnRails
[14:41:06] konsolebox: has joined #RubyOnRails
[14:41:49] fernandomm: has joined #RubyOnRails
[14:43:24] jphase: has joined #RubyOnRails
[14:49:51] bheesham: has joined #RubyOnRails
[14:50:06] patarr: has joined #RubyOnRails
[14:58:09] robnester: has joined #RubyOnRails
[14:59:06] patarr1: has joined #RubyOnRails
[15:02:02] dionysus69: has joined #RubyOnRails
[15:04:50] theunraveler: has joined #RubyOnRails
[15:10:18] mikecmpbll: has joined #RubyOnRails
[15:13:41] shilon: I’m adding my rails app to heroku. Everything works fine, the push to heroku doesn’t fail, the db:migrate and db:seed work fine. When I try to open the app I get this on my logs at=error code=H10 desc="App crashed" method=GET path="/favicon.ico"
[15:17:07] quirkycoders: has joined #RubyOnRails
[15:28:37] ascarter: has joined #RubyOnRails
[15:39:58] brent__: has joined #RubyOnRails
[15:41:49] mikecmpbll: has joined #RubyOnRails
[15:44:37] mikecmpbll: has joined #RubyOnRails
[15:49:07] soahccc: I'm playing a bit with actioncable and I wonder: how do you properly secure streams? Are the keys I pass to stream_from known to the user or can the user tamper with them?
[15:51:29] mtkd: has joined #RubyOnRails
[15:53:06] theunraveler: has joined #RubyOnRails
[15:53:30] bga57: has joined #RubyOnRails
[15:57:34] chouhoulis: has joined #RubyOnRails
[15:58:25] gusrub: has joined #RubyOnRails
[16:00:38] brent__: having issues w/ a JS library seemingly not being availabe in time and throwing an undefined error
[16:01:27] brent__: The JS is called at the bottom of a template in a content for JS block, and it says its undefined at the point of page load, however immediately after I can access it from the ocnsole
[16:01:53] brent__: and it's acessed inside a $(function(){}) so it does wait for the dom to be loaded
[16:11:08] gheegh: has joined #RubyOnRails
[16:12:10] hobodave: has joined #RubyOnRails
[16:16:10] francuz: hello, some guys i work with bought several (bootstrap) templates and always do their website with one of those few, but each time they have to integrate the theme/template all over again for each project(and it take them some time for some reason). To make it easier and faster(and cleaner, i love it clean) I tought about making either some "basic gits" with just rails new project + the template(& dependency), and
[16:16:10] francuz: make them start every new project using one of those. Than again I tought it would be even better to make a gem out of the template wouldn't it ? (wasn't much of a web guy until this job) so i'm here to ask about what would be best practice for this situation, and if it is to make a gem(as i presume), does anyone know of a good tutorial on how to make gems from templates? (or even best practice way to integrate
[16:16:11] francuz: template into a rails app, or actually anything you know that is good, in any case i'll probably first be reading on the web to learn as much on the subject before doing anything as i'm an "outsider")
[16:17:07] Papierkorb: has joined #RubyOnRails
[16:22:20] [Butch]: has joined #RubyOnRails
[16:23:27] ascarter: has joined #RubyOnRails
[16:28:53] cam27: has joined #RubyOnRails
[16:31:47] nickjj: francuz, look into using rails application templates
[16:32:25] nickjj: basically you can supply custom logic that happens after you generate a new rails project
[16:32:58] nickjj: and that custom logic could automate integrating your theme and maybe generating things like privacy policy and TOS pages, etc.. whatever you find up making in every app
[16:35:33] cnk: has joined #RubyOnRails
[16:38:11] rgr_: has joined #RubyOnRails
[16:38:22] Derperperd: has joined #RubyOnRails
[16:41:00] francuz: ow, just found out about "rails_apps_composer", maybe i'll do them more than just template integration
[16:44:37] workmad3: francuz: if you're talking about just the CSS/JS assets for a template, then a gem containing the assets would probably make sense to ease upgrading... if you're talking about HTML templates, chances are a gem of the 'template' will be rather limiting and you'll wind up wanting to just dump the HTML into a rails view and update by hand no matter what
[16:45:24] workmad3: francuz: as they're paid-for templates though, you'll probably want to be careful about gemifying them as you won't want to push them publicly to rubygems
[16:58:06] francuz: of course it would be private gems,
[16:58:13] francuz: for our use only,
[16:58:48] francuz: and yes it would be only css and js, maybe a generator to generate some default layout, but nothing more, (templatewise)
[16:59:25] am55: I'm running into the problem of having partials inside a view that are bubbling errors up to the view in my integration test. using minitest. I see something about "stubbing out" partials in rspec, but how about minitest?
[17:01:27] am55: This is also related to something that's really been on my mind: should I use initialize my partials from the controller render action, or should I switch them all to ajax?
[17:10:34] Aherin: has joined #RubyOnRails
[17:13:35] hahuang65: has joined #RubyOnRails
[17:15:31] wagster: has joined #RubyOnRails
[17:22:14] ascarter: has joined #RubyOnRails
[17:23:50] patarr: has joined #RubyOnRails
[17:26:49] Cache_Money: has joined #RubyOnRails
[17:30:53] Cache_Money: Why won't my model save? When I remove the `set_is_public` callback in the `before_create` call back it saves successfully: https://gist.github.com/anonymous/f12de503f29480f5654311afbc793024
[17:31:34] tbuehlmann: Cache_Money: what version of rails?
[17:31:57] tbuehlmann: when the callback returns false, the record is not saved
[17:32:06] Cache_Money: ruby 2.2.2p95
[17:32:27] jdqx: has joined #RubyOnRails
[17:32:35] Cache_Money: tbuehlmann: How would you recommend I set Prediction.is_public to false once it's created?
[17:32:43] andrew9184: has joined #RubyOnRails
[17:32:58] andrew9184: is it recommended to do any sanitization on json input or output ?
[17:36:15] renegadeandy: has joined #RubyOnRails
[17:36:21] renegadeandy: has left #RubyOnRails: ()
[17:38:48] djgraham: has joined #RubyOnRails
[17:38:53] lupine: has joined #RubyOnRails
[17:38:55] mtkd: has joined #RubyOnRails
[17:39:05] unreal: has joined #RubyOnRails
[17:40:25] scrooloose: has joined #RubyOnRails
[17:44:41] patarr: has joined #RubyOnRails
[17:46:17] tbuehlmann: Cache_Money: why isn't it a migration default?
[17:48:13] Cache_Money: tbuehlmann: I didn't think about it when I created it. I'm using this now and it's working `after_initialize :set_is_public`. Will this suffice? Or do you recommend I create a default migration?
[17:48:48] tbuehlmann: that will work, sure. I'd prefer a migration default though
[17:56:42] targaf: has joined #RubyOnRails
[17:58:08] pusewicz: has joined #RubyOnRails
[17:59:00] ferr: has joined #RubyOnRails
[18:05:33] dnewkerk: has joined #RubyOnRails
[18:06:11] ar1a: has joined #RubyOnRails
[18:06:52] ar1a: Hey! I am making a menu app, and there are multiple menu items. Each item has some ingredients associated with it. From what i've been seeing, belongs_to won't suit me here, because ingredients are used in multiple Items.
[18:07:00] ar1a: Should I use belongs_to or something else?
[18:07:09] srinidhi: has joined #RubyOnRails
[18:07:11] ar1a: menu app as in a restaurant menu
[18:08:43] gil_: has joined #RubyOnRails
[18:09:05] mlt-: has joined #RubyOnRails
[18:09:40] cnk: has_many
[18:10:54] ar1a: so Ingredients has a has_many and Items has a has_many cnk
[18:12:16] cnk: because you want ot be able to say avacado.items and get the list of items containing avacados
[18:12:31] ar1a: cool! do i need a migration for that or something?
[18:12:50] ar1a: Also, how can i add ingredients to an item?
[18:13:13] cnk: Read this http://guides.rubyonrails.org/association_basics.html or a book chapter on assocations in rails
[18:13:30] ar1a: i did, but i didnt get if i could do has_many on both
[18:13:31] cnk: this section may be what you need now http://guides.rubyonrails.org/association_basics.html#choosing-between-has-many-through-and-has-and-belongs-to-many
[18:14:23] cnk: you probably need a mapping table between ingredients and items, so has_and_belongs_to_many
[18:15:34] ar1a: Alrighty
[18:15:58] ar1a: now um, i still don't understand how to add ingredients to the item
[18:16:25] ar1a: for example, im using ActiveAdmin, and I think I would like a checklist of items that are used, and how many of them are used
[18:16:32] ar1a: (the app tracks stock too)
[18:17:07] cnk: myItem.ingredients << fish_stock
[18:17:46] cnk: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_and_belongs_to_many
[18:18:08] mikecmpbll: has joined #RubyOnRails
[18:25:59] ar1a: I'm getting a ForbiddenAttributesError
[18:26:03] ar1a: google says it has to do with strong_params
[18:26:07] ar1a: but I already am verifying the params
[18:26:09] xx00__: has joined #RubyOnRails
[18:26:22] ar1a: http://i.imgur.com/R1XkHRj.png
[18:26:32] ar1a: params.require(:item).permit(:name, :price, :ingredient_ids)
[18:28:52] ar1a: ah, its namespaced!
[18:28:52] mikecmpbll: has joined #RubyOnRails
[18:28:58] ar1a: Admin::ItemsController
[18:29:40] tbuehlmann: ingredient_ids is an array, so it should be params.require(:item).permit(:name, :price, ingredient_ids: [])
[18:30:23] ar1a: that didn't fix it
[18:30:54] ar1a: https://ptpb.pw/b38J.rb
[18:30:56] ar1a: the controller file
[18:33:31] ar1a: actually, i think it might be an active admin issue
[18:33:35] ar1a: https://activeadmin.info/2-resource-customization.html#rename-the-resource
[18:33:40] ar1a: oh, remove the hash
[18:35:02] ascarter: has joined #RubyOnRails
[18:35:13] lxsameer: has joined #RubyOnRails
[18:35:31] ar1a: yep that fixed it
[18:35:35] ar1a: ill do the rest when i wake up
[18:38:57] tbuehlmann: you should tell us when you use active admin
[18:40:33] duderonomy: has joined #RubyOnRails
[18:41:21] Cache_Money: Will the `after_initialize` callback get called when updating a record?
[18:43:31] marr: has joined #RubyOnRails
[18:43:35] tbuehlmann: Cache_Money: it will get called when you initialize a record, by building or finding a record
[18:44:03] bronson: has joined #RubyOnRails
[18:45:15] Cache_Money: tbuehlmann: ahhh, I wasn't aware that finding a record would trigger it. I think I need to move my after_initialize code into a default in a migration then
[18:47:49] tbuehlmann: you're welcome!
[18:50:31] ar1a: tbuehlmann: sorry, i thought i did. its 3am, i forgot :(
[18:56:35] pupsicle: Anyone have any experience with browserify-rails working in development but not in production? No errors, just silently removing any stuff that should be 'browserified' from compiled assets
[18:59:40] romeoh: has joined #RubyOnRails
[19:00:12] romeoh: has joined #RubyOnRails
[19:02:40] romeoh: has joined #RubyOnRails
[19:03:17] romeoh_: has joined #RubyOnRails
[19:05:07] pLaTo0n: has joined #RubyOnRails
[19:08:02] arBmind: has joined #RubyOnRails
[19:10:45] defsdoor: has joined #RubyOnRails
[19:14:40] mdw: has joined #RubyOnRails
[19:32:05] spheric: has joined #RubyOnRails
[19:38:26] ascarter: has joined #RubyOnRails
[19:40:10] ur5us: has joined #RubyOnRails
[19:44:08] bronson: has joined #RubyOnRails
[19:49:41] srinidhi: has joined #RubyOnRails
[20:13:56] DoubleMalt: has joined #RubyOnRails
[20:16:18] spheric: has joined #RubyOnRails
[20:19:05] hobodave: has joined #RubyOnRails
[20:27:48] xx00__: has joined #RubyOnRails
[20:31:23] shilon: has joined #RubyOnRails
[20:39:56] dionysus69: has joined #RubyOnRails
[20:41:25] mikecmpb_: has joined #RubyOnRails
[20:46:26] blackmesa: has joined #RubyOnRails
[20:48:58] ascarter: has joined #RubyOnRails
[20:50:02] shilon: has joined #RubyOnRails
[20:53:58] ur5us: has joined #RubyOnRails
[20:59:43] zepy_aq_: has joined #RubyOnRails
[20:59:52] ur5us: has joined #RubyOnRails
[21:04:56] pusewicz: has joined #RubyOnRails
[21:05:18] xco: has joined #RubyOnRails
[21:05:49] xco: i’m upgrading from Rails 4.0 to 4.1, question is, is it obligatory to have the config/secrets.yml file?
[21:05:55] bronson: has joined #RubyOnRails
[21:13:51] shilon: xco: http://guides.rubyonrails.org/4_1_release_notes.html#config-secrets-yml
[21:14:48] rakm: has joined #RubyOnRails
[21:15:13] shilon: Not an expert but I think you always need to store the secret_key_base
[21:17:07] rafaeldelucena: has joined #RubyOnRails
[21:17:35] zacts: has joined #RubyOnRails
[21:27:01] HoierM_: has joined #RubyOnRails
[21:38:20] Coldblackice: has joined #RubyOnRails
[21:39:19] roamingdog: has joined #RubyOnRails
[21:42:36] Technodrome: has joined #RubyOnRails
[21:43:15] havenwood: has joined #RubyOnRails
[21:59:48] Yzguy: has joined #RubyOnRails
[22:01:42] havenwood: has joined #RubyOnRails
[22:03:00] lxsameer: has joined #RubyOnRails
[22:26:56] User458764: has joined #RubyOnRails
[22:34:25] hahuang65: has joined #RubyOnRails
[22:35:52] swgillespie: has joined #RubyOnRails
[22:41:57] cjhowe: has joined #RubyOnRails
[22:44:22] romeoh: has joined #RubyOnRails
[22:44:34] romeoh: has joined #RubyOnRails
[22:45:40] romeoh: has joined #RubyOnRails
[22:46:15] bruce_lee: has joined #RubyOnRails
[22:48:03] Yzguy: has joined #RubyOnRails
[22:49:26] Scriptonaut: has joined #RubyOnRails
[22:49:35] ErhardtMundt: has joined #RubyOnRails
[22:50:19] Scriptonaut: hey y'all, I'm having issues using "group" and "having" in an ActiveRecord query. I get a PG::GroupingError because column "people.id" must appear in the GROUP BY clause or be used in an aggregate function
[22:50:23] Scriptonaut: https://gist.github.com/robins35/10178e09d6b5b966fc4dc596eafeb661
[22:50:31] Scriptonaut: there is the query, as well as the error output in a rails console
[22:50:41] Scriptonaut: can anyone tell me why that's happening?
[22:51:05] Scriptonaut: ultimately, what I want, is to find all the people who have email details with a value that is the same as another email detail belonging to a person on teh same account
[22:51:22] Scriptonaut: I'm trying to find all the people with duplicate emails (within an account)
[22:54:38] Yzguy: has joined #RubyOnRails
[23:03:32] dnewkerk: has joined #RubyOnRails
[23:07:00] spheric: has joined #RubyOnRails
[23:25:06] bronson: has joined #RubyOnRails
[23:27:15] andrew9184: has joined #RubyOnRails
[23:28:35] hobodave: has joined #RubyOnRails
[23:30:37] desnudopenguino: from a sql standpoint, it might be something like select count(email), email from people group by email should cover it (i think)
[23:32:35] desnudopenguino: Scriptonaut: (see above)
[23:33:11] desnudopenguino: and append a having count(email) > 1 probably
[23:34:10] desnudopenguino: and a where in there for the account id
[23:34:15] desnudopenguino: to get it for the specific id
[23:34:59] desnudopenguino: select email, count(email) from people where account_id = <some id> group by email having count(email) > 1 in pseudocode of coures
[23:35:11] desnudopenguino: s/coures/course
[23:35:28] roamingdog: has joined #RubyOnRails
[23:38:04] Scriptonaut: desnudopenguino: I figured it out, to fix it, I just had to order by "details.value", because I guess ActiveRecord inserts an auto order_by "people.id"
[23:44:43] ur5us: has joined #RubyOnRails
[23:45:12] desnudopenguino: I'm pretty new to rails, but have spend quite a while messing with sql
[23:55:13] ascarter: has joined #RubyOnRails