« Back to channel list

#RubyOnRails - 16 August 2017

« Back 1 day Forward 1 day »
[00:03:26] jhfisc: has joined #RubyOnRails
[00:09:02] jhfisc: has joined #RubyOnRails
[00:13:46] brent__: has joined #RubyOnRails
[00:15:20] jhfisc: has joined #RubyOnRails
[00:23:55] aajjbb: has joined #RubyOnRails
[00:24:28] cagomez: has joined #RubyOnRails
[00:25:41] jmay: has joined #RubyOnRails
[00:31:46] jhfisc: has joined #RubyOnRails
[00:32:58] elomatreb: Hi - I have a problem with enums and defaults. I have a model which has an enum defined, and a default set in the database. Yet a new model (.new) the enum property is nil, and not the correct value it should be from the default set in the database. The strangest thing is that the same code (shared through a concern) works on another model.
[00:36:19] spheric: has joined #RubyOnRails
[00:37:59] jhfisc: has joined #RubyOnRails
[00:41:12] jhfisc: has joined #RubyOnRails
[00:45:17] lessless: has joined #RubyOnRails
[00:52:33] beilabs: has joined #RubyOnRails
[00:52:38] jhfisc: has joined #RubyOnRails
[00:54:31] jmay: has joined #RubyOnRails
[00:58:12] beilabs: has joined #RubyOnRails
[00:58:58] sevenseacat: has joined #RubyOnRails
[01:00:58] jhfisc: has joined #RubyOnRails
[01:01:27] brent__: has joined #RubyOnRails
[01:04:45] aajjbb: has joined #RubyOnRails
[01:04:59] laphoriag75: has joined #RubyOnRails
[01:09:34] jhfisc: has joined #RubyOnRails
[01:19:47] jhfisc: has joined #RubyOnRails
[01:20:49] GodFather: has joined #RubyOnRails
[01:25:44] jhfisc: has joined #RubyOnRails
[01:30:37] gusrub: has joined #RubyOnRails
[01:38:44] mdel: has joined #RubyOnRails
[01:39:11] jhfisc: has joined #RubyOnRails
[01:40:31] kn-928: has joined #RubyOnRails
[01:47:43] jhfisc: has joined #RubyOnRails
[01:55:52] quazimodo: has joined #RubyOnRails
[01:58:47] jhfisc: has joined #RubyOnRails
[02:03:47] jhfisc: has joined #RubyOnRails
[02:10:41] jhfisc: has joined #RubyOnRails
[02:17:26] jhfisc: has joined #RubyOnRails
[02:19:47] PresidentBiscuit: has joined #RubyOnRails
[02:27:47] jhfisc: has joined #RubyOnRails
[02:34:25] irishfromua: has joined #RubyOnRails
[02:39:32] jhfisc: has joined #RubyOnRails
[02:39:54] laphoraig92: has joined #RubyOnRails
[02:42:36] irishfromua: has joined #RubyOnRails
[02:44:12] SteenJobs_: has joined #RubyOnRails
[02:44:34] jhfisc: has joined #RubyOnRails
[02:48:30] fryguy: has joined #RubyOnRails
[03:04:06] beilabs: has joined #RubyOnRails
[03:07:59] brent__: has joined #RubyOnRails
[03:09:04] aperkins81: has joined #RubyOnRails
[03:09:53] gusrub: has joined #RubyOnRails
[03:11:53] alfiemax: has joined #RubyOnRails
[03:32:47] hahuang65: has joined #RubyOnRails
[03:33:06] quazimodo: has joined #RubyOnRails
[03:36:31] kn-928: has joined #RubyOnRails
[03:57:59] jmay: has joined #RubyOnRails
[03:58:01] kies: has joined #RubyOnRails
[04:09:40] brent__: has joined #RubyOnRails
[04:13:19] grvgr_: has joined #RubyOnRails
[04:19:10] brent__: has joined #RubyOnRails
[04:22:14] SteenJobs_: has joined #RubyOnRails
[04:24:33] dionysus69: has joined #RubyOnRails
[04:28:24] taf2: has joined #RubyOnRails
[04:28:31] taf2: has left #RubyOnRails: ()
[04:31:20] conta: has joined #RubyOnRails
[04:35:54] brent__: has joined #RubyOnRails
[04:38:40] brent__: has joined #RubyOnRails
[04:41:55] Or1on: has joined #RubyOnRails
[04:52:37] dionysus69: has joined #RubyOnRails
[04:54:31] dionysus69: I have noticed the following behavior with action cable, if I get any kind of error in javascript console, actioncable doesn't connect. does that make any sense?
[04:56:08] muzik: javascript stop processing javascript on error
[04:56:16] muzik: its a double edged sword
[04:57:47] dionysus69: hmm dunno, I have dealt with sites with tone of js errors
[04:57:54] dionysus69: but still rest of js would work
[05:02:41] cjohnson: dionysus69: it depends on where the error happened
[05:02:52] cjohnson: it's more accurate to say that "the current block of JS will stop processing"
[05:02:57] cjohnson: so it depends what else was in that block
[05:03:03] cjohnson: In this case, sounds like something important
[05:03:17] cjohnson: or whatever you want to call it
[05:03:36] dionysus69: it was guard autoreload, dunno if it can have anything common with actioncable
[05:04:04] cjohnson: it's not about being in common, just about which block it's running in
[05:04:24] cjohnson: if it's part of the first initial page load block, which a ton of scripts will do a lot of setup in, then yes, it would cause other code to not run
[05:14:37] ur5us: has joined #RubyOnRails
[05:15:41] dionysus69: ok thanks cjohnson & muzik
[05:25:14] kitsuneyo: has joined #RubyOnRails
[05:32:28] jamal7: has joined #RubyOnRails
[05:33:37] hahuang65: has joined #RubyOnRails
[05:43:03] jhfisc: has joined #RubyOnRails
[05:46:30] kn-928: has joined #RubyOnRails
[05:46:32] jhfisc: has joined #RubyOnRails
[05:59:23] apparition: has joined #RubyOnRails
[05:59:50] jhfisc: has joined #RubyOnRails
[06:02:33] Jameser: has joined #RubyOnRails
[06:05:50] jhfisc: has joined #RubyOnRails
[06:09:42] kitsuneyo: has joined #RubyOnRails
[06:11:50] jhfisc: has joined #RubyOnRails
[06:21:00] jhfisc: has joined #RubyOnRails
[06:29:43] quazimodo: has joined #RubyOnRails
[06:30:22] kitsuneyo: has joined #RubyOnRails
[06:38:17] kitsuneyo: has joined #RubyOnRails
[06:40:08] conta: has joined #RubyOnRails
[06:41:46] jhfisc: has joined #RubyOnRails
[06:50:08] jhfisc: has joined #RubyOnRails
[06:52:54] Attic_Salt: has joined #RubyOnRails
[06:56:10] jhfisc: has joined #RubyOnRails
[06:57:02] username1: has joined #RubyOnRails
[06:59:04] srinidhi: has joined #RubyOnRails
[07:00:45] jhfisc: has joined #RubyOnRails
[07:04:54] Mikaela-: has left #RubyOnRails: ("User left")
[07:05:45] jhfisc: has joined #RubyOnRails
[07:11:47] jhfisc: has joined #RubyOnRails
[07:17:30] AzaToth: has joined #RubyOnRails
[07:23:17] emers2n: has joined #RubyOnRails
[07:23:26] conta: folks, I am getting `NameError (uninitialized constant OpenSSL::SSL::VERIFY_25):` on email.deliver. Google doesn't find anything on OpenSSL::SSL::VERIFY_25. Any idea what could that be?I am on ruby 2.4.1 and rails 4.2.9
[07:23:54] emers2n: local host or production
[07:24:14] conta: production, no error on localhost
[07:24:49] noob_on_rails: has joined #RubyOnRails
[07:25:04] conta: I have :openssl_verify_mode => 'none'
[07:27:40] jhfisc: has joined #RubyOnRails
[07:31:19] jhfisc: has joined #RubyOnRails
[07:34:54] hahuang65: has joined #RubyOnRails
[07:37:48] jhfisc: has joined #RubyOnRails
[07:38:30] dionysus69: has joined #RubyOnRails
[07:38:31] kn-928: has joined #RubyOnRails
[07:48:07] mtkd: has joined #RubyOnRails
[07:55:42] jhfisc: has joined #RubyOnRails
[07:57:42] crst: has joined #RubyOnRails
[07:58:29] crst: current_path gives me "subfolder/index.html" is there a method which gives me only "subfolder" ?
[07:58:55] mikecmpbll: has joined #RubyOnRails
[08:02:41] jhfisc: has joined #RubyOnRails
[08:06:15] arBmind: has joined #RubyOnRails
[08:08:59] kitsuneyo: has joined #RubyOnRails
[08:12:01] ferr1: has joined #RubyOnRails
[08:27:28] quazimodo: has joined #RubyOnRails
[08:33:52] srinidhi: has joined #RubyOnRails
[08:35:26] hahuang65: has joined #RubyOnRails
[08:36:05] fox_mulder_cp: conta: i see a some hints for sending email via google from rails in first google results. btw, now my ISP locks 25/465/587 ports for it's own smtp relay
[08:38:45] conta: fox_mulder_cp: could you send me link? my first result is something about OpenSSL::Cipher::CipherError
[08:38:54] conta: thought I am not sending via google
[08:39:44] k13nox: has joined #RubyOnRails
[08:40:41] conta: Weird is that if I go to ruby/openssl on github, there is no mention of VERIFY_25 in source code
[08:40:42] kitsuneyo: has joined #RubyOnRails
[08:42:42] defsdoor: has joined #RubyOnRails
[08:43:50] k13nox: Hi, i'm on AWS, i use Rails 5.1 with ActionCable. ActionCable use Elasticache Redis. And i juste want to know if Redis default params: `timeout: 0` and `tcp-keepalive: 300` it's good or not ?
[08:44:21] beilabs: has joined #RubyOnRails
[08:47:05] matthewd: conta: I'd guess somewhere you're getting a 25 into an openssl_verify_mode-like setting, and it's then falling into a const_get("VERIFY_#{v}")
[08:49:46] jhfisc: has joined #RubyOnRails
[08:53:37] kitsuneyo: has joined #RubyOnRails
[08:56:05] jhfisc: has joined #RubyOnRails
[08:57:50] fox_mulder_cp: conta: i have a problems with old school socket external server app, and have a game with ssl1/2 and ciphers for open connection to it
[08:58:59] conta: fox_mulder_cp: matthewd: found the problem: colleague changed the deployment a bit and made a mistake in config.
[09:01:48] jhfisc: has joined #RubyOnRails
[09:15:12] jhfisc: has joined #RubyOnRails
[09:20:22] jhfisc: has joined #RubyOnRails
[09:22:01] lxnr: has joined #RubyOnRails
[09:25:27] jhfisc: has joined #RubyOnRails
[09:27:44] Cork: is it possible to list active model delegates in a similar manner you can list associations with reflect_on_all_associations?
[09:35:47] jhfisc: has joined #RubyOnRails
[09:35:55] matthewd: Cork: I'm not sure what "active model delegates" are, but if you mean calls to #delegate, no: that just defines a method
[09:39:27] Cork: yup that is what i meant
[09:41:26] apeiros: Cork: you could patch #delegate to record delegations. it's not necessarily accurate though, since methods can be overridden any time.
[09:42:35] Cork: i'm trying to figure out a way to detect loop delegation (delegate from one model delegating to a specialy crafted method that in some cases can point back to the same delegate)
[09:43:52] apeiros: you'll get a stack level too deep error if you use one of those :)
[09:43:58] Cork: exactly :)
[09:44:08] apeiros: well, then you found it ;-p
[09:45:11] Cork: ah, that will work :)
[09:45:28] Cork: checking if instance.attribute_names contains the name :)
[09:45:49] jhfisc: has joined #RubyOnRails
[09:46:39] Sigyn: has joined #RubyOnRails
[09:48:07] noob_on_rails: could this be done in a better way ? https://gist.github.com/frcake/d524c1a77b1e788f666079aad604f5f2
[09:49:14] noob_on_rails: i have records with an id field(did) that are persistent to the DB , i also get a JSON response from an api with more attributes , which i don't want to persist in my db , is this the correct way to do it if i want them to be served in an index like fashion ?
[09:49:44] Cork: noob_on_rails: i would recommend having a look at active_resource
[09:50:54] umaaji: has joined #RubyOnRails
[09:51:37] noob_on_rails: Cork: this looks awesome , you can have a model directly mapped to an API with REST
[09:51:41] bronson: has joined #RubyOnRails
[09:51:45] noob_on_rails: but can this be done in a mixed way ?
[09:51:51] DoubleMalt: has joined #RubyOnRails
[09:52:00] Cork: you can have it as a relation and delegate columns
[09:52:31] kn-928: has joined #RubyOnRails
[09:53:41] noob_on_rails: ummm , didn't quite get that
[09:54:47] Cork: noob_on_rails: https://mensfeld.pl/2014/08/activeresource-relations-a-bit-of-magic-to-make-it-look-and-feel-more-like-activemodel-relations/
[09:55:20] Cork: then you can delegate ex lat from Vessel to VesselResource
[09:57:08] noob_on_rails: ok , off to test it! thanks !
[10:03:54] pwnd_nsfw: has joined #RubyOnRails
[10:14:04] kitsuneyo: has joined #RubyOnRails
[10:15:23] jhfisc: has joined #RubyOnRails
[10:15:39] kitsuneyo: has joined #RubyOnRails
[10:21:27] noob_on_rails: Cork: while the api responds fine to curl -X GET http://localhost:4567/modem/234
[10:21:39] noob_on_rails: when i hit with Modem.find(234) i get 404 :(
[10:22:00] noob_on_rails: is there any way i can see the HTTP Request generated so i can troubleshoot
[10:25:52] kitsuneyo: has joined #RubyOnRails
[10:27:44] jhfisc: has joined #RubyOnRails
[10:29:58] stamina: has joined #RubyOnRails
[10:32:37] noob_on_rails: or maybe i can't run the command from console :I
[10:36:11] hahuang65: has joined #RubyOnRails
[10:36:26] quazimodo: has joined #RubyOnRails
[10:42:10] jhfisc: has joined #RubyOnRails
[10:42:31] hfp_work: has joined #RubyOnRails
[10:46:09] hahuang65: has joined #RubyOnRails
[10:48:35] jhfisc: has joined #RubyOnRails
[10:51:23] jhfisc: has joined #RubyOnRails
[10:56:58] jhfisc: has joined #RubyOnRails
[10:57:57] apparition47: has joined #RubyOnRails
[10:58:40] gregf_: has joined #RubyOnRails
[11:04:10] vedu: noob_on_rails: that probably means there is no modem with id 234
[11:05:10] vedu: and in the logs you can see the request path, HTTP verb, and params (as a hash)
[11:05:16] Cork: noob_on_rails: it has the "wrong" path
[11:05:33] Cork: noob_on_rails: resources should be plural
[11:05:50] Cork: you can override this in the active resource model
[11:06:11] Ergo: has joined #RubyOnRails
[11:06:50] Cork: (the correct path for restful would be /modems/123)
[11:08:36] vedu: Cork: nice catch :)
[11:09:47] Cork: vedu: thx :)
[11:12:07] DTZUZO: has joined #RubyOnRails
[11:20:51] kitsuneyo: Hi. I have an array `['foo', 'bar']`. I want to turn it into a hash like `{ foo: object.foo, bar: object.bar }`. What's the best method?
[11:27:03] tbuehlmann_: kitsuneyo: there might be a better one, but this comes to my mind first: array.each_with_object({}) { |item, hash| hash[item.to_sym] = object.public_send(item) }
[11:28:13] jhfisc: has joined #RubyOnRails
[11:30:03] kitsuneyo: Thanks tbuehlmann_, after some reading I have this: `Hash[arr.collect { |v| [v.to_sym, public_send("object.#{v}")] }]`
[11:30:27] kitsuneyo: where arr is my array
[11:33:02] kitsuneyo: in practice, arr.collect { |v| [v.to_sym, object.send(v)] }] works
[11:38:27] jhfisc: has joined #RubyOnRails
[11:38:40] jottr: has joined #RubyOnRails
[11:38:51] kn-928: has joined #RubyOnRails
[11:45:26] jhfisc: has joined #RubyOnRails
[11:53:49] DTZUZO: has joined #RubyOnRails
[11:56:15] Ergo: has joined #RubyOnRails
[11:56:43] jhfisc: has joined #RubyOnRails
[11:56:51] username: has joined #RubyOnRails
[12:02:27] jhfisc: has joined #RubyOnRails
[12:05:18] jhfisc: has joined #RubyOnRails
[12:07:12] laphoraig92: has joined #RubyOnRails
[12:14:28] bronson: has joined #RubyOnRails
[12:14:33] jhfisc: has joined #RubyOnRails
[12:17:00] xall: has joined #RubyOnRails
[12:25:53] jhfisc: has joined #RubyOnRails
[12:32:27] jhfisc: has joined #RubyOnRails
[12:44:29] jhfisc: has joined #RubyOnRails
[12:46:57] hahuang65: has joined #RubyOnRails
[12:48:14] cabotto: has joined #RubyOnRails
[12:53:58] kitsuneyo: has joined #RubyOnRails
[12:55:47] jhfisc: has joined #RubyOnRails
[12:55:50] noob_on_rails: Cork oh i see that's cool thanks :) they have /modem/:id for some weird reason
[12:57:22] noob_on_rails: Cork: also , the active resource expects a somewhat structured response , where this api returns stuff that active resource doesnt "like" for the direct connection to happen
[12:57:27] noob_on_rails: can i massage the data elsewhere ?
[13:03:55] maryo: has joined #RubyOnRails
[13:09:03] jhfisc: has joined #RubyOnRails
[13:09:15] crst: has joined #RubyOnRails
[13:10:51] crst: Hi, where can I find an overview of the {things} in: rails g Model name:{thing} ? :D
[13:13:56] alfiemax: has joined #RubyOnRails
[13:14:38] bronson: has joined #RubyOnRails
[13:14:45] Cork: noob_on_rails: yes you can, somewhat
[13:14:55] ur5us: has joined #RubyOnRails
[13:16:48] crst: Nevermind, found it: https://stackoverflow.com/questions/4384284/rails-generates-model-fieldtype-what-are-the-options-for-fieldtype#4384340 it's called table definitions
[13:17:20] Cork: noob_on_rails: been looking around for a up to date documentation of the lib (it used to be a part of rails)
[13:17:28] Cork: but this is the best i can find right now, and it isn't much http://www.rubydoc.info/gems/activeresource/4.0.0/frames
[13:17:52] noob_on_rails: many people have stopped using active resource in favor of HTTParty and stuff like that tho
[13:18:01] Cork: and i don't remember what one did to modify the response structure
[13:18:14] noob_on_rails: yea i've read the documentation but it's a bit generic
[13:18:24] Cork: we use it a lot here, but we build the servers to be compatible with it
[13:18:44] noob_on_rails: Cork , yea , i figured if i could have the control over the response
[13:18:48] noob_on_rails: it would be great!
[13:18:57] noob_on_rails: but for now im playing with HTTParty
[13:19:07] noob_on_rails: after the failed try
[13:19:17] noob_on_rails: ill look deeper tho
[13:20:01] jhfisc: has joined #RubyOnRails
[13:29:56] jhfisc: has joined #RubyOnRails
[13:37:59] xco: has joined #RubyOnRails
[13:38:34] xco: hi. is there a way to do “rake routes XXX” where XXX is the routes for just one resource? i don’t want to view all routes for all resources
[13:42:35] defsdoor: use the grep luke
[13:43:09] Cork: xco: rake routes -c <controller>
[13:43:27] Cork: or -g for a pattern match
[13:43:31] Jameser: has joined #RubyOnRails
[13:45:19] xco: Cork: works for me. thank you :)
[13:50:17] chouhoulis: has joined #RubyOnRails
[14:06:24] ravster: has joined #RubyOnRails
[14:22:17] jhfisc: has joined #RubyOnRails
[14:25:30] xall: has joined #RubyOnRails
[14:27:05] cwailes: has joined #RubyOnRails
[14:27:45] conta: has joined #RubyOnRails
[14:29:40] cwailes: I'm having some trouble installing a Ruby on Rails app. I've got it running now, but when I try and upload a file one of the models appears to fail during a call to `self.save!`. The log prints the following message, throws an exception, and then control flow exits outside of the model: `bin/rails: No such file or directory - file`
[14:30:12] cwailes: The server is started using the `bundle exec rails serve` command.
[14:30:30] cwailes: There is a bin/ directory in the application root, and it contains a `rails` file.
[14:30:46] cwailes: Rails version 4.2.1.
[14:32:39] hive-mind: has joined #RubyOnRails
[14:35:28] chouhoulis: has joined #RubyOnRails
[14:37:38] chouhoulis: has joined #RubyOnRails
[14:42:02] cwailes: has joined #RubyOnRails
[14:43:30] cwailes: I'm not sure if I was registered when I sent my last message. Could anyone let me know if they recently saw me post something so I don't spam the channel?
[14:45:45] jhfisc: has joined #RubyOnRails
[14:47:47] hahuang65: has joined #RubyOnRails
[14:48:22] theunraveler: has joined #RubyOnRails
[14:48:39] srinidhi: has joined #RubyOnRails
[14:51:32] jhfisc: has joined #RubyOnRails
[15:00:19] mustmodify: has joined #RubyOnRails
[15:01:54] NoGodDamnIdea: has joined #RubyOnRails
[15:03:17] gusrub: has joined #RubyOnRails
[15:04:47] jhfisc: has joined #RubyOnRails
[15:08:46] arup_r: has joined #RubyOnRails
[15:12:27] IFrank00: has joined #RubyOnRails
[15:15:48] bronson: has joined #RubyOnRails
[15:16:35] tekk: has joined #RubyOnRails
[15:19:23] jmay: has joined #RubyOnRails
[15:22:26] crst: has joined #RubyOnRails
[15:23:04] cagomez: has joined #RubyOnRails
[15:24:35] jhfisc: has joined #RubyOnRails
[15:27:52] kn-928: has joined #RubyOnRails
[15:28:29] jhfisc: has joined #RubyOnRails
[15:29:26] mustmodify: has left #RubyOnRails: ()
[15:31:46] xco: has joined #RubyOnRails
[15:36:37] [Butch]: has joined #RubyOnRails
[15:36:57] dionysus69: has joined #RubyOnRails
[15:37:35] IFrank00: has joined #RubyOnRails
[15:39:05] arup_r: has joined #RubyOnRails
[15:39:39] arup_r: I am getting error ActiveModel::ForbiddenAttributesError - ActiveModel::ForbiddenAttributesError: while I added that attributes using #merge method. Can anyone help me to fix this? Here is the code https://gist.github.com/aruprakshit/eb8468b230eb65332679dc87c5d2f318
[15:42:43] troys: has joined #RubyOnRails
[15:43:22] et09: has joined #RubyOnRails
[15:43:58] brent__: has joined #RubyOnRails
[15:47:07] username: has joined #RubyOnRails
[15:47:38] elaptics: has joined #RubyOnRails
[15:50:39] cwailes: has left #RubyOnRails: ("Good Bye")
[15:51:21] xcesariox: has joined #RubyOnRails
[16:00:56] theunrav_: has joined #RubyOnRails
[16:01:27] jottr: has joined #RubyOnRails
[16:02:35] jamal7: has joined #RubyOnRails
[16:02:56] xco: has joined #RubyOnRails
[16:06:28] username1: has joined #RubyOnRails
[16:08:22] username1: is there a way to get memcached to automatically remove old cache keys when there is a cache miss and a new cache key is generated, rather than expiring by time?
[16:09:16] username1: or do we need to manually call Rails.cache.delete on the old entry
[16:17:01] jhfisc: has joined #RubyOnRails
[16:17:02] elnner: you should not worry about that, even if you don't set an auto expiry time, orphan keys will be evicted and removed from memory to free space for keys that are used, memcahced manages that
[16:20:11] boxmein: is there a way to batch load has_many with conditions
[16:20:28] boxmein: say, if an actuator has_many reports, but we only care about the last report over say ~10 actuators
[16:20:54] xco_: has joined #RubyOnRails
[16:20:55] boxmein: I could do it with a raw select I guess but is there a more rails way of doing it
[16:23:38] username1: elnner: oh okay, nice
[16:24:17] username1: docs mention that, but dont give much detail
[16:26:08] mtkd: has joined #RubyOnRails
[16:29:08] jhfisc: has joined #RubyOnRails
[16:29:41] armyriad: has joined #RubyOnRails
[16:33:59] knight33: has joined #RubyOnRails
[16:34:51] mcr-credil: has joined #RubyOnRails
[16:39:33] jamal7: has joined #RubyOnRails
[16:45:02] andywww: has joined #RubyOnRails
[16:48:36] hahuang65: has joined #RubyOnRails
[16:53:26] mikepack: has joined #RubyOnRails
[16:53:55] jhfisc: has joined #RubyOnRails
[16:56:45] xall: has joined #RubyOnRails
[16:58:05] hahuang65: has joined #RubyOnRails
[16:59:37] one_zero: has joined #RubyOnRails
[16:59:48] jhfisc: has joined #RubyOnRails
[17:00:27] theunraveler: has joined #RubyOnRails
[17:01:49] jmay: has joined #RubyOnRails
[17:05:48] jhfisc: has joined #RubyOnRails
[17:06:17] jamal7: has joined #RubyOnRails
[17:07:14] ryandv: has joined #RubyOnRails
[17:08:04] ryandv: Does capybara attempt to start a new HTTP server every time a new example is run?
[17:08:42] ryandv: if so, how can I configure it to only start one server for the duration of the entire test suite?
[17:09:47] Or1on: has joined #RubyOnRails
[17:10:17] kapil___: has joined #RubyOnRails
[17:11:12] andywww: has joined #RubyOnRails
[17:11:46] jhfisc: has joined #RubyOnRails
[17:15:11] et09: has joined #RubyOnRails
[17:16:52] keegnotrub: has joined #RubyOnRails
[17:17:07] bronson: has joined #RubyOnRails
[17:19:58] jhfisc: has joined #RubyOnRails
[17:22:35] DrYockel: has joined #RubyOnRails
[17:24:21] beanHolez: has joined #RubyOnRails
[17:31:39] kies: has joined #RubyOnRails
[17:31:59] ResidentBiscuit: has joined #RubyOnRails
[17:32:27] ResidentBiscuit: has joined #RubyOnRails
[17:33:33] andywww: has joined #RubyOnRails
[17:34:01] guacamole: has joined #RubyOnRails
[17:35:30] hahuang65: has joined #RubyOnRails
[17:35:43] jhfisc: has joined #RubyOnRails
[17:37:26] jottr: has joined #RubyOnRails
[17:37:50] andywww: has joined #RubyOnRails
[17:39:39] kn-928: has joined #RubyOnRails
[17:45:02] guacamole: has joined #RubyOnRails
[17:45:24] bphogan: has left #RubyOnRails: ()
[17:46:58] beilabs: has joined #RubyOnRails
[17:50:03] jhfisc: has joined #RubyOnRails
[17:55:11] jhfisc: has joined #RubyOnRails
[17:59:00] mikecmpbll: has joined #RubyOnRails
[17:59:57] xco: has joined #RubyOnRails
[18:00:46] jhfisc: has joined #RubyOnRails
[18:07:31] KeyJoo: has joined #RubyOnRails
[18:14:30] jhfisc: has joined #RubyOnRails
[18:18:07] segy: has joined #RubyOnRails
[18:28:07] jhfisc: has joined #RubyOnRails
[18:32:53] rubylegend2092: has joined #RubyOnRails
[18:33:46] rubylegend2092: I really need help, guys. My Ajax request to add new post after a form submission is not working.
[18:38:39] s2013: has joined #RubyOnRails
[18:42:16] rubylegend2092: In my create.js.rb, the form renders perfectly fine, and resets after submitting. $('#post-form).html('<%= escape_javascript(render 'posts/form') %>');
[18:43:15] rubylegend2092: $('#post-form).val(' ');
[18:45:17] kn-928: has joined #RubyOnRails
[18:46:32] rubylegend2092: The issue is, I can't render my templating method to refresh the posts. <% @posts.each do |post| %> <%= render partial: 'posts/#{post.post_type'}', locals: {post: post } %>
[18:46:44] dionysus69: has joined #RubyOnRails
[18:50:24] jhfisc: has joined #RubyOnRails
[18:51:39] xco: has joined #RubyOnRails
[18:52:32] dviola: has joined #RubyOnRails
[18:55:36] jhfisc: has joined #RubyOnRails
[18:58:43] xco: can someone please look at this for me? https://gist.github.com/siaw23/c93863f141f45b0f128c402bc877f1c5
[19:01:03] jmay: has joined #RubyOnRails
[19:01:56] jhfisc: has joined #RubyOnRails
[19:02:41] Aherin: has joined #RubyOnRails
[19:05:48] jhfisc: has joined #RubyOnRails
[19:09:31] mlt-: xco: uhm... https://stackoverflow.com/q/18661777/673826
[19:10:06] xco: mlt-: thanks. not what i wanted but figured it out myself
[19:11:14] jhfisc: has joined #RubyOnRails
[19:14:36] conta: has joined #RubyOnRails
[19:15:59] chouhoulis: has joined #RubyOnRails
[19:16:44] gambl0re: has joined #RubyOnRails
[19:17:45] jhfisc: has joined #RubyOnRails
[19:17:46] bronson: has joined #RubyOnRails
[19:22:07] cwailes: has joined #RubyOnRails
[19:23:52] cwailes: The model of an app that I'm trying to use appears to be erroring out when `self.save!` is called. The only message I get in the log is `bin/rails: No such file or directory - file`. The thing is, the app root has a bin/rails in it. Does anyone know why this might be happening?
[19:24:53] srinidhi: has joined #RubyOnRails
[19:26:14] dviola: has joined #RubyOnRails
[19:27:45] jhfisc: has joined #RubyOnRails
[19:33:46] jhfisc: has joined #RubyOnRails
[19:40:43] Ergo: has joined #RubyOnRails
[19:42:02] npgm: has joined #RubyOnRails
[19:43:33] xall: has joined #RubyOnRails
[19:44:04] jhfisc: has joined #RubyOnRails
[19:54:46] jhfisc: has joined #RubyOnRails
[19:55:30] cam27: has joined #RubyOnRails
[19:59:42] guacamole: has joined #RubyOnRails
[20:00:46] jhfisc: has joined #RubyOnRails
[20:02:32] dionysus69: has joined #RubyOnRails
[20:04:03] zacts: has joined #RubyOnRails
[20:05:21] cam27: has left #RubyOnRails: ()
[20:12:59] rikkipitt: has joined #RubyOnRails
[20:13:32] rikkipitt: active_model_serializers: is it possible to know the parent collection from the serializer?
[20:18:44] cagomez: has joined #RubyOnRails
[20:20:05] bruno-: has joined #RubyOnRails
[20:22:03] username1: has joined #RubyOnRails
[20:22:21] username1: has joined #RubyOnRails
[20:27:56] jhfisc: has joined #RubyOnRails
[20:28:25] jottr: has joined #RubyOnRails
[20:28:55] brent__: has joined #RubyOnRails
[20:30:35] cam27: has joined #RubyOnRails
[20:33:51] jhfisc: has joined #RubyOnRails
[20:40:02] andywww: has joined #RubyOnRails
[20:43:32] crankharder: has joined #RubyOnRails
[20:46:38] jhfisc: has joined #RubyOnRails
[20:50:45] jhfisc: has joined #RubyOnRails
[20:56:04] jhfisc: has joined #RubyOnRails
[21:00:40] gambl0re: has joined #RubyOnRails
[21:07:27] rakm: has joined #RubyOnRails
[21:12:09] jhfisc: has joined #RubyOnRails
[21:13:45] brent__: has joined #RubyOnRails
[21:14:22] jmay: has joined #RubyOnRails
[21:14:36] arBmind: has joined #RubyOnRails
[21:19:11] bronson: has joined #RubyOnRails
[21:24:49] jhfisc: has joined #RubyOnRails
[21:34:30] crst: has joined #RubyOnRails
[21:36:25] bphogan: has joined #RubyOnRails
[21:38:22] crst: Hi, pls help. I'm looking for this on google for the last our without success and this i.e. is not working: self.distance = self.odometer.where("id > ?", id).first - self.odometer It should simply subtract the value from the entry of the next record
[21:41:49] matthewd: crst: You're going to need to do better than "not working"
[21:42:39] mlt-: crst: If I had PostgreSQL I would use pure SQL and lag()
[21:43:27] mlt-: if you need difference in column values between adjacent ordered rows
[21:44:54] crst: mlt-: you mean this can be done in psql alone? that would be a good alternative.
[21:45:08] mlt-: not psql, but connection.exec_query()
[21:45:44] mlt-: if that is what you want, i.e. adjacent column value from adjacent row
[21:45:53] bphogan: crst: your query looks like self.odometer is another object. Don't you want to subtract a value on self.odometer rather than the object itself? Or am I reading it wrong?
[21:46:29] mlt-: bphogan: I think it was pseudo code :-)
[21:47:24] jhfisc: has joined #RubyOnRails
[21:47:40] mlt-: First record with ID next to current, sounds like lead() from PostgreSQL
[21:47:47] bphogan: yea I'd recommend doing this with SQL instead :)
[21:49:03] crst: It's from here https://stackoverflow.com/a/25666841
[21:49:34] matthewd: crst: That looks wildly different from what you pasted
[21:49:45] matthewd: crst: And you still haven't described what's actually going wrong with your current code
[21:50:42] crst: matthewd: undefined method `where' for 287125:Integer
[21:51:07] mlt-: remove .odometer
[21:51:50] crst: mlt-: undefined method `where' for #<Topup:0x007fd58dc28750>
[21:51:55] cagomez: has joined #RubyOnRails
[21:52:12] mlt-: well... I mean you need to find an object... sorry, not messing with self
[21:53:21] mlt-: MyModel.find_by 'id>?', id
[21:53:52] mlt-: crst: you need .odometer from another instance
[21:53:59] crst: This is the model https://pastebin.com/G45dpkNj
[21:54:12] matthewd: How about we do what the quoted SO answer says
[21:54:29] mlt-: then next.odometer - odometer should do it
[21:55:32] jhfisc: has joined #RubyOnRails
[21:56:15] crst: then I get: topup.rb:23: void value expression self.distance = next.odometer - self.odometer ^
[21:56:47] matthewd: next is a keyword
[21:57:02] mlt-: matthewd: self.next ?
[21:57:26] mlt-: ACTION loves fortran
[21:57:49] mlt-: f%^k keywords
[22:01:09] jmay: has joined #RubyOnRails
[22:01:57] jhfisc: has joined #RubyOnRails
[22:02:26] crst: matthewd: do i need to do something specific in the controller as well, because I still get an error?
[22:03:13] mlt-: what error?
[22:03:23] crst: NoMethodError in TopupsController#update
[22:04:17] mlt-: You got to define it :-) whatever you want to update
[22:06:19] crst: well, the update works, except I try to calculate the distance with the next record, whatever I try.
[22:06:38] mlt-: It clearly says controller has no such method. How can it work?
[22:06:58] mlt-: Did you restart your server?
[22:07:13] mlt-: I presume you do have def update in your controller
[22:07:20] matthewd: mlt-: No, it doesn't say that. We still haven't seen an actual error message.
[22:07:52] mlt-: matthewd: I think "<crst> NoMethodError in TopupsController#update" counts
[22:08:50] crst: I also got this: private method `next' called for #<Topup:0x007ffdefb08b88> And I commented private, too
[22:08:59] guacamole: has joined #RubyOnRails
[22:09:13] matthewd: ^ actual message
[22:10:35] mlt-: Can I use labels and autogenerated fixture ID with self-referencing model? Somehow it assigns zeros.
[22:10:50] crst: commented private gives me this: undefined method `-' for #<Topup:0x007ffdeab09380>
[22:11:42] matthewd: crst: You're trying to subtract from a Topup instance instead of a number. What does your code currently look like?
[22:11:57] mlt-: show your line 23
[22:12:06] cwailes: has left #RubyOnRails: ()
[22:12:08] mlt-: self.distance = ... ?
[22:12:34] crst: matthewd: https://pastebin.com/Zqd2yEpc
[22:12:36] mlt-: self.distance = self.next - odometer
[22:12:45] matthewd: crst: And now think about why that's wrong
[22:13:31] matthewd: mlt-: I would've guessed yes, but I can also believe no.
[22:13:31] mlt-: self.next.odometer
[22:14:15] crst: loooooolll
[22:14:19] mlt-: also! put private back
[22:14:30] mlt-: you have before_save filter
[22:14:45] mlt-: no need to call it explicitly from outside
[22:15:01] matthewd: mlt-: But you can't call a private method with an explicit self.
[22:15:16] mlt-: bummer:-)
[22:15:18] matthewd: mlt-: .. and you can't call a keyword-named method without an explicit self. :)
[22:15:32] mlt-: there got to be a way aside from renaming
[22:15:34] matthewd: (so I'd just rename the method)
[22:15:49] matthewd: There's send, but that's more awful
[22:16:33] mlt-: name them _next and _previous
[22:17:38] crst: mlt-: what should that do?
[22:18:06] jmay: has joined #RubyOnRails
[22:18:11] mlt-: what matthewd suggested so you can have a cake and eat it too... I mean have private and don't use self.
[22:18:42] mlt-: I suppose many ppl are okay prepending _ to private methods... in some languages
[22:19:30] crst: mlt-: like this? https://pastebin.com/eNewLFvX
[22:20:07] mlt-: you have extra dash on 13
[22:20:18] mlt-: and remove self. from 23
[22:20:18] crst: - before _next is typo
[22:21:25] mlt-: self.distance = _next.odometer - odometer ... I'm not sure if you got to have - @odometer ... or just keep last self.
[22:21:32] crst: nice! thank you guys so much!
[22:24:36] mlt-: so... there is no magic with fixtures when using labels to reference other models? It is just a hash? So if I assign ID explicitly, I can't use label elsewhere anymore? What a bummer!
[22:25:44] gambl0re: has joined #RubyOnRails
[22:25:51] crst: This is my google: I even went beyond page 10 https://imgur.com/a/YI2bu
[22:26:48] gambl0re: has joined #RubyOnRails
[22:26:50] mlt-: uhm... I feel like first result looks relevant ) You got lots of patience for 10 pages
[22:27:52] crst: yeah looks relevant but didn't help :D
[22:27:55] gambl0re: has joined #RubyOnRails
[22:28:43] gambl0re: has joined #RubyOnRails
[22:33:02] mlt-: ACTION figured out his fixture issues
[22:35:15] FastJack: has joined #RubyOnRails
[22:40:05] rubylegend2092: has joined #RubyOnRails
[22:42:06] brendan-: has joined #RubyOnRails
[22:42:46] AntiSpamMeta: has joined #RubyOnRails
[22:48:40] s2013: has joined #RubyOnRails
[22:50:04] bronson: has joined #RubyOnRails
[22:51:04] mlt-: How to write defaults for fixture to get something like attr: <%= ActiveRecord::FixtureSet.identify $LABEL %> ?
[22:51:38] mlt-: Is it even possible to interpolate in a such way?
[22:52:11] mlt-: actually any unique integer would do though...
[22:52:38] mlt-: I mean "unique"
[22:53:37] Radar: GOOD MORNING
[22:54:14] Radar: crst: hi. https://github.com/radar/by_star has next/previous
[22:54:32] Radar: I believe it works by created_at field instead of ID.
[22:55:42] mlt-: Radar: is it adjustable?
[22:55:52] mlt-: If I had completed_at, can that be used?
[22:56:23] aclark: has joined #RubyOnRails
[22:57:09] crst: Hi Radar, is that from yourself? I think I stubled upon this briefly while searching.
[23:01:50] xco: has joined #RubyOnRails
[23:05:46] xco: has joined #RubyOnRails
[23:06:29] mlt-: Apparently I'm not the only one wanting $LABEL within ERB defaults for fixtures... https://stackoverflow.com/q/45008066/673826
[23:23:35] andywww: has joined #RubyOnRails
[23:31:33] rakm: has joined #RubyOnRails
[23:36:34] beilabs: has joined #RubyOnRails
[23:44:22] alfiemax: has joined #RubyOnRails
[23:46:55] dviola: has joined #RubyOnRails