« Back to channel list

#RubyOnRails - 10 August 2017

« Back 1 day Forward 1 day »
[00:11:12] jhfisc: has joined #RubyOnRails
[00:16:06] GodFather: has joined #RubyOnRails
[00:18:10] cagomez: has joined #RubyOnRails
[00:21:33] jhfisc: has joined #RubyOnRails
[00:30:55] ascarter: has joined #RubyOnRails
[00:37:50] chimkan: has joined #RubyOnRails
[00:38:31] jackhum: has joined #RubyOnRails
[00:44:31] chouhoulis: has joined #RubyOnRails
[00:45:16] rakm: has joined #RubyOnRails
[00:47:42] K3rber0s: has joined #RubyOnRails
[00:55:25] jackhum: has joined #RubyOnRails
[00:55:26] jphase: has joined #RubyOnRails
[00:59:51] ocpysh: has joined #RubyOnRails
[01:02:03] sevenseacat: has joined #RubyOnRails
[01:03:12] RahulT: has joined #RubyOnRails
[01:07:38] kies: has joined #RubyOnRails
[01:08:02] jphase: has joined #RubyOnRails
[01:14:27] jhfisc: has joined #RubyOnRails
[01:24:34] mercwithamouth: has joined #RubyOnRails
[01:24:51] jhfisc: has joined #RubyOnRails
[01:33:33] quirkycoders: has joined #RubyOnRails
[01:40:18] ascarter: has joined #RubyOnRails
[01:42:31] jhfisc: has joined #RubyOnRails
[01:47:28] jhfisc: has joined #RubyOnRails
[01:50:19] Jameser: has joined #RubyOnRails
[01:52:12] Rodya_: has joined #RubyOnRails
[01:54:43] mercwithamouth: has joined #RubyOnRails
[01:55:23] irishfromua: has joined #RubyOnRails
[02:06:52] jhfisc: has joined #RubyOnRails
[02:11:13] chouhoulis: has joined #RubyOnRails
[02:12:31] GodFather: has joined #RubyOnRails
[02:17:35] SteenJobs_: has joined #RubyOnRails
[02:18:11] jphase: has joined #RubyOnRails
[02:19:32] Jameser: has joined #RubyOnRails
[02:21:30] jhfisc: has joined #RubyOnRails
[02:27:11] jhfisc: has joined #RubyOnRails
[02:31:30] lessless: has joined #RubyOnRails
[02:41:22] cam27: has joined #RubyOnRails
[02:43:23] jphase: has joined #RubyOnRails
[02:43:58] muzik: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[02:46:42] ascarter: has joined #RubyOnRails
[02:48:00] SteenJobs_: has joined #RubyOnRails
[02:49:45] SteenJobs_: has joined #RubyOnRails
[02:54:44] jhfisc: has joined #RubyOnRails
[02:56:16] jphase: has joined #RubyOnRails
[02:57:13] RahulT: has joined #RubyOnRails
[02:57:50] jtrain1: has joined #RubyOnRails
[02:58:21] jtrain1: How do I start using Ruby on rails?
[02:59:09] jtrain1: Linux Mint 18.2 - I downloaded Rails but I don't know how to find it.
[03:05:33] havenwood: jtrain1: Have you followed these steps yet?: http://guides.rubyonrails.org/getting_started.html#installing-rails
[03:06:54] havenwood: jtrain1: What's printed when you run?: rails -v
[03:08:51] jhfisc: has joined #RubyOnRails
[03:12:33] jphase: has joined #RubyOnRails
[03:14:44] chouhoulis: has joined #RubyOnRails
[03:17:06] jhfisc: has joined #RubyOnRails
[03:17:29] jtrain1: sorry, hashing it out with Linuxmint-help chat
[03:18:07] jtrain1: getting back on track, checking software version and install success now
[03:24:49] jhfisc: has joined #RubyOnRails
[03:26:40] jphase: has joined #RubyOnRails
[03:28:50] jhfisc: has joined #RubyOnRails
[03:30:14] jphase: has joined #RubyOnRails
[03:33:36] jhfisc: has joined #RubyOnRails
[03:35:27] jphase: has joined #RubyOnRails
[03:37:20] jphase: has joined #RubyOnRails
[03:37:29] sevenseacat: has joined #RubyOnRails
[03:49:10] Jameser: has joined #RubyOnRails
[03:53:24] Jameser: has joined #RubyOnRails
[03:53:31] ascarter: has joined #RubyOnRails
[03:58:58] beilabs: has joined #RubyOnRails
[04:01:09] RahulT: has joined #RubyOnRails
[04:01:42] beilabs_: has joined #RubyOnRails
[04:04:25] jphase: has joined #RubyOnRails
[04:05:32] SteenJobs_: has joined #RubyOnRails
[04:08:11] jphase_: has joined #RubyOnRails
[04:08:38] guacamole: has joined #RubyOnRails
[04:09:13] Or1on: has joined #RubyOnRails
[04:16:18] Jameser: has joined #RubyOnRails
[04:19:48] umaaji: has joined #RubyOnRails
[04:32:35] srinidhi: has joined #RubyOnRails
[04:32:52] jhfisc: has joined #RubyOnRails
[04:34:48] KeyJoo: has joined #RubyOnRails
[04:38:49] jhfisc: has joined #RubyOnRails
[04:41:33] jhfisc: has joined #RubyOnRails
[04:47:26] jhfisc: has joined #RubyOnRails
[04:52:20] quazimodo: has joined #RubyOnRails
[04:53:53] RahulT: has joined #RubyOnRails
[05:00:04] ascarter: has joined #RubyOnRails
[05:00:25] irishfromua: has joined #RubyOnRails
[05:02:38] jhfisc: has joined #RubyOnRails
[05:08:13] jhfisc: has joined #RubyOnRails
[05:13:59] mercwithamouth: has joined #RubyOnRails
[05:18:59] jhfisc: has joined #RubyOnRails
[05:20:16] Ryzokuken: has joined #RubyOnRails
[05:23:35] dnewkerk: has joined #RubyOnRails
[05:27:23] Jameser: has joined #RubyOnRails
[05:36:32] dionysus69: has joined #RubyOnRails
[05:36:57] hive-mind: has joined #RubyOnRails
[05:37:39] jhfisc: has joined #RubyOnRails
[05:45:17] srinidhi: has joined #RubyOnRails
[05:50:43] jphase: has joined #RubyOnRails
[05:55:49] apparition: has joined #RubyOnRails
[06:01:55] RahulT: has joined #RubyOnRails
[06:07:04] ascarter: has joined #RubyOnRails
[06:08:39] ocpysh: has joined #RubyOnRails
[06:09:46] kies: has joined #RubyOnRails
[06:11:12] jhfisc: has joined #RubyOnRails
[06:23:33] lessless: has joined #RubyOnRails
[06:24:08] jhfisc: has joined #RubyOnRails
[06:42:19] arBmind: has joined #RubyOnRails
[06:48:59] conta: has joined #RubyOnRails
[06:53:01] jhfisc: has joined #RubyOnRails
[06:54:00] fugee: has joined #RubyOnRails
[06:54:16] fugee: how do i link to an image on another app on the server
[06:58:10] ndr0s: has joined #RubyOnRails
[07:03:26] srinidhi: has joined #RubyOnRails
[07:07:45] Ryzokuken: has joined #RubyOnRails
[07:07:51] jhfisc: has joined #RubyOnRails
[07:08:38] Rodya_: has joined #RubyOnRails
[07:13:21] jhfisc: has joined #RubyOnRails
[07:13:48] ascarter: has joined #RubyOnRails
[07:17:05] jhfisc: has joined #RubyOnRails
[07:17:38] SteenJobs_: has joined #RubyOnRails
[07:19:46] ocpysh: has joined #RubyOnRails
[07:20:19] conta: Hey guys, I started doing rails 5 app with webpacker and vuejs. I will use vuejs for small components, not whole UI. When looking for framework, I should use VueJS framework, or some general like bootstrap? Anyone did sth similar?
[07:23:00] ocpysh: has joined #RubyOnRails
[07:23:40] jhfisc: has joined #RubyOnRails
[07:28:01] arBmind: has joined #RubyOnRails
[07:34:30] jhfisc: has joined #RubyOnRails
[07:39:56] jhfisc: has joined #RubyOnRails
[07:41:27] ocpysh: has joined #RubyOnRails
[07:44:24] jhfisc: has joined #RubyOnRails
[07:44:58] lessless: has joined #RubyOnRails
[07:46:17] quirkycoders: has joined #RubyOnRails
[07:46:38] ocpysh: has joined #RubyOnRails
[07:47:10] jhfisc: has joined #RubyOnRails
[07:52:33] jhfisc: has joined #RubyOnRails
[07:54:18] ams__: has joined #RubyOnRails
[07:57:15] jhfisc: has joined #RubyOnRails
[08:00:53] jhfisc: has joined #RubyOnRails
[08:01:52] Ryzokuken: has joined #RubyOnRails
[08:02:51] mikecmpbll: has joined #RubyOnRails
[08:02:52] ur5us: has joined #RubyOnRails
[08:03:05] ocpysh: has joined #RubyOnRails
[08:03:59] jhfisc: has joined #RubyOnRails
[08:05:07] brent__: has joined #RubyOnRails
[08:07:00] quirkycoders: has joined #RubyOnRails
[08:20:12] jhfisc: has joined #RubyOnRails
[08:20:51] ascarter: has joined #RubyOnRails
[08:22:24] futilegames: has joined #RubyOnRails
[08:22:46] TvL2386: hey guys, with content_for(:bla) you can insert something in the view, but how do you actually set :bla to some value?
[08:23:50] futilegames: has left #RubyOnRails: ()
[08:25:46] TvL2386: ah, in your action view... got it
[08:27:50] quirkycoders: has joined #RubyOnRails
[08:28:31] jphase: has joined #RubyOnRails
[08:32:41] Terens: has joined #RubyOnRails
[08:37:07] dionysus69: so I have a question about form remote true
[08:37:29] dionysus69: I know how to fetch the server response when using jquery with ajax .done callback
[08:38:00] dionysus69: but how do I tell submit click event to wait for response ? what's the callback for that?
[08:42:06] Terens: Does it makes sense to consume rabbitmq queue from rails ?
[08:42:22] Terens: Also if i create a microservice to consume a queue how tek heck can I scale it ?
[08:42:58] lessless: has joined #RubyOnRails
[08:43:47] quazimodo: has joined #RubyOnRails
[08:48:16] tbuehlmann_: Terens: what's the usecase?
[08:48:39] quirkycoders: has joined #RubyOnRails
[08:48:46] quazimodo: has joined #RubyOnRails
[08:48:49] Terens: I want to connect thousand of devices and send messages and control them
[08:50:07] DTZUZO: has joined #RubyOnRails
[08:52:21] ocpysh: has joined #RubyOnRails
[08:53:14] ahrs: has joined #RubyOnRails
[08:54:05] tbuehlmann_: and you need rabbitmq for that?
[08:56:06] Macaveli: has joined #RubyOnRails
[08:58:36] ocpysh: has joined #RubyOnRails
[09:09:38] quirkycoders: has joined #RubyOnRails
[09:16:39] DTZUZO: has joined #RubyOnRails
[09:18:15] Ryzokuken: has joined #RubyOnRails
[09:18:16] workmad3: has joined #RubyOnRails
[09:18:56] Ryzokuken: has joined #RubyOnRails
[09:19:19] marr: has joined #RubyOnRails
[09:27:44] ascarter: has joined #RubyOnRails
[09:29:55] Doldge: has joined #RubyOnRails
[09:36:22] jhfisc: has joined #RubyOnRails
[09:45:08] mikecmpbll: i'm battling with strong parameters and serialization. i have paramters like such: { foo: { html_options: { include_blank: "true" } } }, and my strong params are params.require(:foo).permit(html_options: [:include_blank]). in my foo model, i have serialize :html_options
[09:46:04] mikecmpbll: i'd like it to serialize as a ruby Hash though unfortunately, the serialized object is a ActionController::Parameters
[09:47:56] mikecmpbll: i assume i'll have to do some custom serialization
[09:48:46] Terens: tbuehlmann_ what else ?
[09:51:15] Quintasan: Is it possible to fool ActiveRecord into accepting accepts_nested_attributes_for when there's no association?
[09:52:13] Terens: maybe with custom attr accessor
[09:52:27] Terens: but there are issues.
[10:05:28] quirkycoders: has joined #RubyOnRails
[10:08:39] ur5us: has joined #RubyOnRails
[10:17:58] Quintasan: Jesus christ, why Rails can't have decent localization support in 2017
[10:19:03] apparition: has joined #RubyOnRails
[10:19:34] Quintasan: Anyone using globalize with accepts_nested_attributes_for :translations? I'm trying to submit translations via API but I'm getting an association mismatch for some reason
[10:19:50] Quintasan: https://github.com/globalize/globalize/issues/631
[10:20:31] shilon: has joined #RubyOnRails
[10:22:29] Ropeney: has joined #RubyOnRails
[10:22:36] tbuehlmann_: you're using the wrong param name and therefore the wrong model method. try translations_attributes instead of translations
[10:22:56] Ryzokuken: has joined #RubyOnRails
[10:24:09] tbuehlmann_: also, I think the data structure should be a hash and not an array
[10:26:38] quirkycoders: has joined #RubyOnRails
[10:32:52] dionysus69: hey I want to make a mixin out of this https://gist.github.com/11a8e361ed7815a4f39def7622465e87, I want name of anonymous_message to be variable. and also be able to pass other params for the hashes, is it possible?
[10:33:15] dionysus69: because I was thinking I could use this in pretty much every controller
[10:33:20] dionysus69: feels wrong to copy paste
[10:34:14] Ropeney: has joined #RubyOnRails
[10:34:23] ascarter: has joined #RubyOnRails
[10:35:45] jhfisc: has joined #RubyOnRails
[10:38:50] dionysus69: one more thing, I am put custom model validators in lib dir. it gets imported without require statement in one model, but it has an error in user model without the require statement. is it because devise tries to load it before lib dir gets included? or is it just a bug?
[10:39:10] srinidhi: has joined #RubyOnRails
[10:40:39] tbuehlmann_: dionysus69: have you added the lib/ directory to your autoload_paths or eager_load_paths?
[10:40:57] dionysus69: I use these custom validators in two models
[10:41:07] dionysus69: it works without require in one but not the user model
[10:41:20] conta: has joined #RubyOnRails
[10:41:35] dionysus69: config.eager_load_paths << Rails.root.join("lib")
[10:43:30] jhfisc: has joined #RubyOnRails
[10:43:47] tbuehlmann_: can you gist the validator and the models and the error?
[10:47:28] quirkycoders: has joined #RubyOnRails
[10:48:01] ocpysh: has joined #RubyOnRails
[10:54:41] shilon: has joined #RubyOnRails
[10:56:09] Ropeney: has left #RubyOnRails: ()
[11:00:21] jhfisc: has joined #RubyOnRails
[11:01:30] ocpysh: has joined #RubyOnRails
[11:08:00] quirkycoders: has joined #RubyOnRails
[11:16:31] Ergo: has joined #RubyOnRails
[11:21:11] beilabs: has joined #RubyOnRails
[11:25:11] xiljin: has joined #RubyOnRails
[11:27:08] cjk101010: has joined #RubyOnRails
[11:28:59] quirkycoders: has joined #RubyOnRails
[11:35:33] ldnunes: has joined #RubyOnRails
[11:43:15] ascarter: has joined #RubyOnRails
[11:46:40] cjk101010: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[11:49:48] quirkycoders: has joined #RubyOnRails
[11:54:04] ldnunes: has joined #RubyOnRails
[11:57:22] quazimodo: has joined #RubyOnRails
[12:00:50] lessless: has joined #RubyOnRails
[12:05:19] jhfisc: has joined #RubyOnRails
[12:06:13] ocpysh: has joined #RubyOnRails
[12:24:38] Sylario: has joined #RubyOnRails
[12:24:59] quirkycoders: has joined #RubyOnRails
[12:29:21] Or1on: has joined #RubyOnRails
[12:39:11] sevenseacat: has joined #RubyOnRails
[12:41:46] Sylario: Since I added an ember app in my rails app, guard-rspec break with errors about directory in the ember tmp files being watched
[12:42:08] Sylario: I am trying to ignore the folder, but despite many try, it does not want to ignore it
[12:42:15] Sylario: ignore /marketadmin/
[12:43:19] Sylario: ignore %r{^marketadmin/}
[12:44:13] fugee: how do i build a link with image_tag outside of the app; images located under another app on the same server
[12:52:18] ascarter: has joined #RubyOnRails
[12:57:11] dionysus69: tbuehlmann_: hey
[12:57:29] dionysus69: sorry I got a lil late on response :D here are my files https://gist.github.com/anonymous/54ff437c5f3b9f864cdd9c4fc4afa439
[12:59:04] marr: has joined #RubyOnRails
[12:59:38] quirkycoders: has joined #RubyOnRails
[13:02:41] tbuehlmann_: dionysus69: so the file is not named after the constant in it?
[13:03:40] dionysus69: I didnt declare module at all, is it necessary? but if it's necessary why does it work fine for message model?
[13:04:16] dionysus69: is it because it already got required by user model, and then it got shared?
[13:04:51] crankharder: has joined #RubyOnRails
[13:05:00] tbuehlmann_: I'd put them in different files to lib/
[13:05:13] shilon: has joined #RubyOnRails
[13:05:34] tbuehlmann_: you shouldn't need to require them then
[13:07:00] dionysus69: didnt know about that constraint, thought multiple classes per file were fine, never tried though
[13:08:01] dionysus69: tbuehlmann_: ok now it worked without require, thanks allot! :)
[13:10:59] jphase: has joined #RubyOnRails
[13:14:03] jhfisc: has joined #RubyOnRails
[13:16:06] ocpysh: has joined #RubyOnRails
[13:18:06] K3rber0s: has joined #RubyOnRails
[13:18:47] fugee: how do i build a link with image_tag outside of the app; images located under another app on the same server
[13:19:46] jhfisc: has joined #RubyOnRails
[13:20:55] ocpysh: Are there any JSR tutorials out there you would recommend?
[13:21:25] ocpysh: There isn't a lot written on the topic that's not eons old.
[13:28:41] noob_on_rails: has joined #RubyOnRails
[13:29:00] noob_on_rails: hey all , any gem for mocking api calls ? or any good way used for RoR?
[13:29:13] noob_on_rails: *api responses actually
[13:30:54] Defenestrate: has joined #RubyOnRails
[13:34:48] kapil___: has joined #RubyOnRails
[13:35:12] kapil___: anyone help me setup active admin with nested fields?
[13:37:22] lessless: has joined #RubyOnRails
[13:40:35] quirkycoders: has joined #RubyOnRails
[13:42:13] high_fiver: has joined #RubyOnRails
[13:46:49] quirkycoders: has joined #RubyOnRails
[13:52:00] fryguy: has joined #RubyOnRails
[13:57:53] quirkycoders: has joined #RubyOnRails
[14:02:08] ascarter: has joined #RubyOnRails
[14:07:02] mwlang: has joined #RubyOnRails
[14:08:08] mwlang: For years, I have always kept database.yml in .gitignore and out of the repo, but I’m working my first Heroku hosted project since ~2008 and it seems that database.yml must be checked into repo for a successful heroku deployment.
[14:08:38] apparition47: has joined #RubyOnRails
[14:08:58] mwlang: So my question: How are others that host to Heroku handle this because what I’m finding is my team’s struggling to remember to keep their local changes out so that the production relevant version stays put in the repo.
[14:11:03] chouhoulis: has joined #RubyOnRails
[14:12:16] toydestroyer: has joined #RubyOnRails
[14:13:47] Sylario: Is there an alternative to guard to trigger automatic testing?
[14:14:28] s2013: has joined #RubyOnRails
[14:16:43] matthewd: mwlang: Most of the time I think people don't actually need local changes. Next easiest option probably involves using ERb.
[14:17:55] fryguy: mwlang: use environment variables
[14:19:55] s2013: has joined #RubyOnRails
[14:20:06] beilabs: has joined #RubyOnRails
[14:21:18] mwlang: matthewd: I think you have a point about “not needing to make local changes” we’re all connecting to postgresql, but one’s on Linux, another on macOS and another is running his posgresql server in one VM while running the rails app in another, so I guess we’ll have to go to environment variables to hold user, host, password values.
[14:24:07] matthewd: mwlang: There's also `git update-index --assume-unchanged`.. it's not exactly a file that sees a lot of other change activity
[14:30:54] shilon: has joined #RubyOnRails
[14:33:14] jhfisc: has joined #RubyOnRails
[14:36:45] fryguy: we have a checked in database.yml where I work, with a variety of setups (mac, linux, mac with a script to load a new database per git branch automatically, stage, test, etc). works fine.
[14:40:00] mwlang: fryguy: what does that magic script look like? Am I presumely correctly it’s a bash script?
[14:40:38] fryguy: there's a couple versions floating around the office, one is primarily bash, one is primarily ruby, neither have been open sourced
[14:40:42] NoGodDamnIdea: has joined #RubyOnRails
[14:42:14] jhfisc: has joined #RubyOnRails
[14:43:38] [Butch]: has joined #RubyOnRails
[14:44:29] mwlang: fryguy: alright, I’ll find a way to do it with bash if the client’s not open to doing ERB with environment variables in the file.
[14:46:17] matthewd: I'm 99% sure you can also "just" override the database.yml path in production, say (and then leave the development one uncommitted), too
[14:53:04] jhfisc: has joined #RubyOnRails
[14:54:33] gost: has joined #RubyOnRails
[14:54:35] dionysus69: has joined #RubyOnRails
[14:58:12] cam27: has joined #RubyOnRails
[14:59:13] beilabs_: has joined #RubyOnRails
[14:59:45] high_fiver: has joined #RubyOnRails
[15:03:12] guacamole: has joined #RubyOnRails
[15:06:54] jhfisc: has joined #RubyOnRails
[15:07:02] Ryzokuken: has joined #RubyOnRails
[15:07:10] installller: has joined #RubyOnRails
[15:08:41] ascarter: has joined #RubyOnRails
[15:08:54] Sylario: I have a lot of troubles with ember and guard : https://stackoverflow.com/questions/45617436/guard-spec-and-ember-does-not-works-well-together
[15:09:45] installller: hi guys. I just installed ror on a new ubuntu machine with my project. I am getting uninitialized constant RSpec::Sidekiq when running rspec spec
[15:09:55] installller: what might be the problem?
[15:11:44] installller: I tried installing spec-sidekiq but it didn't work
[15:12:45] fryguy: installller: how did you install it
[15:13:02] installller: gem install rspec-sidekiq
[15:13:02] Ryzokuken: has joined #RubyOnRails
[15:13:08] fryguy: installller: add it to your gemfile instead
[15:13:45] installller: i am giving it a shot now. thanks for the idea
[15:14:58] K3rber0s: has joined #RubyOnRails
[15:15:19] installller: it is already in it like so : http://dpaste.com/0KGG307
[15:17:10] fryguy: what happens if you `bundle exec rspec spec`
[15:18:07] Ryzokuken: has joined #RubyOnRails
[15:18:37] installller: gonna try now
[15:19:50] Ryzokuken: has joined #RubyOnRails
[15:23:19] Ryzokuken: has joined #RubyOnRails
[15:25:23] Sylario: Is there a good alternative to Faker?
[15:25:23] installller: i took "gem rspec-sidekiq" out of the test" block in Gemfile, installed bundler again, than ran "bundle". it reinstalled everything and now when I run "rspec spec" it runs with a warning: "⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis."
[15:26:28] Sylario: Faker was fine, except that newer version (upgrading to rails 5) does not support app without en as a locale
[15:29:24] cagomez: has joined #RubyOnRails
[15:29:50] mostlybadfly: has joined #RubyOnRails
[15:30:35] cagomez: has joined #RubyOnRails
[15:30:38] shilon: has joined #RubyOnRails
[15:33:41] mwlang: has joined #RubyOnRails
[15:36:13] vovimayhem: has joined #RubyOnRails
[15:40:07] rgiscard: has joined #RubyOnRails
[15:45:17] cagomez: has joined #RubyOnRails
[15:47:56] brent__: has joined #RubyOnRails
[15:53:02] brent__: has joined #RubyOnRails
[15:54:40] brent__: has joined #RubyOnRails
[15:55:24] Ryzokuken: has joined #RubyOnRails
[15:56:34] Ryzokuken: has joined #RubyOnRails
[15:57:46] Ryzokuken: has joined #RubyOnRails
[15:58:23] high_fiver: has joined #RubyOnRails
[16:08:03] shilon: has joined #RubyOnRails
[16:10:09] Rodya_: has joined #RubyOnRails
[16:10:26] mwlang: has joined #RubyOnRails
[16:13:42] ascarter: has joined #RubyOnRails
[16:14:31] gusrub: has joined #RubyOnRails
[16:14:47] guacamole: has joined #RubyOnRails
[16:21:37] xploshioon: has joined #RubyOnRails
[16:33:55] xall: has joined #RubyOnRails
[16:38:20] rakm: has joined #RubyOnRails
[16:40:36] lessless: has joined #RubyOnRails
[16:40:49] ascarter: has joined #RubyOnRails
[16:41:22] crova: has joined #RubyOnRails
[16:43:51] ocpysh: has joined #RubyOnRails
[16:44:06] ascarter_: has joined #RubyOnRails
[16:47:37] Frem: has joined #RubyOnRails
[16:56:02] arielserafini: has joined #RubyOnRails
[16:56:25] username1: has joined #RubyOnRails
[17:02:00] chouhoulis: has joined #RubyOnRails
[17:04:30] dviola: has joined #RubyOnRails
[17:05:53] npgm: has joined #RubyOnRails
[17:06:09] vovimayhem: has joined #RubyOnRails
[17:11:48] rakm: has joined #RubyOnRails
[17:13:43] workmad3: has joined #RubyOnRails
[17:28:06] brent__: has joined #RubyOnRails
[17:28:20] ascarter_: has joined #RubyOnRails
[17:28:55] quirkycoders: has joined #RubyOnRails
[17:33:04] arielserafini: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[17:33:45] ocpysh: has joined #RubyOnRails
[17:34:04] kies: has joined #RubyOnRails
[17:34:04] benlieb: has joined #RubyOnRails
[17:34:09] chouhoulis: has joined #RubyOnRails
[17:34:32] benlieb: I have a controller spec and in the action there is an error being thrown, but it doesn't show in the rspec output. Is this normal?
[17:37:36] Chernobuk: has joined #RubyOnRails
[17:39:11] Rodya_: has joined #RubyOnRails
[17:42:32] funburn: has joined #RubyOnRails
[17:50:54] FastJack: has joined #RubyOnRails
[17:51:31] Ryzokuken: has joined #RubyOnRails
[17:52:54] banisterfiend: has joined #RubyOnRails
[17:54:12] Ryzokuken: has joined #RubyOnRails
[17:55:19] guacamole: has joined #RubyOnRails
[17:58:01] someuser: has joined #RubyOnRails
[17:59:25] gusrub: has joined #RubyOnRails
[18:03:53] rakm: has joined #RubyOnRails
[18:05:52] high_fiver: has joined #RubyOnRails
[18:07:01] high_fiver: has joined #RubyOnRails
[18:07:33] quirkycoders: has joined #RubyOnRails
[18:11:03] cjohnson: Can I add a scope that lets me specify a default record if teh scope returns nothing?
[18:11:05] conta: has joined #RubyOnRails
[18:11:16] vovimayhem: has joined #RubyOnRails
[18:11:26] cjohnson: So, https://gist.github.com/chrisjohnson/0639c02c4364e9fa8f1ad61ed1c3b879
[18:11:31] cjohnson: I want to make this method into a scope instead of a method
[18:11:34] gusrub: has joined #RubyOnRails
[18:13:11] matthewd: cjohnson: A scope is pretty much just a method anyway
[18:13:12] cjohnson: Oh I guess a simple or would solve this assuming &:default? gives me an id
[18:14:42] tfitts: this might just be general ruby but I'm wondering if there is a way to reduce an array to a count of consecutive elements such that [0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0] gives somethings like [{0 => 3},{1 => 6},{0 => 6},{1 => 9},{0 => 3}]
[18:15:28] tfitts: or am I best to just iterate through the array and add as I go
[18:16:06] matthewd: tfitts: Array is an Enumerable, which has many handy methods
[18:16:27] bholzer: has joined #RubyOnRails
[18:20:35] havenwood: tfitts: look at #chunk
[18:21:26] brent__: whats the best way in rspec to check that one method call, calls another method inside it?
[18:22:19] brent__: it 'blah' {article.is_complete.should be_truthy } I want to check that that also calls a method inside #is_complete
[18:22:32] matthewd: brent__: Best is don't: test the observable behaviour, not the implementation
[18:22:47] brent__: makese sense
[18:22:54] matthewd: brent__: But failing that, you can `expect(something).to receive(:some_method)`
[18:23:03] brent__: felt weird that they were checking that
[18:23:30] cjohnson: matthewd: Maybe I should clarify my problem. I have a template_sections and section_contents models. I want to be able to select template_sections, and then for each template_sections, include the associated section_contents. But I only want to include those section_contents that also match a given override_id
[18:23:37] mikecmpbll: has joined #RubyOnRails
[18:24:04] dionysus69: has joined #RubyOnRails
[18:24:10] cjohnson: Right now I've got that method which basically just maps the array of template_sections into an array of section_contents
[18:24:29] cjohnson: However the data actually supports multiple section_contents per template_section with a given override_id
[18:25:13] cjohnson: So I was thinking I would add a scope to section_contents that lets me pass an override_id and then use that scope when selecting the template_sections so it will just automatically pull in those child records which match the override_id condition
[18:25:19] cjohnson: does that make sense from a high level?
[18:25:49] shilon: has joined #RubyOnRails
[18:26:54] matthewd: cjohnson: Sorry, I'm not following -- but that's probably because I'm tired and not a problem with your explanation 😅
[18:27:08] cjohnson: No worries it's a bit of a mess. Let me just put together a more complete gist
[18:27:09] beilabs: has joined #RubyOnRails
[18:28:33] high_fiver: has joined #RubyOnRails
[18:29:33] mercwithamouth: has joined #RubyOnRails
[18:29:43] havenwood: tfitts: Let us know or ask in the #ruby channel if it's not clear where to go from the Enumerable#chunk method.
[18:30:22] cjohnson: matthewd: https://gist.github.com/chrisjohnson/3da8e850b126df845c746dc6721ba72e
[18:30:56] cjohnson: I tried to remove unrelated stuff but I might have been overzealous let me know if there's something missing. Basically template_sections has many section_contents
[18:30:57] funburn: has joined #RubyOnRails
[18:31:33] cjohnson: In this controller helper: https://gist.github.com/chrisjohnson/3da8e850b126df845c746dc6721ba72e#file-section_contents_controller-rb-L10-L14 I am trying to select all the template sections and their child section_contents
[18:31:43] cjohnson: but only those section_contents who match a given condition (override_id)
[18:32:42] matthewd: cjohnson: I guess my first question remains why do you want a scope over a method?
[18:33:01] cjohnson: I was just thinking a scope would help keep it easier when I select collections
[18:33:14] cjohnson: You can see right now that from_override uses find_by which means it only selects the first matching section_content
[18:33:28] cjohnson: That's a mistake, so I change that to use where instead of find_by
[18:33:42] cjohnson: but now I need a way to also keep the original template_section in the map (in the controller helper)
[18:34:01] netzfisch: has joined #RubyOnRails
[18:34:19] cjohnson: So, instead of template_sections.map -> return first section_content, I want to select all template_sections and their child section_contents, where override_id matches
[18:35:34] cjohnson: TL;DR: How can I select all foo, and its child records bar, but apply a condition to all the child bar selections
[18:37:35] cjohnson: Like I know you could define a has_many with a condition on it but the condition here is dynamic
[18:37:56] gusrub: has joined #RubyOnRails
[18:38:58] cjohnson: Looks like you can delegate the has_many condition to a method on the model but the override_id is coming from the controller
[18:41:16] username1: has joined #RubyOnRails
[18:41:56] cjohnson: I think that's basically all I need to figure out is how to pass the condition to the has_many from the controller instead of a model method
[18:46:34] matthewd: cjohnson: There aren't really great ways to do this
[18:46:38] cjohnson: Looks like there's a funky way to set it up using reflect_on_association
[18:47:16] cjohnson: Yeah I know. The current approach I've got there of just building a new collection out of an Enumerable#map and then a bunch of individual queries is just fighting the rails ecosystem
[18:47:36] matthewd: cjohnson: You can do `Foo.includes(:bars).where(bars: { some_column: "the_good_value" })`
[18:48:27] matthewd: That'll give you a collection of foos where .bars is filtered to those that matched the condition -- which might be what you want, but could also surprise if other code gets passed a foo and is expecting it to be the full list.
[18:50:53] jhfisc: has joined #RubyOnRails
[18:52:51] ocpysh: has joined #RubyOnRails
[18:56:28] jhfisc: has joined #RubyOnRails
[18:57:58] andywww: has joined #RubyOnRails
[19:01:50] ascarter_: has joined #RubyOnRails
[19:02:49] jhfisc: has joined #RubyOnRails
[19:05:14] ocpysh: Are there any good SJR tutorials out there for Rails 5?
[19:05:56] netzfisch: has joined #RubyOnRails
[19:10:01] ascarter_: has joined #RubyOnRails
[19:16:43] funburn: has joined #RubyOnRails
[19:18:15] funburn: has joined #RubyOnRails
[19:23:50] beilabs: has joined #RubyOnRails
[19:26:02] hahuang65: has joined #RubyOnRails
[19:26:08] benlieb: has joined #RubyOnRails
[19:26:38] dviola: has joined #RubyOnRails
[19:27:02] beilabs: has joined #RubyOnRails
[19:29:50] cnk: has joined #RubyOnRails
[19:30:02] sagax: has joined #RubyOnRails
[19:42:43] jhfisc: has joined #RubyOnRails
[19:42:50] ocpysh: guys, is Rails dying? Why is the activity on this channel this low?
[19:43:03] ocpysh: It used to be active.
[19:46:19] matthewd: ocpysh: It rather depends what questions people are asking
[19:48:55] havenwood: ocpysh: SJR isn't one of the more popular initialisms. I forgot what it was before looking it up.
[19:49:56] havenwood: RJS, JSR, it gets hard for us dyslexics.
[19:50:13] ascarter: has joined #RubyOnRails
[19:50:39] ascarter_: has joined #RubyOnRails
[19:52:11] cnk: ocpysh: This channel is a lot less active than it used to be. But is that a drop off in Rails or IRC use? Or just the intersection of those 2 things? Hard to know
[19:52:19] havenwood: ocpysh: Have you already read DHH's post on it?
[19:52:36] havenwood: More folk already know Rails maybe? Slack?
[19:54:58] crova: cnk, it probably has a lot to do with IRC being "old". I said to a friend that I used to look for help here and he was really surprised to hear that people were still using IRC
[19:55:30] guacamole: has joined #RubyOnRails
[19:56:50] cnk: Probably. though 2 years ago the Django and RubyOnRails channels had about equal numbers at any one time and roughly similar activity levels. Django is at the about the same size but ROR is 1/2 the logged in people it used to be
[19:59:30] ocpysh: has joined #RubyOnRails
[20:00:37] ocpysh: crova : I don't think so, see #node.js (1k users currently..)
[20:00:50] ocpysh: devs use IRC anyhow.
[20:01:00] ocpysh: havenwood : what post?
[20:01:39] havenwood: ocpysh: Rails is one framework. There's a #ruby channel.
[20:01:45] havenwood: ocpysh: https://signalvnoise.com/posts/3697-server-generated-javascript-responses
[20:02:25] havenwood: ocpysh: 9 people in the #expressjs channel. Is Node dead?
[20:02:49] ocpysh: havenwood : ah yeah, sure - but that's from 2013
[20:03:11] havenwood: ocpysh: Use ActionCable instead if you want 2017. :-P
[20:03:11] ocpysh: it's hard for me to read code that is not rails 5 specific, because I just started learning ruby/rails
[20:03:40] havenwood: ocpysh: http://edgeguides.rubyonrails.org/action_cable_overview.html
[20:03:43] havenwood: Didn't mean to link edge there >.>
[20:03:56] jhfisc: has joined #RubyOnRails
[20:05:06] quirkycoders: has joined #RubyOnRails
[20:05:44] ocpysh: websockets aren't usually used for mostly document oriented stuff i'm doing.
[20:05:52] cjohnson: matthewd: I want multiple foos with their multiple bars
[20:06:10] matthewd: I'm pretty sure the code in said 2013 article will still work just fine
[20:06:22] cjohnson: 2013 article?
[20:06:31] havenwood: cjohnson: https://signalvnoise.com/posts/3697-server-generated-javascript-responses
[20:06:59] matthewd: cjohnson: Sorry, that was for ocpysh
[20:06:59] cjohnson: Ohhh it wasn't directed at me
[20:07:10] matthewd: cjohnson: I'm pretty sure that'll give you what you want
[20:07:44] matthewd: A list of foos, where each foo's existing bars association is prepopulated with the filtered list
[20:08:34] ocpysh: I like that rails does everything for you.
[20:09:03] ocpysh: it's insane.
[20:09:24] ascarter_: has joined #RubyOnRails
[20:10:12] ocpysh: it's like built for art instead of programming.
[20:10:41] rakm: has joined #RubyOnRails
[20:22:40] brent__: has joined #RubyOnRails
[20:24:34] gusrub: has joined #RubyOnRails
[20:27:33] jhfisc: has joined #RubyOnRails
[20:33:08] mwlang: has joined #RubyOnRails
[20:33:11] quirkycoders: has joined #RubyOnRails
[20:35:49] cjk101010: has joined #RubyOnRails
[20:42:08] cjohnson: matthewd: Yep that's it, last question, can I use a scope instead of a where there?
[20:42:18] cjohnson: a scope that exists on bars
[20:47:23] cjohnson: If I do includes(:bar).merge(Bar.scope_name(override_id))
[20:47:38] cjohnson: then it generates a query with the scope condition but it's on the table that isn't being joined in the query
[20:52:50] jhfisc: has joined #RubyOnRails
[20:54:56] cjohnson: So the ORM is joining them without using a SQL join
[20:56:05] jhfisc: has joined #RubyOnRails
[20:56:17] cnk: has joined #RubyOnRails
[21:00:14] guacamole: has joined #RubyOnRails
[21:00:14] cjohnson: .references
[21:01:12] one_zero: has joined #RubyOnRails
[21:08:31] jhfisc: has joined #RubyOnRails
[21:11:49] quazimodo: has joined #RubyOnRails
[21:15:56] jhfisc: has joined #RubyOnRails
[21:18:34] ascarter_: has joined #RubyOnRails
[21:19:13] ocpysh: in rails 5, how do I install jquery (the actual one)? using yern, npm, bower..?
[21:19:21] ocpysh: or there is a "gem"?
[21:20:51] jhfisc: has joined #RubyOnRails
[21:24:38] brent__: has joined #RubyOnRails
[21:28:17] vovimayhem: has joined #RubyOnRails
[21:30:19] arup_r: has joined #RubyOnRails
[21:31:36] ocpysh: oh well. yarn did it.
[21:34:47] quazimodo: has joined #RubyOnRails
[21:38:54] jhfisc: has joined #RubyOnRails
[21:39:55] spheric: has joined #RubyOnRails
[21:41:49] gambl0re: has joined #RubyOnRails
[21:46:53] jhfisc: has joined #RubyOnRails
[21:51:44] brent__: has joined #RubyOnRails
[21:55:19] cjohnson: matthewd: includes(:section_contents).merge(SectionContent.with_overrides([override_id]).references(:template_section))
[21:55:22] cjohnson: ended up being the working line
[21:56:25] Rodya_: has joined #RubyOnRails
[21:57:54] andywww: has joined #RubyOnRails
[21:59:39] andywww: has joined #RubyOnRails
[22:02:16] jhfisc: has joined #RubyOnRails
[22:04:01] quirkycoders: has joined #RubyOnRails
[22:07:06] rikkipitt: has joined #RubyOnRails
[22:07:12] jhfisc: has joined #RubyOnRails
[22:10:03] rikkipitt: evening folks
[22:10:53] jhfisc: has joined #RubyOnRails
[22:10:54] rikkipitt: say I have a collection of active record models, and one column is "time" i.e. HH:MM:SS, and I find records by time: :asc
[22:11:52] rikkipitt: what would be a the best way of finding the closest object by the current hour and re-arranging the collection?
[22:13:15] rikkipitt: [{time: 13:00}, {time: 14:00}, {time: 15:00}] but the time now is 14:05 so give [{time: 14:00}, {time: 15:00}, {time: 13:00}]
[22:16:47] jhfisc: has joined #RubyOnRails
[22:19:25] fschuindt: has joined #RubyOnRails
[22:19:43] fschuindt: basmoura: haha!
[22:22:49] jhfisc: has joined #RubyOnRails
[22:24:17] alfiemax: has joined #RubyOnRails
[22:26:43] jhfisc: has joined #RubyOnRails
[22:30:12] hahuang65: has joined #RubyOnRails
[22:32:02] funburn: has joined #RubyOnRails
[22:32:17] jphase: has joined #RubyOnRails
[22:43:36] Or1on: has joined #RubyOnRails
[22:45:20] jhfisc: has joined #RubyOnRails
[22:47:23] mtkd: has joined #RubyOnRails
[22:50:49] jhfisc: has joined #RubyOnRails
[22:56:11] jhfisc: has joined #RubyOnRails
[22:57:35] Rodya_: has joined #RubyOnRails
[23:00:26] ahrs: has joined #RubyOnRails
[23:00:44] dviola: has joined #RubyOnRails
[23:01:57] funburn: has joined #RubyOnRails
[23:09:22] jhfisc: has joined #RubyOnRails
[23:11:30] cjohnson: I've got an array of ActiveRecords and once I have that array I want to make them unique based on a specific field
[23:11:44] cjohnson: .uniq (alias for .distinct) doesn't seem to accept a field to compare on
[23:11:59] cjohnson: It only works if you used .select on the query to get one field, but that's not what I have
[23:12:06] jhfisc: has joined #RubyOnRails
[23:13:08] cjohnson: I guesss it's not actually an array it's SectionContent::ActiveRecord_AssociationRelation
[23:13:33] cjohnson: Do I need to convert it to an array and then use Array#uniq { |o| o.field_name } ?
[23:17:30] funburn: has joined #RubyOnRails
[23:20:05] ocpysh: has joined #RubyOnRails
[23:40:50] jhfisc: has joined #RubyOnRails
[23:47:16] jhfisc: has joined #RubyOnRails
[23:47:42] quirkycoders: has joined #RubyOnRails
[23:52:41] jhfisc: has joined #RubyOnRails
[23:56:06] Cache_Money: has joined #RubyOnRails
[23:56:37] Haydos: has joined #RubyOnRails
[23:58:50] jhfisc: has joined #RubyOnRails
[23:59:35] Rodya_: has joined #RubyOnRails