« Back to channel list

#RubyOnRails - 15 September 2017

« Back 1 day Forward 1 day »
[00:01:24] mars777: Within my td tags i just want 1 and my loop keep generating like 7 because i have an association that has 7 table records. So a td tag for every record. I really just want one. Probably simple silly question. Please help
[00:03:07] SteenJobs_: has joined #RubyOnRails
[00:08:31] jhfisc: has joined #RubyOnRails
[00:17:01] jhfisc: has joined #RubyOnRails
[00:20:31] ascarter: has joined #RubyOnRails
[00:22:43] brent__: has joined #RubyOnRails
[00:24:29] Skull0Inc: has joined #RubyOnRails
[00:25:41] Skull0Inc: Hey all, just want verification on something. Was going through a tutorial/example and they had some ruby code in coffeescript. Is that possible? I've tried doing the same but it doesnt seem to work even though I set filename to coffee.erb. Is it possible?
[00:35:33] kn-928: has joined #RubyOnRails
[00:36:46] jhfisc: has joined #RubyOnRails
[00:42:09] jhfisc: has joined #RubyOnRails
[00:42:19] ascarter: has joined #RubyOnRails
[00:42:46] kn-928: has joined #RubyOnRails
[00:45:03] jhfisc: has joined #RubyOnRails
[00:48:16] bronson: has joined #RubyOnRails
[00:51:15] jhfisc: has joined #RubyOnRails
[00:54:25] ascarter: has joined #RubyOnRails
[00:58:29] ahrs: has joined #RubyOnRails
[01:05:04] ascarter: has joined #RubyOnRails
[01:09:14] powrtoch: has joined #RubyOnRails
[01:09:48] fryguy: has joined #RubyOnRails
[01:13:31] wbnns: has left #RubyOnRails: ()
[01:16:16] ascarter: has joined #RubyOnRails
[01:16:31] juggler: has joined #RubyOnRails
[01:23:13] jhfisc: has joined #RubyOnRails
[01:27:08] ascarter: has joined #RubyOnRails
[01:28:24] jhfisc: has joined #RubyOnRails
[01:29:29] brent__: has joined #RubyOnRails
[01:31:31] tetraktys: has joined #RubyOnRails
[01:34:06] jhfisc: has joined #RubyOnRails
[01:37:48] ascarter: has joined #RubyOnRails
[01:40:43] quazimodo: has joined #RubyOnRails
[01:47:37] fschuindt: has joined #RubyOnRails
[01:47:41] jhfisc: has joined #RubyOnRails
[01:47:52] brent__: has joined #RubyOnRails
[01:49:05] ascarter: has joined #RubyOnRails
[01:59:45] ascarter: has joined #RubyOnRails
[02:05:53] Jameser: has joined #RubyOnRails
[02:08:27] agent_white: has joined #RubyOnRails
[02:10:26] ascarter: has joined #RubyOnRails
[02:20:20] orbyt_: has joined #RubyOnRails
[02:21:41] ascarter: has joined #RubyOnRails
[02:25:31] TheMoonMaster: has joined #RubyOnRails
[02:28:55] brent__: has joined #RubyOnRails
[02:30:36] jhfisc: has joined #RubyOnRails
[02:32:29] ascarter: has joined #RubyOnRails
[02:43:05] ascarter: has joined #RubyOnRails
[02:46:08] zacts: has joined #RubyOnRails
[02:47:16] dviola: has joined #RubyOnRails
[02:49:11] bronson: has joined #RubyOnRails
[02:49:16] jhfisc: has joined #RubyOnRails
[02:54:15] ascarter: has joined #RubyOnRails
[02:55:14] jhfisc: has joined #RubyOnRails
[03:00:21] sandstrom: has joined #RubyOnRails
[03:02:17] srinidhi: has joined #RubyOnRails
[03:05:09] ascarter: has joined #RubyOnRails
[03:05:22] jhfisc: has joined #RubyOnRails
[03:15:48] ascarter: has joined #RubyOnRails
[03:17:13] jhfisc: has joined #RubyOnRails
[03:18:38] veex: has joined #RubyOnRails
[03:19:13] wethu: has joined #RubyOnRails
[03:24:27] srinidhi: has joined #RubyOnRails
[03:27:05] ascarter: has joined #RubyOnRails
[03:28:55] jhfisc: has joined #RubyOnRails
[03:29:30] dviola: has joined #RubyOnRails
[03:32:29] jhfisc: has joined #RubyOnRails
[03:37:10] jhfisc: has joined #RubyOnRails
[03:37:51] ascarter: has joined #RubyOnRails
[03:39:38] kapil___: has joined #RubyOnRails
[03:40:20] kapil___: i want to know if a object is simple value, hash or array of hash, how can i do it?
[04:00:40] Trynemjoel: has joined #RubyOnRails
[04:00:58] veex: `is_a?` or `kind_of?` if you want to include inheritance chain in the check otherwise use `instance_of?` to check if the object is instance of a specific class.
[04:09:13] jhfisc: has joined #RubyOnRails
[04:17:52] kapil___: what is `is_a?` for array?
[04:18:53] jhfisc: has joined #RubyOnRails
[04:21:28] kapil___: found : is_a?(Array) Thanks and for hash?
[04:22:22] kapil___: found `is_a?(Hash)` thank you
[04:25:13] jhfisc: has joined #RubyOnRails
[04:31:17] jhfisc: has joined #RubyOnRails
[04:32:31] coder2000: has joined #RubyOnRails
[04:33:14] coder2000: Good evening
[04:37:13] jhfisc: has joined #RubyOnRails
[04:38:02] kapil___: good morning
[04:39:22] coder2000: I am trying to find the students who are not already enrolled in the applicable course. I am using baby_squeel and this is what I have so far: https://gist.github.com/coder2000/b65fc280a6a454ebb6b4ff5f55b2e975
[04:39:32] coder2000: It is not working :(
[04:51:01] bronson: has joined #RubyOnRails
[04:51:23] jhfisc: has joined #RubyOnRails
[04:54:28] powrtoch: has joined #RubyOnRails
[04:59:06] tcopeland: has joined #RubyOnRails
[05:01:19] coder2000: My biggest issue is using variables in the DSL blocks
[05:02:07] coder2000: I am trying to avoid enabling compatibility and I need to check against the current course
[05:02:57] jhfisc: has joined #RubyOnRails
[05:19:13] jhfisc: has joined #RubyOnRails
[05:24:33] jhfisc: has joined #RubyOnRails
[05:29:55] jhfisc: has joined #RubyOnRails
[05:37:05] drale2k_: has joined #RubyOnRails
[05:40:59] kn-928: has joined #RubyOnRails
[05:42:51] kapil___: hello i have a method in a model that returns a hash , but the hash is very big, can i put in somewhere else?
[05:44:14] coder2000: Do you have your code available? You could always try paging it.
[05:59:43] sekmo: has joined #RubyOnRails
[06:06:45] jhfisc: has joined #RubyOnRails
[06:11:48] jhfisc: has joined #RubyOnRails
[06:14:42] ams__: has joined #RubyOnRails
[06:18:03] jhfisc: has joined #RubyOnRails
[06:20:23] kapil___: coder2000: what you say i don;t understand.
[06:21:59] jhfisc: has joined #RubyOnRails
[06:27:12] dionysus69: has joined #RubyOnRails
[06:27:22] coder2000: kapil___: What does your code look like? Do you have a gist.
[06:27:39] coder2000: and are you able to page the data. Query it in pieces
[06:28:53] kapil___: https://gist.github.com/kapilpipaliya/3b061a881b5041295dba570a92e68122
[06:29:32] kapil___: see line 87 def self.display_map_n the hash is very big
[06:30:18] coder2000: I can see that
[06:30:53] kapil___: so i can put it somewhere else?
[06:31:31] coder2000: You may be able to put it as a const in a helper and freeze it unless it uses variables
[06:32:22] kapil___: how to do it. please tell me.
[06:34:53] coder2000: something like this https://gist.github.com/coder2000/03dfc64161dac8566c1ffe6ff2e1d97d
[06:35:42] conta: has joined #RubyOnRails
[06:36:36] kapil___: Thanks what If I not freeze it?
[06:37:05] coder2000: freezing it just prevents it from being manipulated in other code
[06:38:10] kapil___: Ok thanks how is helper available in model?
[06:38:15] gusrub: has joined #RubyOnRails
[06:39:12] coder2000: https://stackoverflow.com/questions/29141093/helper-methods-for-models-in-rails
[06:41:35] kapil___: Thanks I will do it.
[06:45:35] tetraktys: has joined #RubyOnRails
[06:51:51] bronson: has joined #RubyOnRails
[07:03:20] cabotto: has joined #RubyOnRails
[07:07:08] high_fiver: has joined #RubyOnRails
[07:14:44] jhfisc: has joined #RubyOnRails
[07:14:45] kn-928: has joined #RubyOnRails
[07:21:18] jhfisc: has joined #RubyOnRails
[07:27:16] jhfisc: has joined #RubyOnRails
[07:29:01] sandstrom: has joined #RubyOnRails
[07:30:40] kapil___: coder2000: the page you given not have proper anser
[07:32:41] jhfisc: has joined #RubyOnRails
[07:35:31] kies: has joined #RubyOnRails
[07:37:34] coder2000: has joined #RubyOnRails
[07:42:29] defsdoor: has joined #RubyOnRails
[07:49:05] fumk: has joined #RubyOnRails
[07:55:41] kies: has joined #RubyOnRails
[07:59:20] yonbeastie: has joined #RubyOnRails
[08:00:28] ShalokShalom: has joined #RubyOnRails
[08:00:46] jhfisc: has joined #RubyOnRails
[08:02:39] Jameser: has joined #RubyOnRails
[08:03:11] mostlybadfly: has joined #RubyOnRails
[08:05:58] jhfisc: has joined #RubyOnRails
[08:10:11] yonbeastie: has left #RubyOnRails: ()
[08:12:17] noob_on_rails: has joined #RubyOnRails
[08:13:49] noob_on_rails: hey guys , i have implemented some models with nested attributes and when i send a PATCH request for update action
[08:14:02] noob_on_rails: the nested/child models get appended rather than updated
[08:14:23] noob_on_rails: im just Parent.update(params)
[08:14:28] noob_on_rails: Parent.create(params)
[08:17:03] jhfisc: has joined #RubyOnRails
[08:23:20] jhfisc: has joined #RubyOnRails
[08:33:56] kn-928: has joined #RubyOnRails
[08:35:14] lxsameer: has joined #RubyOnRails
[08:37:50] marr: has joined #RubyOnRails
[08:38:28] jhfisc: has joined #RubyOnRails
[08:41:35] coder2000: has left #RubyOnRails: ()
[08:43:38] jhfisc: has joined #RubyOnRails
[08:46:04] cabotto: has joined #RubyOnRails
[08:52:32] srinidhi: has joined #RubyOnRails
[08:52:44] bronson: has joined #RubyOnRails
[08:52:54] dionysus69: you need to include :id inside child_attributes array within strong params
[08:54:06] dionysus69: without id accepts_nested_attributes_for doesnt even try looking for existing children
[08:57:31] sekmo: has joined #RubyOnRails
[09:01:13] Ergo: has joined #RubyOnRails
[09:07:09] coder2000: has joined #RubyOnRails
[09:07:27] zeitchef: has joined #RubyOnRails
[09:10:06] coder2000: has joined #RubyOnRails
[09:11:22] jhfisc: has joined #RubyOnRails
[09:13:43] quazimodo: has joined #RubyOnRails
[09:25:13] jhfisc: has joined #RubyOnRails
[09:31:17] jhfisc: has joined #RubyOnRails
[09:34:52] noob_on_rails: dionysus69: yeap , i managed to do it after all
[09:35:32] noob_on_rails: problem is im constructing the params as they come from the frontend , it's a messy situtation , but now all actions play natively :D
[09:35:54] noob_on_rails: a weird issue though
[09:36:07] noob_on_rails: when i delete a nested model from the form (edit)
[09:36:19] noob_on_rails: rails decides to nullify it instead of deleting it!
[09:37:13] jhfisc: has joined #RubyOnRails
[09:46:03] brent__: has joined #RubyOnRails
[09:47:08] jhfisc: has joined #RubyOnRails
[09:49:17] dionysus69: do you have allow destroy option on accepts nested attributes for decleration?
[09:49:26] sandstrom: has joined #RubyOnRails
[09:49:42] dionysus69: and :_destroy key in the child_params: [:id, :some_other_param, :_destroy]
[09:59:14] jhfisc: has joined #RubyOnRails
[10:00:26] arBmind: has joined #RubyOnRails
[10:01:13] cabotto: has joined #RubyOnRails
[10:09:17] bruno-: has joined #RubyOnRails
[10:09:41] jhfisc: has joined #RubyOnRails
[10:16:02] jhfisc: has joined #RubyOnRails
[10:17:54] dionysus69: has joined #RubyOnRails
[10:37:57] jhfisc: has joined #RubyOnRails
[10:41:36] jhfisc: has joined #RubyOnRails
[10:44:35] ShalokShalom: has joined #RubyOnRails
[10:46:48] jhfisc: has joined #RubyOnRails
[10:52:40] Saukk: has joined #RubyOnRails
[10:54:09] bronson: has joined #RubyOnRails
[10:58:56] tetraktys: has joined #RubyOnRails
[11:04:09] arBmind: has joined #RubyOnRails
[11:08:03] jackhum: has joined #RubyOnRails
[11:08:28] dblessing: has joined #RubyOnRails
[11:10:55] noob_on_rails: dionysus69: hmm , ill check those options , i was dependent destroy
[11:10:59] noob_on_rails: but ill add those too
[11:19:14] jhfisc: has joined #RubyOnRails
[11:21:37] dionysus69: has joined #RubyOnRails
[11:25:15] jhfisc: has joined #RubyOnRails
[11:27:54] jhfisc: has joined #RubyOnRails
[11:34:08] wethu: has joined #RubyOnRails
[11:34:16] roshanavand: has joined #RubyOnRails
[11:34:50] tcopeland: has joined #RubyOnRails
[11:36:02] dionysus69: has joined #RubyOnRails
[11:37:57] kn-928: has joined #RubyOnRails
[11:40:30] jhfisc: has joined #RubyOnRails
[11:43:54] arBmind: has joined #RubyOnRails
[11:51:49] ShalokShalom_: has joined #RubyOnRails
[12:07:37] jhfisc: has joined #RubyOnRails
[12:08:04] roshanavand: has joined #RubyOnRails
[12:09:56] snickers: has joined #RubyOnRails
[12:13:18] jhfisc: has joined #RubyOnRails
[12:14:50] sajinmp: has joined #RubyOnRails
[12:16:24] sajinmp: Is there a way to reverse symbolization of json hash? I was trying to pass it to an api, but it doesn't accept symbolized hash, ruby hash or json string.
[12:17:51] jhfisc: has joined #RubyOnRails
[12:23:48] keegnotrub: has joined #RubyOnRails
[12:23:48] figuresofstick: has joined #RubyOnRails
[12:24:23] helpa: Please do not crosspost without at least telling so. Experience shows that people don't bother to inform the other channels of provided solutions, therefore it is considered rude.
[12:24:30] jhfisc: has joined #RubyOnRails
[12:26:42] Jameser: has joined #RubyOnRails
[12:27:02] drale2k_: has joined #RubyOnRails
[12:27:15] jhfisc: has joined #RubyOnRails
[12:32:16] Jameser: has joined #RubyOnRails
[12:34:19] sajinmp: Oh, sorry didn't know
[12:34:22] sajinmp: has left #RubyOnRails: ("Leaving")
[12:52:41] cabotto: has joined #RubyOnRails
[12:53:59] apparition: has joined #RubyOnRails
[12:55:08] bronson: has joined #RubyOnRails
[12:55:17] jhfisc: has joined #RubyOnRails
[12:57:59] jhfisc: has joined #RubyOnRails
[12:58:35] dviola: has joined #RubyOnRails
[13:03:39] jhfisc: has joined #RubyOnRails
[13:10:31] sandstrom: has joined #RubyOnRails
[13:10:39] mars777: has joined #RubyOnRails
[13:12:34] FrostCandy: has joined #RubyOnRails
[13:13:31] daydreamm: has joined #RubyOnRails
[13:15:41] h7br1x: has joined #RubyOnRails
[13:15:48] jhfisc: has joined #RubyOnRails
[13:17:57] h7br1x: Hey guys, I've got a question about the friendly_id gem. I'm using a scope (user), which I believe means if User A has a post with the title "Hello World" the slug will be "hello-world", if User B also creates a post titled "Hello World" the slug should also be "hello-world" because the scope the URL will be .com/UserA/hello-world and .com/UserB/hello-world. However I can't get rails to accept a duplicate slug of "
[13:17:57] h7br1x: hello-world" for User B. Any suggestions?
[13:18:44] mcr: has joined #RubyOnRails
[13:23:58] GodFather: has joined #RubyOnRails
[13:24:09] kn-928: has joined #RubyOnRails
[13:25:05] chouhoulis: has joined #RubyOnRails
[13:27:59] jhfisc: has joined #RubyOnRails
[13:29:19] GodFather: has joined #RubyOnRails
[13:33:36] bruno-_: has joined #RubyOnRails
[13:41:04] jhfisc: has joined #RubyOnRails
[13:43:53] jhfisc: has joined #RubyOnRails
[13:46:30] brent__: has joined #RubyOnRails
[13:50:28] jhfisc: has joined #RubyOnRails
[13:59:11] chouhoulis: has joined #RubyOnRails
[14:03:06] kn-928: has joined #RubyOnRails
[14:04:46] ResidentBiscuit: has joined #RubyOnRails
[14:07:09] jhfisc: has joined #RubyOnRails
[14:07:17] mcr: has joined #RubyOnRails
[14:10:29] Skull0Inc: has joined #RubyOnRails
[14:15:04] jhfisc: has joined #RubyOnRails
[14:27:14] jhfisc: has joined #RubyOnRails
[14:36:54] drale2k_: has joined #RubyOnRails
[14:37:04] jhfisc: has joined #RubyOnRails
[14:40:12] dionysus69: has joined #RubyOnRails
[14:42:16] jhfisc: has joined #RubyOnRails
[14:45:06] jhfisc: has joined #RubyOnRails
[14:46:55] bruno-: has joined #RubyOnRails
[14:47:07] bruno-_: has joined #RubyOnRails
[14:50:26] jhfisc: has joined #RubyOnRails
[14:53:25] irishfromua: has joined #RubyOnRails
[14:56:07] bronson: has joined #RubyOnRails
[14:57:20] dextrey: has joined #RubyOnRails
[15:03:01] jhfisc: has joined #RubyOnRails
[15:06:02] rosalind: has joined #RubyOnRails
[15:28:55] mfoo: has joined #RubyOnRails
[15:34:21] mfoo: Hi. I have a layout docs.html.haml which renders a head template containing a yield for stylesheets and a yield block for views. The controller calls render :index, layout: 'docs'. In development this works fine. After asset precompilation, none of the content_for blocks from the index view are rendered. Am I missing something?
[15:35:40] mfoo: *the head template has the yield for styleshsets. The layout has the yield for views
[15:37:03] mfoo: Actually, I see no content whatsoever from my layout, only the yield block
[15:38:18] ule: has joined #RubyOnRails
[15:38:44] coder2000: Have you tried replicating the issue with a dummy app to see if it may be a rails bug?
[15:39:53] [Butch]: has joined #RubyOnRails
[15:40:04] brent__: has joined #RubyOnRails
[15:40:11] ule: hey guys.. from an ActiveRecord result obj.. what's the fastest way to pick one from that list having its ID? First I tried users[my_id] of course failed. Then I found the users.select {|u| u.id == my_id}.first
[15:40:19] ule: it works but its very slow
[15:40:57] jhfisc: has joined #RubyOnRails
[15:41:12] coder2000: ule: users.find_by_id(my_id)
[15:41:28] ule: coder2000: that will trigger another call to my db
[15:41:35] ule: and I already have the resultset object
[15:41:37] ule: in memory
[15:41:42] mfoo: this will iterate. doesn't .where(id: id) work? This will move the work into the database.
[15:41:45] coder2000: Sorry misunderstood
[15:42:21] ule: mfoo: yeah.. I don't want to perform that on DB side.. I already have the ruby result object in memory.. I just need to pick the specific guy
[15:42:41] coder2000: Why don't you want to use the DB for that?
[15:43:16] ule: Its a long story.. basically I'm crossing data from multiple tables.. I'm trying to optimize that
[15:43:45] mfoo: Have you tried `.joins`?
[15:43:55] ule: I got this this simple point where I have an object with all my users.. and now, I need to pick one from that list.. but I was wondering how can I do this using a BigO(1)
[15:44:23] ule: I was wondering if I could juyst ocnvert that to an array.
[15:44:32] ule: using user.id as index
[15:44:43] ule: then I could just do something like users[my_id]
[15:45:05] coder2000: I am trying to find all the students who are not enrolled in a specific class and my query isn't working. I am using baby_squeel. https://gist.github.com/coder2000/b65fc280a6a454ebb6b4ff5f55b2e975
[15:45:46] ule: I'm gonna try using .pluck or .select instead
[15:46:10] dionysus69: has joined #RubyOnRails
[15:47:07] jhfisc: has joined #RubyOnRails
[15:51:35] atrius: has joined #RubyOnRails
[15:53:14] jhfisc: has joined #RubyOnRails
[15:55:28] kn-928: has joined #RubyOnRails
[15:59:15] jhfisc: has joined #RubyOnRails
[16:00:54] mlt-: I have a couple of models one with accepts_nested_attributes_for . Everything works okay, but not during rake tests :( Somehow nested object isn't written to DB. Any ideas what might be causing it?
[16:01:41] mlt-: And when I do puts outer.inner.inspect , it says nil
[16:01:46] mlt-: during tests
[16:02:01] jhfisc: has joined #RubyOnRails
[16:13:51] jhfisc: has joined #RubyOnRails
[16:20:42] francuz: has joined #RubyOnRails
[16:21:56] jhfisc: has joined #RubyOnRails
[16:29:08] jhfisc: has joined #RubyOnRails
[16:29:36] vivus: has joined #RubyOnRails
[16:29:47] vivus: Hello all
[16:29:53] vivus: so I am getting the following error
[16:30:04] vivus: Unable to load application: Bundler::GemRequireError: There was an error while trying to load the gem 'uglifier'.
[16:30:09] ResidentBiscuit: has joined #RubyOnRails
[16:30:17] vivus: Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
[16:30:29] vivus: stackoverflow says that I must install node.js
[16:30:44] vivus: but if I disable uglifier, will my app still work?
[16:31:19] havenwood: vivus: You don't have to install Node.js, but it's a simple path forward. Uglifier and friends are not necessary but are standard.
[16:31:37] havenwood: vivus: Your app will still work.
[16:32:03] vivus: so I should remove uglifier and remove 12-factor app from the Gemfile. then I must rerun bundle install ?
[16:32:18] havenwood: vivus: Yes, rerun `bundle` after changes to the Gemfile.
[16:34:24] vivus: thank you havenwood . it worked. now I got: Read error: #<ActiveRecord::NoDatabaseError: FATAL: role "ubuntu" does not exist
[16:34:39] havenwood: vivus: gotta setup your postgres
[16:35:06] havenwood: or whatever your db is
[16:35:46] havenwood: vivus: Check your `config/database.yml`, what db are you using in your current environment?
[16:36:31] vivus: havenwood: I assumed the code/app would generate the DB for me. Do I need to manually create a DB/user?
[16:37:06] havenwood: vivus: `rails db:create` and rails commands that invoke that task will create the db for you
[16:37:12] havenwood: vivus: you may need to setup a db user
[16:37:14] havenwood: vivus: what db?
[16:37:24] vivus: postgres is installed on my system havenwood
[16:37:25] jhfisc: has joined #RubyOnRails
[16:37:34] havenwood: vivus: And is that the db you're setup to use?
[16:37:40] havenwood: vivus: Check your `config/database.yml`, what db are you using in your current environment?
[16:37:43] vivus: sudo apt-get install postgresql postgresql-contrib
[16:37:59] dviola: has joined #RubyOnRails
[16:38:39] havenwood: vivus: I woulda thought: sudo apt-get install libpq-dev.
[16:38:41] orbyt_: has joined #RubyOnRails
[16:38:54] vivus: I had to install that later as well
[16:40:12] havenwood: vivus: I'd suggest creating a postgres user for your ubuntu user: createuser --interactive ubuntu
[16:41:06] havenwood: vivus: Basically get Postgres working for your current user, then: rails db:setup
[16:41:11] havenwood: (Creates the database, loads the schema, and initializes with the seed data.)
[16:42:24] vivus: havenwood: what does that createuser command do? (I know it creates a user, but is it being used with postgres?)
[16:43:06] havenwood: vivus: See: man createuser
[16:43:07] havenwood: "createuser creates a new PostgreSQL user (or more precisely, a role)."
[16:43:52] bruno-__: has joined #RubyOnRails
[16:44:04] bruno-___: has joined #RubyOnRails
[16:47:46] cagomez: has joined #RubyOnRails
[16:51:32] jhfisc: has joined #RubyOnRails
[16:55:07] mtkd: has joined #RubyOnRails
[16:57:14] bronson: has joined #RubyOnRails
[16:59:30] francuz: hello, I do in a controller something like this @gallery.pictures.create(file: params[:file]) and i would like to acces to the picture after it, does @picture = @gallery.pictures.create(file: params[:file]) works? i cannot find documentation about it and don't a rails server on this computer ...
[17:02:00] jhfisc: has joined #RubyOnRails
[17:03:06] havenwood: francuz: Yup, #create returns the created instance.
[17:04:09] one_zero: has joined #RubyOnRails
[17:06:47] vivus: havenwood: I managed to get it to work. it was quite a mission, but you were very helpful and I thank you immensely for your patience
[17:07:10] havenwood: vivus: Congrats on success! You're welcome
[17:09:14] vivus: havenwood: it was also quite anti-climax. I expected the app to do more, but it does so little XD
[17:18:04] jhfisc: has joined #RubyOnRails
[17:36:46] Chernobuk: has joined #RubyOnRails
[17:37:26] kn-928: has joined #RubyOnRails
[17:40:37] keegnotrub_: has joined #RubyOnRails
[17:42:42] chouhoulis: has joined #RubyOnRails
[17:44:32] cagomez: has joined #RubyOnRails
[17:47:06] jhfisc: has joined #RubyOnRails
[17:53:20] srinidhi: has joined #RubyOnRails
[17:54:53] orbyt_: has joined #RubyOnRails
[17:54:59] kies: has joined #RubyOnRails
[17:55:04] jhfisc: has joined #RubyOnRails
[18:01:14] jhfisc: has joined #RubyOnRails
[18:12:37] tcopeland: has joined #RubyOnRails
[18:12:44] maryo: has joined #RubyOnRails
[18:13:06] arBmind: has joined #RubyOnRails
[18:16:11] conta: has joined #RubyOnRails
[18:17:45] netzfisch: has joined #RubyOnRails
[18:18:06] jhfisc: has joined #RubyOnRails
[18:20:52] plop: has joined #RubyOnRails
[18:21:16] jhfisc: has joined #RubyOnRails
[18:31:04] atrius: has joined #RubyOnRails
[18:33:01] jhfisc: has joined #RubyOnRails
[18:34:51] sandstrom: has joined #RubyOnRails
[18:38:23] lxsameer: has joined #RubyOnRails
[18:45:54] jhfisc: has joined #RubyOnRails
[18:49:13] jhfisc: has joined #RubyOnRails
[18:55:13] jhfisc: has joined #RubyOnRails
[18:57:01] hammer065: has joined #RubyOnRails
[18:58:12] bronson: has joined #RubyOnRails
[18:59:41] Skull0Inc: has joined #RubyOnRails
[19:07:01] gambl0re: has joined #RubyOnRails
[19:07:39] jhfisc: has joined #RubyOnRails
[19:09:34] IFrank00: has joined #RubyOnRails
[19:12:35] jhfisc: has joined #RubyOnRails
[19:12:55] netzfisch: has joined #RubyOnRails
[19:17:39] jhfisc: has joined #RubyOnRails
[19:18:01] cagomez: has joined #RubyOnRails
[19:20:53] bronson: has joined #RubyOnRails
[19:21:40] Slinky_Pete: has joined #RubyOnRails
[19:22:12] IFrank00: Im working on upgrading to rails 5 and im having problems with my jsonb column its not reading it like a hash.
[19:22:34] IFrank00: https://gist.github.com/Frank004/22009f5b8f1368d887dbc93139977dff
[19:23:13] jhfisc: has joined #RubyOnRails
[19:23:27] IFrank00: on rails 4 its read it like jsonb :column {} but now its reading like a string
[19:24:11] IFrank00: I try a migration to make it default to {} but still getting the string reading error
[19:25:00] IFrank00: https://github.com/rails/rails/issues/25594
[19:26:44] mostlybadfly: has joined #RubyOnRails
[19:29:13] jhfisc: has joined #RubyOnRails
[19:34:08] jhfisc: has joined #RubyOnRails
[19:35:24] hfp_work: has joined #RubyOnRails
[19:41:49] kn-928: has joined #RubyOnRails
[19:44:31] jhfisc: has joined #RubyOnRails
[19:45:48] maryo: While importing a excel workbook to a Rails application, I am getting "undefined method `value' for nil:NilClass
[19:45:49] maryo: " error message. The error is pointing at this line "mark = workbook["Results"][q_index][column].value" in my code. Any hints would be helpful here. Thanks in advance.
[19:49:19] cagomez: has joined #RubyOnRails
[19:49:49] simmerz: has joined #RubyOnRails
[19:50:28] simmerz: Why does rspec tell me that I have migrations to run, even though I have `ActiveRecord::Migration.maintain_test_schema!` set?
[19:51:03] simmerz: realised this should probably be in a more specific channel and then massively failed to join it!
[19:51:51] jhfisc: has joined #RubyOnRails
[19:56:23] sandstrom: has joined #RubyOnRails
[20:07:36] tsia: has joined #RubyOnRails
[20:16:46] jhfisc: has joined #RubyOnRails
[20:19:38] orbyt_: has joined #RubyOnRails
[20:27:59] FrostCandy: I have a file under assets/iframe-resizer/iframeResizer.min.js somehow the guys that wrote the program call it with /assets/iframe-resizer/iframeResizer.min-b6799fa43ae986741148d90a0db87a7607e940ee355b55ee68d7cbf6ee43c2a4.js but the file with the long number doesn't exist. Is rails doing this ?
[20:29:00] kn-928: has joined #RubyOnRails
[20:30:34] cagomez: has joined #RubyOnRails
[20:36:27] FrostCandy: ahh they call a function url_to_javascript(foo) maybe url_to_javascript adds the numbers.
[20:37:55] tsia: has joined #RubyOnRails
[20:45:04] jhfisc: has joined #RubyOnRails
[20:45:43] FrostCandy: looks like url_to_javascript does add the md5hash or whatever it is, to make sure user downloads the most current version maybe. :) solved
[20:52:29] jhfisc: has joined #RubyOnRails
[20:57:35] jhfisc: has joined #RubyOnRails
[21:03:37] jhfisc: has joined #RubyOnRails
[21:10:17] jhfisc: has joined #RubyOnRails
[21:14:24] vivus: has left #RubyOnRails: ("Leaving")
[21:15:48] simmerz: has joined #RubyOnRails
[21:15:57] jhfisc: has joined #RubyOnRails
[21:16:43] simmerz: has joined #RubyOnRails
[21:17:33] simmerz: has joined #RubyOnRails
[21:18:22] simmerz: has joined #RubyOnRails
[21:23:54] tsia: has joined #RubyOnRails
[21:38:37] jhfisc: has joined #RubyOnRails
[21:41:31] IknoweD: has joined #RubyOnRails
[21:43:52] IknoweD: hello RoR wizards. how can i get RoR to qualify active record objects with a pg namespace schema that varies by deployment?
[21:44:30] havenwood: IknoweD: show us how it varies?
[21:45:48] IknoweD: @haven, I have four deployments of the same rails app that currently use local pg for active record work. i would like to run those four but to have their active record stored on amazon rds. i would like all four activerecord dbs to exist in one pg db, which would mean having a different pg schema to qualify identical objects for each deploy.
[21:45:57] havenwood: self.table_name = "IknoweD_#{Rails.env}"
[21:46:36] IknoweD: @haven so there is no global way to do this, i'd need to set table_name in each ar model?
[21:47:28] zacts: has joined #RubyOnRails
[21:47:44] havenwood: IknoweD: I mean you could do it globally, in your application_controller.rb.
[21:48:01] havenwood: IknoweD: Whatever you prefer.
[21:48:39] IknoweD: @haven, what would the syntax be for application_controller.rb.?
[21:49:17] jhfisc: has joined #RubyOnRails
[21:50:05] IknoweD: i'd thought that if i only had one pg schema in database.yml that it would only be able to create ar objects in that schema on rake db:reset but no
[21:50:48] havenwood: IknoweD: self.table_name = "IknoweD_#{Rails.env}"
[21:51:20] IknoweD: @haven does application_controller.rb have context for self.table_name ?
[21:51:27] zacts_: has joined #RubyOnRails
[21:52:01] havenwood: IknoweD: Inside: class ApplicationController < ActionController::Base
[21:52:13] havenwood: IknoweD: I'm not sure I get what you're asking.
[21:52:26] havenwood: IknoweD: Maybe get it working on a single table first.
[21:52:32] IknoweD: that would be simple
[21:52:44] IknoweD: i want an entire rails deployment to operate confined to its own schema
[21:53:41] IknoweD: so that what is now stored in separate dbs can be stored in the same db but qualified out by pg schema
[21:55:05] jhfisc: has joined #RubyOnRails
[21:56:54] havenwood: IknoweD: That one line in the application_controller should do the trick.
[21:57:52] IknoweD: @haven, i can see how a model would have context for self.table_name. But how would application_controller have that context?
[21:58:18] IknoweD: I mean, what would self.table_name be in application controller before i overrode it
[21:58:23] havenwood: IknoweD: All the other models inherit from the application controller.
[21:58:49] havenwood: It defaults to the conventional name.
[21:58:58] havenwood: I mean controllers inherit from application controller.
[21:59:13] IknoweD: I am not running any views on this, just using ar to drive other code.
[21:59:25] IknoweD: the controller is never hit
[22:00:05] IknoweD: thx tho, gotta run
[22:00:24] havenwood: A rails app without views or controllers? Hmmm.
[22:00:49] havenwood: Is it still a forest if there are no trees?
[22:03:01] jhfisc: has joined #RubyOnRails
[22:11:31] jhfisc: has joined #RubyOnRails
[22:18:50] netzfisch: has joined #RubyOnRails
[22:23:45] cagomez: has joined #RubyOnRails
[22:25:20] cagomez: has joined #RubyOnRails
[22:27:10] theunraveler: has joined #RubyOnRails
[22:32:06] bronson: has joined #RubyOnRails
[22:50:28] orbyt_: has joined #RubyOnRails
[22:59:10] tcopeland: has joined #RubyOnRails
[23:00:39] quazimodo: has joined #RubyOnRails
[23:11:29] michael_mbp: I've cached a record in redis (by hand) and am performing a deserialisation, also by hand. Right now, I'm returning the model by doing Model.new(hash); where the hash is the deserialised info.
[23:12:17] michael_mbp: How can I make that PORO (Model) be the same as the model that one would fetch by doing Model.find() ?
[23:12:26] michael_mbp: i.e. without making a DB call.
[23:16:47] conta2: has joined #RubyOnRails
[23:36:10] kn-928: has joined #RubyOnRails
[23:56:08] FCser: has joined #RubyOnRails