« Back to channel list

#RubyOnRails - 11 August 2017

« Back 1 day Forward 1 day »
[00:01:41] andywww: has joined #RubyOnRails
[00:08:21] troys: has joined #RubyOnRails
[00:10:36] jhfisc: has joined #RubyOnRails
[00:16:49] jhfisc: has joined #RubyOnRails
[00:24:06] ocpysh: has joined #RubyOnRails
[00:25:59] alfiemax: has joined #RubyOnRails
[00:30:45] cjohnson: .to_q.uniq(&:field_name) works
[00:31:40] K3rber0s: has left #RubyOnRails: ()
[00:32:04] hahuang65: has joined #RubyOnRails
[00:35:04] jhfisc: has joined #RubyOnRails
[00:39:41] brent__: has joined #RubyOnRails
[00:40:46] jhfisc: has joined #RubyOnRails
[00:43:35] hahuang65: has joined #RubyOnRails
[00:43:35] jhfisc: has joined #RubyOnRails
[00:50:12] sunrunner202: has joined #RubyOnRails
[00:56:35] jhfisc: has joined #RubyOnRails
[00:59:36] jhfisc: has joined #RubyOnRails
[01:00:33] Rodya_: has joined #RubyOnRails
[01:01:15] jphase: has joined #RubyOnRails
[01:06:20] jphase: has joined #RubyOnRails
[01:06:59] quazimodo: has joined #RubyOnRails
[01:07:46] sevenseacat: has joined #RubyOnRails
[01:12:15] jhfisc: has joined #RubyOnRails
[01:13:38] quirkycoders: has joined #RubyOnRails
[01:14:18] juggler: has joined #RubyOnRails
[01:22:13] rahult_: has joined #RubyOnRails
[01:24:27] hahuang65: has joined #RubyOnRails
[01:29:27] brent__: has joined #RubyOnRails
[01:36:50] jhfisc: has joined #RubyOnRails
[01:40:21] elcontrastador: has joined #RubyOnRails
[01:44:50] jhfisc: has joined #RubyOnRails
[01:50:01] quirkycoders: has joined #RubyOnRails
[01:50:21] jhfisc: has joined #RubyOnRails
[01:55:13] irishfromua: has joined #RubyOnRails
[01:56:22] jhfisc: has joined #RubyOnRails
[01:59:35] jhfisc: has joined #RubyOnRails
[02:01:20] Rodya_: has joined #RubyOnRails
[02:05:05] jhfisc: has joined #RubyOnRails
[02:10:02] jhfisc: has joined #RubyOnRails
[02:10:09] rakm_: has joined #RubyOnRails
[02:10:33] Chernobuk1: has joined #RubyOnRails
[02:10:39] ForeignBiscuit: has joined #RubyOnRails
[02:11:06] ForeignBiscuit: has joined #RubyOnRails
[02:11:31] ForeignBiscuit: has joined #RubyOnRails
[02:11:55] Rodya_: has joined #RubyOnRails
[02:11:56] ForeignBiscuit: has joined #RubyOnRails
[02:12:21] ForeignBiscuit: has joined #RubyOnRails
[02:12:49] ForeignBiscuit: has joined #RubyOnRails
[02:13:14] ForeignBiscuit: has joined #RubyOnRails
[02:17:36] jhfisc: has joined #RubyOnRails
[02:21:07] cgfbee: has joined #RubyOnRails
[02:23:50] codelahoma: has joined #RubyOnRails
[02:23:59] jhfisc: has joined #RubyOnRails
[02:24:07] kt2: has joined #RubyOnRails
[02:24:10] targaf: has joined #RubyOnRails
[02:24:11] mercwithamouth: has joined #RubyOnRails
[02:24:23] atrius: has joined #RubyOnRails
[02:25:36] quirkycoders: has joined #RubyOnRails
[02:26:05] [spoiler]: has joined #RubyOnRails
[02:28:30] thortron: has joined #RubyOnRails
[02:29:09] alfiemax: has joined #RubyOnRails
[02:32:36] lessless: has joined #RubyOnRails
[02:33:32] clamstar: has joined #RubyOnRails
[02:33:40] mtkd: has joined #RubyOnRails
[02:35:00] jhfisc: has joined #RubyOnRails
[02:40:55] jhfisc: has joined #RubyOnRails
[02:46:49] jhfisc: has joined #RubyOnRails
[03:00:00] jhfisc: has joined #RubyOnRails
[03:05:59] gusrub: has joined #RubyOnRails
[03:06:58] creature: has joined #RubyOnRails
[03:09:25] jhfisc: has joined #RubyOnRails
[03:11:39] kies: has joined #RubyOnRails
[03:13:44] dionysus69: has joined #RubyOnRails
[03:14:30] jhfisc: has joined #RubyOnRails
[03:18:40] ascarter: has joined #RubyOnRails
[03:19:12] Haydos: has joined #RubyOnRails
[03:25:15] hahuang65: has joined #RubyOnRails
[03:27:20] jhfisc: has joined #RubyOnRails
[03:33:55] jhfisc: has joined #RubyOnRails
[03:38:50] jhfisc: has joined #RubyOnRails
[03:39:08] tanuki: has joined #RubyOnRails
[03:40:15] thecommongeek: has joined #RubyOnRails
[03:40:20] alfiemax: has joined #RubyOnRails
[03:42:11] thecommongeek: Trying to downgrade rails 5.1.3 to rails 3.2.22 on Linux 16.10, can anyone point me in the right direction?
[03:42:29] high_fiver: has joined #RubyOnRails
[03:44:23] jhfisc: has joined #RubyOnRails
[03:47:15] jhfisc: has joined #RubyOnRails
[03:48:29] fryguy: thecommongeek: change the version of the gem in your Gemfile, run bundle install, and keep going until tests pass?
[03:51:16] laphoraig92: has joined #RubyOnRails
[03:55:27] nahtnam: has joined #RubyOnRails
[03:58:18] jhfisc: has joined #RubyOnRails
[04:12:05] jhfisc: has joined #RubyOnRails
[04:19:43] K3rber0s: has joined #RubyOnRails
[04:24:13] jhfisc: has joined #RubyOnRails
[04:33:53] jhfisc: has joined #RubyOnRails
[04:41:00] K3rber0s: has joined #RubyOnRails
[04:47:39] hobbanero: has joined #RubyOnRails
[04:47:47] hobbanero: has left #RubyOnRails: ()
[04:47:49] apparition47: has joined #RubyOnRails
[04:55:54] srinidhi: has joined #RubyOnRails
[05:02:50] quirkycoders: has joined #RubyOnRails
[05:24:17] cjohnson: I'm still hung up on my earlier problem. I don't like having to distinct the array after querying the DB, I'd rather do it right in the scope. Here's what I've got currently: scope :ungrouped, -> { where(override_id: Override.ungrouped.map(&:id)).group(:override_id) }
[05:24:56] cjohnson: But I can't group by override_id since I'm selecting section_contents.*:
[05:24:57] cjohnson: SELECT "section_contents".* FROM "section_contents" WHERE "section_contents"."template_section_id" = 1 AND "section_contents"."override_id" IN (1, 238, 237, 235) GROUP BY "section_contents"."override_id" ORDER BY priority DESC
[05:25:27] cjohnson: Is there a better way to get what I'm after here? I just want the first matching section_content per override_id
[05:26:12] hahuang65: has joined #RubyOnRails
[05:26:49] jhfisc: has joined #RubyOnRails
[05:31:56] jhfisc: has joined #RubyOnRails
[05:33:20] fschuindt: has joined #RubyOnRails
[05:40:39] cjohnson: scope :ungrouped, -> { select('distinct on (override_id) *').where(override_id: Override.ungrouped.map(&:id)).reorder('override_id, priority DESC') }
[05:40:43] jhfisc: has joined #RubyOnRails
[05:40:46] xall: has joined #RubyOnRails
[05:40:51] cjohnson: bit messy but it works
[05:43:37] xall: (rails newb) is it normal for `bundle install` to install to the project root?
[05:44:10] sevenseacat: install what?
[05:45:12] xall: `bundle install` installs gemfiles right? after running that i get a folder with timestamp name
[05:45:40] xall: i started learning rails but haven't touched it in 6 months. this seems odd to me
[05:45:43] sevenseacat: thats not typical, no
[05:46:18] jhfisc: has joined #RubyOnRails
[05:46:44] sevenseacat: whats in the folder?
[05:49:17] xall: https://gist.github.com/63cf08a3784fda4136ee60bc39f6a927
[05:50:15] conta: has joined #RubyOnRails
[05:51:10] sevenseacat: do you have anything in your bundler config, .bundle/config I think it is?
[05:52:41] xall: yeah, BUNDLE_DISABLE_SHARED_GEMS: "true". this seems to be default? maybe an env variable isn't set properly?
[05:53:57] xall: (maybe it's not default -- i'm just reading from an SO thread
[05:54:01] sevenseacat: whats in the env var BUNDLE_PATH ?
[05:55:16] xall: not set. this seems to be the problem eh
[05:55:53] sevenseacat: dunno, just gathering information right now
[05:56:14] xall: is yours set?
[05:57:23] sevenseacat: the timestamp seems odd because its months ago - does that timestamp appear anywhere in your app?
[05:58:06] sevenseacat: I also dont disable shared gems though
[06:00:03] xall: i thought the same. find or grep doesn't find anything else in app
[06:00:24] xall: i tried setting shared gems to false and the same folder is generated
[06:00:59] xall: i don't think i went out of my way to configure anything. this app is just working through the agile rails dhh book
[06:01:00] jhfisc: has joined #RubyOnRails
[06:01:43] sevenseacat: is the full app public?
[06:02:34] xall: what do you mean?
[06:03:09] xall: like deployed?
[06:03:17] sevenseacat: can I clone the app and have a look to see if I can replicate/fix it?
[06:03:53] xall: yeah, one sec
[06:05:35] jhfisc: has joined #RubyOnRails
[06:07:11] sevenseacat: public would have been fine, I don't generally accept PMs
[06:08:28] sevenseacat: that being said, I cloned and bundled and didnt get this mystery folder
[06:08:58] sevenseacat: do you have some global bundler config? in ~/.bundle/config maybe?
[06:09:46] xall: sorry, i just figured i'd prefer to keep private incase i overlooked soemthing stupid
[06:10:55] jhfisc: has joined #RubyOnRails
[06:11:11] xall: yeah ~/.bundle/config
[06:11:12] xall: BUNDLE_PATH: "2017_05_23_120637/Gemfile"
[06:11:20] xall: wtf did that happen
[06:11:47] xall: what in the world
[06:13:00] xall: well thanks for the help sevenseacat
[06:13:21] xall: is your config default?
[06:13:24] xall: what does it normally contain
[06:13:39] sevenseacat: its empty by default
[06:16:38] jhfisc: has joined #RubyOnRails
[06:24:09] mattwithoos: has joined #RubyOnRails
[06:24:40] jhfisc: has joined #RubyOnRails
[06:25:38] cjk101010: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[06:31:00] jhfisc: has joined #RubyOnRails
[06:32:15] one_zero: has joined #RubyOnRails
[06:35:30] w0rd-driven: has joined #RubyOnRails
[06:37:37] RahulT: has joined #RubyOnRails
[06:42:10] irishfromua: has joined #RubyOnRails
[06:53:49] srinidhi: has joined #RubyOnRails
[06:54:52] jhfisc: has joined #RubyOnRails
[07:00:50] jhfisc: has joined #RubyOnRails
[07:02:59] conta: has joined #RubyOnRails
[07:12:37] jhfisc: has joined #RubyOnRails
[07:17:10] MACscr: has joined #RubyOnRails
[07:17:45] jhfisc: has joined #RubyOnRails
[07:20:18] AzaToth: has joined #RubyOnRails
[07:22:55] jhfisc: has joined #RubyOnRails
[07:27:12] hahuang65: has joined #RubyOnRails
[07:28:55] jhfisc: has joined #RubyOnRails
[07:29:39] KeyJoo: has joined #RubyOnRails
[07:34:00] jhfisc: has joined #RubyOnRails
[07:42:47] jhfisc: has joined #RubyOnRails
[07:42:49] futilegames: has joined #RubyOnRails
[07:50:37] jhfisc: has joined #RubyOnRails
[07:53:34] jhfisc: has joined #RubyOnRails
[07:59:55] jhfisc: has joined #RubyOnRails
[08:00:13] mikecmpbll: has joined #RubyOnRails
[08:05:55] workmad3: has joined #RubyOnRails
[08:07:20] MACscr: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[08:07:45] alfiemax: has joined #RubyOnRails
[08:12:49] jhfisc: has joined #RubyOnRails
[08:17:15] armyriad: has joined #RubyOnRails
[08:18:49] jhfisc: has joined #RubyOnRails
[08:23:36] jhfisc: has joined #RubyOnRails
[08:28:59] jhfisc: has joined #RubyOnRails
[08:29:28] noob_on_rails: has joined #RubyOnRails
[08:29:43] noob_on_rails: why when i insert a class in sinatra , the server stops responding
[08:30:09] sevenseacat: you might need to elaborate.
[08:30:40] noob_on_rails: https://gist.github.com/frcake/f37add503a975dd00be84acec3f334e5
[08:31:06] noob_on_rails: everyone on the web seem to work like the doesnt work example out of the box
[08:31:17] noob_on_rails: i just have a folder with my app init
[08:31:40] sevenseacat: this doesnt seem rails related
[08:31:57] noob_on_rails: well it's a ruby gem
[08:32:13] noob_on_rails: yea it's not directly rails , but i was just checking if anyone has any experience :S
[08:32:44] noob_on_rails: sevenseacat: other cool ways to create mock apis for rails ?
[08:34:59] jhfisc: has joined #RubyOnRails
[08:42:48] jhfisc: has joined #RubyOnRails
[08:52:37] jphase: has joined #RubyOnRails
[08:53:47] jhfisc: has joined #RubyOnRails
[08:58:30] marr: has joined #RubyOnRails
[08:58:45] mr_blue: has joined #RubyOnRails
[08:59:06] mr_blue: Is there a way to test views with google analytics
[08:59:39] jhfisc: has joined #RubyOnRails
[09:04:02] Sylario: has joined #RubyOnRails
[09:06:18] tanuki: has joined #RubyOnRails
[09:10:36] vedu: mr_blue: as in? you want to check GA is sending events?
[09:12:08] mr_blue: vedu: yes exactly
[09:13:04] mr_blue: I need to test the events sended to GA from my site
[09:16:20] vedu: mr_blue: I'm not sure there's an easy way to set up a test for it. I just run my app in dev env and see events popup realtime in GA
[09:16:37] vedu: I use 2 different apps so that data is not mangled
[09:19:15] ams__: has joined #RubyOnRails
[09:28:03] hahuang65: has joined #RubyOnRails
[09:29:00] jhfisc: has joined #RubyOnRails
[09:33:55] arBmind: has joined #RubyOnRails
[09:34:13] mr_blue: ok. Thank you vedu
[09:34:55] jhfisc: has joined #RubyOnRails
[09:39:43] jhfisc: has joined #RubyOnRails
[09:52:46] ur5us: has joined #RubyOnRails
[09:58:40] jhfisc: has joined #RubyOnRails
[10:00:39] ahrs: has joined #RubyOnRails
[10:04:19] jhfisc: has joined #RubyOnRails
[10:05:37] danguita: has joined #RubyOnRails
[10:07:57] jhfisc: has joined #RubyOnRails
[10:08:11] Pumukel: has joined #RubyOnRails
[10:14:01] jhfisc: has joined #RubyOnRails
[10:17:15] alfiemax: has joined #RubyOnRails
[10:20:16] FastJack: has joined #RubyOnRails
[10:22:42] oddie_: has joined #RubyOnRails
[10:22:50] jhfisc: has joined #RubyOnRails
[10:25:01] Ergo: has joined #RubyOnRails
[10:30:39] jhfisc: has joined #RubyOnRails
[10:31:20] RahulT: has joined #RubyOnRails
[10:37:24] quazimodo: has joined #RubyOnRails
[10:39:45] jhfisc: has joined #RubyOnRails
[10:46:29] Papierkorb: has joined #RubyOnRails
[10:46:37] FastJack: has joined #RubyOnRails
[10:48:59] p8m: has joined #RubyOnRails
[10:49:16] quazimodo: has joined #RubyOnRails
[10:57:03] jhfisc: has joined #RubyOnRails
[11:13:30] jhfisc: has joined #RubyOnRails
[11:14:23] rgr: has joined #RubyOnRails
[11:19:46] tanuki: has joined #RubyOnRails
[11:28:55] hahuang65: has joined #RubyOnRails
[11:32:02] lessless: has joined #RubyOnRails
[11:32:53] jhfisc: has joined #RubyOnRails
[11:37:33] apparition47: has joined #RubyOnRails
[11:38:11] jhfisc: has joined #RubyOnRails
[11:47:05] jhfisc: has joined #RubyOnRails
[11:52:04] jhfisc: has joined #RubyOnRails
[11:53:49] nikivi: has joined #RubyOnRails
[11:55:46] DTZUZO: has joined #RubyOnRails
[12:03:27] ych: has joined #RubyOnRails
[12:03:54] jhfisc: has joined #RubyOnRails
[12:05:51] apparition47: has joined #RubyOnRails
[12:07:26] francuz: has joined #RubyOnRails
[12:09:35] barttenbrinke: Hey, I've got a question about AR polymorphic queries
[12:09:46] barttenbrinke: https://www.irccloud.com/pastebin/kzJo2dPj/
[12:09:58] jhfisc: has joined #RubyOnRails
[12:10:42] francuz: hello everyone, I have a "cart" model and a "session" model, and a many to many relationship between them. I'd like to add a session to the cart, but only if the session does not already exist in it. For now what I'm doing is that i check Cart.Sessions.where(id: ses_id), and add if the result is empty. But I'm sure that there is an easier way(like, a Cart.Session.addIfNotExist(id), or something like that)
[12:11:50] barttenbrinke: francuz : https://apidock.com/rails/v4.0.2/ActiveRecord/Relation/find_or_create_by
[12:13:21] ahrs: has joined #RubyOnRails
[12:19:00] jhfisc: has joined #RubyOnRails
[12:19:23] Cork: has joined #RubyOnRails
[12:19:24] ephemer0l: has joined #RubyOnRails
[12:19:24] iamdevnul: has joined #RubyOnRails
[12:19:48] johnkpaul: has joined #RubyOnRails
[12:19:49] jtperreault: has joined #RubyOnRails
[12:19:52] lipoqil: has joined #RubyOnRails
[12:20:10] daxroc: has joined #RubyOnRails
[12:24:23] universa1: has joined #RubyOnRails
[12:25:35] quirkycoders: has joined #RubyOnRails
[12:35:24] ocpysh: has joined #RubyOnRails
[12:45:06] Hates_: has joined #RubyOnRails
[12:49:48] arBmind: has joined #RubyOnRails
[12:50:53] jhfisc: has joined #RubyOnRails
[12:53:59] quazimodo: has joined #RubyOnRails
[12:56:51] jhfisc: has joined #RubyOnRails
[12:58:35] jphase: has joined #RubyOnRails
[13:05:52] quazimodo: has joined #RubyOnRails
[13:09:00] jhfisc: has joined #RubyOnRails
[13:14:21] jhfisc: has joined #RubyOnRails
[13:17:20] creaked: has joined #RubyOnRails
[13:18:07] noob_on_rails: i have an EmberJS frontend which i try to authentitace with a namespaced Devise . i get this error with the routing https://gist.github.com/frcake/56ea42a1aeb7816f3033423eddddc52c
[13:20:41] jhfisc: has joined #RubyOnRails
[13:29:58] hahuang65: has joined #RubyOnRails
[13:31:11] jhfisc: has joined #RubyOnRails
[13:37:59] jhfisc: has joined #RubyOnRails
[13:40:55] Or1on: has joined #RubyOnRails
[13:44:18] tedwing: has joined #RubyOnRails
[13:44:29] Puck6633: has joined #RubyOnRails
[13:45:12] mostlybadfly: has joined #RubyOnRails
[13:49:44] Puck6633: Hi, I have a situation where I want to select objects from a table using a handful of predetermined keys in a column that's not the primary key, so I'm using "objs = MyModel.where(key_column: [...])". My question is, if I want to get the first object by a value is there a better way than "objs.select { |o| o.key_column == <value> }.first"?
[13:50:26] Puck6633: I was hoping for something like "objs.where(key_column: <value>)" without hitting the database again just to make things look a little cleaner.
[13:53:07] Puck6633: Excuse me, I meant I was hoping for "objs.where(key_column: <value>).first"
[13:55:18] banisterfiend: has joined #RubyOnRails
[14:00:00] jhfisc: has joined #RubyOnRails
[14:09:13] chouhoulis: has joined #RubyOnRails
[14:11:29] theunraveler: has joined #RubyOnRails
[14:20:25] ResidentBiscuit: has joined #RubyOnRails
[14:24:05] [Butch]: has joined #RubyOnRails
[14:29:15] ocpysh: has joined #RubyOnRails
[14:32:45] chouhoulis: has joined #RubyOnRails
[14:39:18] NoGodDamnIdea: has joined #RubyOnRails
[14:39:40] quirkycoders: has joined #RubyOnRails
[14:40:00] afromankenobi: has joined #RubyOnRails
[14:50:50] jhfisc: has joined #RubyOnRails
[14:55:49] jhfisc: has joined #RubyOnRails
[14:58:49] jhfisc: has joined #RubyOnRails
[15:00:15] guacamole: has joined #RubyOnRails
[15:06:41] jhfisc: has joined #RubyOnRails
[15:10:47] theunrav_: has joined #RubyOnRails
[15:11:22] jschoolcraft: has joined #RubyOnRails
[15:11:36] jhfisc: has joined #RubyOnRails
[15:15:30] afromankenobi: has joined #RubyOnRails
[15:17:31] GodFather: has joined #RubyOnRails
[15:22:09] chouhoulis: has joined #RubyOnRails
[15:24:04] jhfisc: has joined #RubyOnRails
[15:28:07] username1: has joined #RubyOnRails
[15:30:48] hahuang65: has joined #RubyOnRails
[15:30:56] jhfisc: has joined #RubyOnRails
[15:31:12] crankharder: is anyone aware of a means to inline critical CSS above the fold in order to optimize pages for google's page speed tool?
[15:31:55] crankharder: it seems there's a bunch of half-working solutions using node servers/libs that do this, but i've been unsuccessful so far. https://github.com/filamentgroup/criticalCSS https://github.com/josh-m-sharpe/rails_critical_css_server https://github.com/wheeyls/rails_critical_css_server etc...
[15:33:53] Cache_Money: has joined #RubyOnRails
[15:34:38] crankharder: Puck6633: why not just MyModel.where(key_column: value).first ?
[15:34:54] brent__: has joined #RubyOnRails
[15:37:31] jhfisc: has joined #RubyOnRails
[15:38:15] Puck6633: crankharder: Because in my tests each time that runs it hits the database again to load a single MyModel.. Maybe I did something wrong though?
[15:39:04] havenwood: Then use #find_by in place of #where/#first.
[15:39:28] crankharder: ^ thats the same thing
[15:39:47] Puck6633: I was going to say..
[15:40:25] crankharder: "objs.select { |o| o.key_column == <value> }.first doesn't hit the DB again
[15:40:46] crankharder: you could use objs.detect{|o| o.key_column == <value>} for slightly less code
[15:41:07] crankharder: probably a bit more efficient
[15:41:38] Puck6633: crankharder: Yep! I actually ended up leaving it at that pending a better solution if one exists.
[15:41:57] Puck6633: It occurred to me that there was no reason to iterate the entire array with select
[15:42:19] havenwood: #find_by is more #where/#take
[15:42:59] havenwood: the LIMIT 1 up front is nice
[15:43:34] jhfisc: has joined #RubyOnRails
[15:45:02] ocpysh: has joined #RubyOnRails
[15:46:23] crankharder: pretty sure where/first converts to limit 1
[15:49:19] jhfisc: has joined #RubyOnRails
[15:51:16] havenwood: crankharder: first is by primary key
[15:51:53] havenwood: crankharder: find_by and where/first will not always return the same value, since they get that value differently
[15:53:02] npgm: has joined #RubyOnRails
[15:53:39] arBmind: has joined #RubyOnRails
[15:54:13] havenwood: `ORDER BY blah.id` would be the part that differs for #first
[15:57:07] havenwood: crankharder: good point it's LIMIT 1 either way
[15:58:47] cjohnson: Am I wrong in my understanding that Foo.update(my_foo) will either update or create my_foo in the db?
[15:58:59] cjohnson: It appears to work fine when my_foo is Foo.new, with some params applied
[16:01:22] GodFather: has joined #RubyOnRails
[16:02:35] GodFather: has joined #RubyOnRails
[16:06:19] quirkycoders: has joined #RubyOnRails
[16:06:32] rakm: has joined #RubyOnRails
[16:09:41] gusrub: has joined #RubyOnRails
[16:11:13] chouhoulis: has joined #RubyOnRails
[16:11:50] dretnx: has joined #RubyOnRails
[16:12:40] dretnx: Is ROR suitable for large traffic site?
[16:13:54] brent__: whats the best wya to test mailers
[16:15:00] brent__: or how can i stub out a blah_mail.html.haml? our tests created a MockMailer that inherits from ActionMailer::Base, and they test ActionMailer::Base.deliveries count
[16:15:11] brent__: however since upgrading rails, its throwing missing template errors
[16:20:25] jhfisc: has joined #RubyOnRails
[16:21:24] ascarter: has joined #RubyOnRails
[16:23:38] deur-: dretnx: It Depends™
[16:23:55] deur-: it can be fast
[16:25:43] jhfisc: has joined #RubyOnRails
[16:26:13] tbuehlmann_: dretnx: shopify does 80k r/s, not sure if that is large traffic?
[16:26:17] havenwood: dretnx: yeah, sure
[16:30:15] deur-: brent__: in our company we usually make sure we have Mail::Message instances returned in our ActionMailer::Base classes, so we can assert mail contents against Mail::Message#html_part.body and Mail::Message#text_part.body
[16:31:55] brent__: So these specs where more about testing email preferences and if an email is sent based on a user attribute
[16:32:22] brent__: And they made a Mocked Mailer class, and didn't create any mailer templates
[16:32:59] brent__: now with a rails upgrade they throw a missing template error, would ideally like to find a way to stub out that template to keep the specs the same
[16:34:25] dviola: has joined #RubyOnRails
[16:34:33] brent__: I found a method called 'stub_template' but I get a no method error when trying to use it
[16:37:57] deur-: brent__: hmm, assuming you're using rspec, you could also do something like: expect(subject).to receive(:mail).with(html_content: anything).exactly(1).times
[16:38:07] deur-: mock the entire mail method, removing the need to mock template contents
[16:38:52] deur-: while still making sure the mail method gets called with whatever params you deem correct
[16:39:37] jhfisc: has joined #RubyOnRails
[16:39:37] guacamole: has joined #RubyOnRails
[16:42:14] brent__: deur-: So i'm thinking that may not correctly check if the mail is sent or not?
[16:43:12] brent__: I'm not super familiar w/ mailer, but it looks #mail is always called, and inside mail it's determined if it's sent or not
[16:43:42] jhfisc: has joined #RubyOnRails
[16:45:39] deur-: brent__: that's right; mail itself is nullified. if you're testing if a send will get triggered based on a user attribute, you're not actually testing the delivery. in these cases I usually trust Rails enough that #mail will do its thing
[16:46:02] deur-: assuming you provide the params it sends with, and those match
[16:48:39] deur-: it's possible you might be able to stub stuff out of Mail::Message or other related mailer classes directly, but then you'd have to look at the Rails source
[16:48:50] deur-: not too familiar with that myself
[16:51:33] kies: has joined #RubyOnRails
[16:54:51] jhfisc: has joined #RubyOnRails
[17:00:49] jhfisc: has joined #RubyOnRails
[17:00:56] brent__: deur-: Yeah, seems like I would need to dig into #mail a bit. Thanks
[17:03:04] one_zero: has joined #RubyOnRails
[17:03:48] jhfisc: has joined #RubyOnRails
[17:08:35] hahuang65: has joined #RubyOnRails
[17:09:54] rakm: has joined #RubyOnRails
[17:11:30] dretnx: has left #RubyOnRails: ()
[17:11:40] lessless: has joined #RubyOnRails
[17:15:03] jhfisc: has joined #RubyOnRails
[17:15:59] gusrub: has joined #RubyOnRails
[17:18:44] fschuindt: has joined #RubyOnRails
[17:20:18] jhfisc: has joined #RubyOnRails
[17:24:30] ocpysh: has joined #RubyOnRails
[17:25:29] gusrub: has joined #RubyOnRails
[17:26:06] jhfisc: has joined #RubyOnRails
[17:26:22] username1: has joined #RubyOnRails
[17:28:55] jhfisc: has joined #RubyOnRails
[17:29:16] conta: has joined #RubyOnRails
[17:36:19] one_zero: has joined #RubyOnRails
[17:37:01] jhfisc: has joined #RubyOnRails
[17:41:46] gusrub: has joined #RubyOnRails
[17:42:53] jhfisc: has joined #RubyOnRails
[17:49:26] hahuang65: has joined #RubyOnRails
[17:51:39] Or1on: has joined #RubyOnRails
[17:53:53] banisterfiend: has joined #RubyOnRails
[17:58:46] jhfisc: has joined #RubyOnRails
[18:04:12] jhfisc: has joined #RubyOnRails
[18:06:11] Aherin: has joined #RubyOnRails
[18:06:40] mikecmpbll: has joined #RubyOnRails
[18:12:17] quirkycoders: has joined #RubyOnRails
[18:14:44] jhfisc: has joined #RubyOnRails
[18:15:24] ocpysh: has joined #RubyOnRails
[18:18:29] jhfisc: has joined #RubyOnRails
[18:26:17] jhfisc: has joined #RubyOnRails
[18:31:44] dustinm`: has joined #RubyOnRails
[18:32:59] S1kx: has joined #RubyOnRails
[18:34:46] Uranio: has joined #RubyOnRails
[18:43:41] irishfromua: has joined #RubyOnRails
[18:45:06] NoGodDamnIdea: has joined #RubyOnRails
[18:54:51] jhfisc: has joined #RubyOnRails
[19:00:10] banisterfiend: has joined #RubyOnRails
[19:08:29] banisterfiend: has joined #RubyOnRails
[19:08:33] jhfisc: has joined #RubyOnRails
[19:17:57] weaksauce: has joined #RubyOnRails
[19:25:59] kies: has joined #RubyOnRails
[19:35:30] conta: guys, webpacker question: I added bulma via yarn add bulma, but no idea how to require it. when I do `@import '~bulma'` in my app.css I get error that it does not exist
[19:35:53] rakm: has joined #RubyOnRails
[19:36:05] conta: I am tryint to follow this: https://github.com/rails/webpacker#add-bootstrap
[19:37:01] jhfisc: has joined #RubyOnRails
[19:42:36] jhfisc: has joined #RubyOnRails
[19:43:04] srinidhi: has joined #RubyOnRails
[19:47:27] banisterfiend: has joined #RubyOnRails
[19:48:53] jhfisc: has joined #RubyOnRails
[19:50:24] alfiemax: has joined #RubyOnRails
[19:51:12] brent__: i'm struggling with trying to mock a method call
[19:51:48] brent__: allow(user).to receive(:can?) { false }, throws an error saying user_object... doest not implement: can?
[19:52:06] brent__: its weird as this worked yesterday, but is now throwing this error
[19:52:20] brent__: if i put a by bug right before the allow, i can run the can? method on user
[19:54:50] jhfisc: has joined #RubyOnRails
[19:56:25] mlt-: has joined #RubyOnRails
[19:57:00] mlt-: What is the best place to add some platform specific ENV changes? I need to add a couple of things to ENV['PATH'] on Windows
[19:57:04] mlt-: for rake test
[19:58:44] mlt-: Shall I do the platform check and modifications in config\environments\test.rb ? Or in test\test_helper.rb ?
[19:58:50] zacts: has joined #RubyOnRails
[19:59:54] mlt-: It would be nice to make it configurable. I'm using foreman, but AFAIK recent versions don't use dotenv. What would be the appropriate way to externalize PATH modification to run rake test on Windows?
[20:00:46] jhfisc: has joined #RubyOnRails
[20:02:39] samosa: has joined #RubyOnRails
[20:03:04] samosa: has left #RubyOnRails: ()
[20:09:39] ocpysh: has joined #RubyOnRails
[20:11:05] ocpysh: how can I display input specific errors?
[20:11:56] ocpysh: e.g: https://gist.github.com/anonymous/1b58f550de1d7fe575a19ef59e4d5d42
[20:15:21] jhfisc: has joined #RubyOnRails
[20:20:15] jhfisc: has joined #RubyOnRails
[20:23:27] mlt-: ocpysh: Do you want something to show up next to a field?
[20:23:34] mlt-: Try simple_form_for
[20:23:46] ocpysh: mlt- : yep
[20:23:51] ocpysh: well, that's a gem ..
[20:24:00] ocpysh: I read I shouldn't start with it.
[20:24:05] ocpysh: I'm new to rails.
[20:24:05] mlt-: ocpysh: you'd need extra code to hold a message
[20:24:21] ocpysh: yeah, I'm not sure how to "catch" that error though.
[20:24:26] mlt-: Just give a try to simple_form
[20:24:33] Frem: has joined #RubyOnRails
[20:24:52] ocpysh: isn't it better to learn to use rails form thing? :P
[20:25:03] mlt-: It is too verbose
[20:25:47] jhfisc: has joined #RubyOnRails
[20:25:57] ur5us: has joined #RubyOnRails
[20:30:48] mlt-: ocpysh: If you want to do it the hard way https://stackoverflow.com/a/5647026/673826 ... also note that error_message_for is for whatever reason deprecated... but in that Q there is another A with workaround
[20:31:20] jhfisc: has joined #RubyOnRails
[20:37:10] ocpysh: what a shame error_message_on has been removed.
[20:38:35] beilabs: has joined #RubyOnRails
[20:41:19] konsolebox: has joined #RubyOnRails
[20:42:51] mlt-: ocpysh: Did you see the workaround?
[20:43:11] mlt-: or..just use simple_form :-)
[20:43:55] jhfisc: has joined #RubyOnRails
[20:48:09] fryguy: how can I set up capybara integration tests so that I can be in a binding.pry and still interact with the server without blocking?
[20:48:53] jhfisc: has joined #RubyOnRails
[20:57:33] jhfisc: has joined #RubyOnRails
[21:01:40] KeyJoo: has joined #RubyOnRails
[21:02:19] laphoraig92: has joined #RubyOnRails
[21:02:53] jhfisc: has joined #RubyOnRails
[21:15:27] jhfisc: has joined #RubyOnRails
[21:21:07] ocpysh: has joined #RubyOnRails
[21:27:22] funburn: has joined #RubyOnRails
[21:29:58] funburn: has joined #RubyOnRails
[21:31:30] mtkd: has joined #RubyOnRails
[21:32:47] funburn: has joined #RubyOnRails
[21:34:59] funburn: has joined #RubyOnRails
[21:39:56] funburn: has joined #RubyOnRails
[21:40:12] rail5: has joined #RubyOnRails
[21:44:23] funburn: has joined #RubyOnRails
[21:48:13] jhfisc: has joined #RubyOnRails
[21:48:15] funburn_: has joined #RubyOnRails
[21:51:49] funburn: has joined #RubyOnRails
[21:55:04] rail5: Hey! I have a model for retrieving data which is used by a few other models during their :before_create callbacks. I need a method to retrieve the data from the database and then format it in a certain way. Where would be the best place to put such a method? Should I just put it in the model as a class method or is there a nicer way?
[21:56:51] jhfisc: has joined #RubyOnRails
[21:59:37] ocpysh: mlt-: this fixed it https://gist.github.com/anonymous/f9aeaf879e977a2f8a8107d16a732a3d
[21:59:59] jrabe: has joined #RubyOnRails
[22:03:28] jhfisc: has joined #RubyOnRails
[22:14:33] korvak: has joined #RubyOnRails
[22:16:12] jhfisc: has joined #RubyOnRails
[22:16:31] gil_: has joined #RubyOnRails
[22:19:45] conta1: has joined #RubyOnRails
[22:22:31] jhfisc: has joined #RubyOnRails
[22:24:52] nahtnam: has joined #RubyOnRails
[22:28:49] jhfisc: has joined #RubyOnRails
[22:29:43] fschuindt: has joined #RubyOnRails
[22:30:15] emers2n: has joined #RubyOnRails
[22:34:51] jhfisc: has joined #RubyOnRails
[22:49:05] jhfisc: has joined #RubyOnRails
[22:54:50] jhfisc: has joined #RubyOnRails
[22:59:37] RahulT: has joined #RubyOnRails
[23:00:01] jhfisc: has joined #RubyOnRails
[23:08:04] brent__: has joined #RubyOnRails
[23:11:00] beilabs: has joined #RubyOnRails
[23:12:21] jhfisc: has joined #RubyOnRails
[23:16:08] RahulT: has joined #RubyOnRails
[23:18:59] jrabe: has joined #RubyOnRails
[23:22:16] SteenJobs_: has joined #RubyOnRails
[23:26:56] jhfisc: has joined #RubyOnRails
[23:34:10] rahult_: has joined #RubyOnRails
[23:34:50] jhfisc: has joined #RubyOnRails
[23:37:51] jhfisc: has joined #RubyOnRails
[23:42:51] jhfisc: has joined #RubyOnRails
[23:47:35] ur5us: has joined #RubyOnRails
[23:55:36] jhfisc: has joined #RubyOnRails
[23:59:53] mostlybadfly: has joined #RubyOnRails