jstrong

Activity Graph

Page 1 of 23 | Next »

2019-07-13

[00:29:20] jstrong: has joined #RubyOnRails
[00:39:52] jstrong: Quit: jstrong
[01:32:02] jstrong: has joined #RubyOnRails
[01:42:44] jstrong: Quit: jstrong
[02:39:53] jstrong: has joined #RubyOnRails
[02:50:05] jstrong: Quit: jstrong
[02:53:49] jstrong: has joined #RubyOnRails
[03:04:02] jstrong: Quit: jstrong
[03:12:56] jstrong: has joined #RubyOnRails
[03:24:48] jstrong: Quit: jstrong

2019-07-12

[01:48:02] jstrong: Quit: jstrong
[01:48:32] jstrong: has joined #RubyOnRails
[03:19:07] jstrong: Quit: jstrong
[03:27:04] jstrong: has joined #RubyOnRails
[04:57:08] jstrong: Quit: jstrong
[04:59:03] jstrong: has joined #RubyOnRails
[05:22:37] jstrong: Quit: jstrong
[05:23:03] jstrong: has joined #RubyOnRails
[05:36:32] jstrong: Quit: jstrong
[05:37:30] jstrong: has joined #RubyOnRails
[05:46:39] jstrong: Quit: jstrong
[05:47:43] jstrong: has joined #RubyOnRails
[06:20:07] jstrong: Quit: jstrong
[06:20:40] jstrong: has joined #RubyOnRails
[07:23:29] jstrong: Quit: jstrong
[12:30:32] jstrong: has joined #RubyOnRails
[18:15:15] jstrong: Quit: jstrong
[18:29:57] jstrong: has joined #RubyOnRails
[21:26:35] jstrong: Quit: jstrong
[21:48:06] jstrong: has joined #RubyOnRails
[22:45:33] jstrong: Quit: jstrong

2019-07-11

[01:48:03] jstrong: has joined #RubyOnRails
[01:58:28] jstrong: Quit: jstrong
[01:59:00] jstrong: has joined #RubyOnRails
[02:09:19] jstrong: Quit: jstrong
[02:39:26] jstrong: has joined #RubyOnRails
[02:49:53] jstrong: Quit: jstrong
[03:17:14] jstrong: has joined #RubyOnRails
[03:29:01] jstrong: Quit: jstrong
[03:33:42] jstrong: has joined #RubyOnRails
[03:36:17] jstrong: Client Quit
[03:37:47] jstrong: has joined #RubyOnRails
[03:54:02] jstrong: Quit: jstrong
[13:50:46] jstrong: has joined #RubyOnRails
[14:12:33] jstrong: Quit: jstrong
[14:14:46] jstrong: has joined #RubyOnRails
[14:47:08] jstrong: Quit: jstrong
[14:56:06] jstrong: has joined #RubyOnRails
[14:59:43] jstrong: Client Quit
[15:01:15] jstrong: has joined #RubyOnRails
[21:37:50] jstrong: Quit: jstrong
[21:40:43] jstrong: has joined #RubyOnRails
[22:02:59] jstrong: Quit: jstrong
[22:06:21] jstrong: has joined #RubyOnRails
[22:31:25] jstrong: Quit: jstrong
[22:32:05] jstrong: has joined #RubyOnRails
[22:52:57] jstrong: Quit: jstrong
[22:54:22] jstrong: has joined #RubyOnRails

2019-07-10

[00:08:03] jstrong: Quit: jstrong
[00:09:14] jstrong: has joined #RubyOnRails
[00:35:59] jstrong: Quit: jstrong
[00:56:44] jstrong: has joined #RubyOnRails
[05:04:58] jstrong: Quit: jstrong
[05:21:05] jstrong: has joined #RubyOnRails
[05:50:39] jstrong: Quit: jstrong
[12:09:31] jstrong: has joined #RubyOnRails
[12:20:27] jstrong: Quit: jstrong
[12:23:16] jstrong: has joined #RubyOnRails
[12:34:04] jstrong: Quit: jstrong
[12:59:58] jstrong: has joined #RubyOnRails
[13:22:54] jstrong: Quit: jstrong
[13:24:51] jstrong: has joined #RubyOnRails
[14:54:09] jstrong: Quit: jstrong
[14:55:51] jstrong: has joined #RubyOnRails
[20:04:46] jstrong: Quit: jstrong
[20:16:42] jstrong: has joined #RubyOnRails
[20:27:31] jstrong: Quit: jstrong
[20:33:56] jstrong: has joined #RubyOnRails
[21:04:17] jstrong: Quit: jstrong
[21:05:59] jstrong: has joined #RubyOnRails
[22:37:27] jstrong: Quit: jstrong
[23:08:19] jstrong: has joined #RubyOnRails
[23:19:00] jstrong: Quit: jstrong
[23:24:54] jstrong: has joined #RubyOnRails
[23:35:37] jstrong: Quit: jstrong
[23:48:37] jstrong: has joined #RubyOnRails
[23:58:40] jstrong: Quit: jstrong

2019-07-09

[15:51:11] jstrong: has joined #RubyOnRails
[21:49:00] jstrong: Quit: jstrong
[22:04:27] jstrong: has joined #RubyOnRails
[22:20:35] jstrong: Quit: jstrong
[22:21:26] jstrong: has joined #RubyOnRails
[22:57:07] jstrong: Quit: jstrong
[22:58:32] jstrong: has joined #RubyOnRails
[23:08:47] jstrong: Quit: jstrong
[23:19:41] jstrong: has joined #RubyOnRails
[23:22:59] jstrong: Client Quit
[23:24:05] jstrong: has joined #RubyOnRails
[23:25:12] jstrong: Client Quit
[23:37:58] jstrong: has joined #RubyOnRails
[23:46:34] jstrong: Quit: jstrong
[23:51:10] jstrong: has joined #RubyOnRails

2019-05-29

[00:25:01] jstrong: has joined #RubyOnRails
[00:35:54] jstrong: Quit: jstrong
[00:36:29] jstrong: has joined #RubyOnRails
[00:46:39] jstrong: Quit: jstrong
[01:30:56] jstrong: has joined #RubyOnRails
[01:41:30] jstrong: Quit: jstrong
[02:01:24] jstrong: has joined #RubyOnRails
[03:27:12] jstrong: Quit: jstrong
[04:59:53] jstrong: has joined #RubyOnRails
[05:10:47] jstrong: Quit: jstrong
[06:21:46] jstrong: has joined #RubyOnRails
[06:32:37] jstrong: Quit: jstrong
[07:00:00] jstrong: has joined #RubyOnRails
[07:10:34] jstrong: Quit: jstrong
[07:27:21] jstrong: has joined #RubyOnRails
[07:37:30] jstrong: Quit: jstrong
[08:09:07] jstrong: has joined #RubyOnRails
[08:20:10] jstrong: Quit: jstrong
[10:18:57] jstrong: has joined #RubyOnRails
[10:29:08] jstrong: Quit: jstrong
[10:45:03] jstrong: has joined #RubyOnRails
[10:55:33] jstrong: Quit: jstrong
[10:56:57] jstrong: has joined #RubyOnRails
[11:07:57] jstrong: Quit: jstrong
[11:16:40] jstrong: has joined #RubyOnRails
[11:27:27] jstrong: Quit: jstrong
[12:12:12] jstrong: has joined #RubyOnRails
[12:22:31] jstrong: Quit: jstrong
[12:28:41] jstrong: has joined #RubyOnRails
[12:54:57] jstrong: Quit: jstrong

2019-05-28

[01:17:16] jstrong: Quit: jstrong
[04:41:04] jstrong: has joined #RubyOnRails
[05:42:55] jstrong: Quit: jstrong
[13:00:54] jstrong: has joined #RubyOnRails
[22:17:50] jstrong: Quit: jstrong
[22:19:00] jstrong: has joined #RubyOnRails
[23:06:38] jstrong: Quit: jstrong
[23:26:02] jstrong: has joined #RubyOnRails
[23:36:21] jstrong: Quit: jstrong
[23:40:00] jstrong: has joined #RubyOnRails
[23:54:59] jstrong: Quit: jstrong

2019-05-27

[20:36:48] jstrong: has joined #RubyOnRails
[20:37:03] jstrong: Hi, when using webpacker. should the @rails/webpacker package.json dependency go under “dependencies” or “devDependencies” ?

2019-05-26

[04:23:06] jstrong: has joined #RubyOnRails
[04:43:35] jstrong: Quit: jstrong
[11:45:10] jstrong: has joined #RubyOnRails
[12:13:10] jstrong: Ping timeout: 258 seconds
[12:35:56] jstrong: Quit: jstrong

2019-05-25

[00:05:32] jstrong: Quit: jstrong
[00:34:32] jstrong: has joined #RubyOnRails
[00:45:20] jstrong: Quit: jstrong
[01:44:47] jstrong: has joined #RubyOnRails
[04:48:27] jstrong: Quit: jstrong
[05:09:31] jstrong: has joined #RubyOnRails
[05:13:25] jstrong: Client Quit

2019-05-24

[14:52:04] jstrong: so I just avoid it entirely, just a personal preference. http://www.railstips.org/blog/archives/2008/12/01/unless-the-abused-ruby-conditional/
[15:14:23] jstrong: Is there a method in ruby run at class level after class has been fully evaluated/defined?
[15:15:29] jstrong: jhass: yeh, I thought so.
[15:15:51] jstrong: Here’s my use-case scenario. I want to be able to use a bunch of class methods referenced in the class body (kind of like validates_presence_of etc..)
[15:16:00] jstrong: which after all those methods are run it needs to create a new object
[15:18:10] jstrong: ahhh makes sense
[15:18:13] jstrong: jhass: thanks
[15:22:56] jstrong: jhass: for storing the state generated by using class body methods, is it common to use class variables?
[15:23:03] jstrong: i know they’re generally avoided but in this aprticular metaprogramming use case
[15:28:30] jstrong: jhass: like this? https://gist.github.com/laspluviosillas/6933a92c07497a91c83b610dd4875c7a
[15:31:21] jstrong: just simplified
[15:31:30] jstrong: how would you do getters/setters on the class instance itself?
[15:31:38] jstrong: obviosuly can define manually but wondering if there’s some “attr_accessor” equivalent
[15:35:29] jstrong: interesting
[15:36:01] jstrong: thanks for your help man
[15:36:49] jstrong: jhass: do you know what I’m doing wrong here? https://gist.github.com/laspluviosillas/48e5ebbcd911281e71d07140545c1dde
[15:39:04] jstrong: ah so I’d have to call search_class= explicitly
[15:41:31] jstrong: I love this
[15:58:54] jstrong: jhass: Sorry for so many questions, but if I wanted to loop through an array and then run a particular method inside a block once for each value in the array
[15:59:02] jstrong: is string interpolation the only option here?
[16:01:30] jstrong: jhass: one sec
[16:02:51] jstrong: https://gist.github.com/laspluviosillas/d346a2fadffad59dd5f6aa52aa15df8c
[16:03:26] jstrong: jhass: ^ I don’t think I can. do the syntax I’ve shown in the first section because the “define” method performs instance_eval which means that it’s going to evaluate everything inside the block as part of the instance
[16:03:30] jstrong: ignoring the stuff outside the block
[16:04:15] jstrong: so my thought was to build a string then just run eval(string) inside the “define” block
[16:06:04] jstrong: I’m not following the full context unfortunately
[16:09:57] jstrong: jhass: wait wtf it worked lol
[16:10:42] jstrong: that’s pretty cool
[16:23:55] jstrong: jhass: part of the issue here is I’m constrained to using the ‘define’ method as defined by the graphql gem
[16:26:31] jstrong: NVM got a solution
[17:02:45] jstrong: jhass: Thanks for your help. Because of your help. I converted this monstrosity: https://gist.github.com/laspluviosillas/e7389c096b2b3829d860d47c0402ec34
[17:02:59] jstrong: into this: https://gist.github.com/laspluviosillas/def7c5e000a5ecf1ef8e07ae95acf211
[17:04:11] jstrong: jhass: one last question. I noticed by using the &block format, it only works if I use “do ||"
[17:04:22] jstrong: what would I need to do to allow these “filters” to also accept { |args| } instead?
[17:04:24] jstrong: for one-liners
[17:06:23] jstrong: well but block_given? evals to false if I use braces
[17:06:24] jstrong: for some reason
[17:08:20] jstrong: jhass: haha, nice
[17:08:27] jstrong: so just gotta wrap the func call with ()
[17:34:07] jstrong: can I bind a block to a different context?
[17:36:01] jstrong: well I’ve got nested blocks
[17:36:08] jstrong: @filter_builder.instance_exec(types, &block) receives my “filters” list
[17:36:22] jstrong: sure one sec
[17:36:41] jstrong: let me trim it for ease of readability
[17:39:08] jstrong: havenwood: https://gist.github.com/laspluviosillas/d9d9d7e5ba055116002d23ac0f202e0a
[17:39:33] jstrong: line 5# on usage.rb. define_filters receives a block which it passes to the “FilterBuilder” defined in the BaseSearch class
[17:40:03] jstrong: which means that the block that “filter” receives is binded to FilterBuilder, when I really want it to be binded by the class that’s calling "define_filters"
[17:40:06] jstrong: binded to*
[17:40:23] jstrong: in this case the call to woof! throws NoMethodError woof! on FilterBuilder
[17:43:24] jstrong: I trimmed some of the fat that handles the nil cases
[17:43:36] jstrong: just for the purpose of slimming the code down
[17:43:56] jstrong: I see what you’re saying
[17:44:29] jstrong: havenwood: I also trimmed where Filter.eval is called, but it’s whenever Filter.eval is called that I would like the block that is evaluated to be binded to the different context.
[17:46:38] jstrong: yeah that’s roughly the idea
[17:50:21] jstrong: havenwood: can’t a lambda imitate a block somehow?
[17:56:02] jstrong: so you’re just explicitly passing the context in?
[17:56:35] jstrong: Nope. Really just need the context to be the higher class
[17:56:45] jstrong: Think like the lambda’s you can pass to Rails validation methods
[17:56:53] jstrong: you expect them to be able to run methods inside your ActiveRecord object
[17:56:57] jstrong: similar ordeal
[17:58:05] jstrong: I read online instance_exec = instance_eval except you can pass in more params
[17:58:10] jstrong: only reason I’m using instance_exec vs instance_eval
[17:59:03] jstrong: OK, I guess I can just scrap the “FilterBuilder” class entirely and define its methods directly on the class I want the binding to be on
[17:59:17] jstrong: just surprises me that there’s no way to explicitly set the binded context, I guess.
[18:01:30] jstrong: I was just encapsulating the functionality of building filters into a class because I thought it would be a good idea.
[18:01:40] jstrong: but really the “filters” themselves need to be available outside of “filter builder”
[18:01:55] jstrong: the real context of the “filters” is not filter builder but the BaseSearch class that is running FilterBuilder
[18:02:10] jstrong: so I’ll just nuke the “FilterBuilder” idea entirely, and separate code into modules if necessary
[18:04:50] jstrong: thanks for the help!
[20:18:38] jstrong: Quit: jstrong
[20:33:00] jstrong: has joined #RubyOnRails
[20:43:31] jstrong: Quit: jstrong
[20:49:10] jstrong: has joined #RubyOnRails
[21:24:01] jstrong: Quit: jstrong
[21:25:35] jstrong: has joined #RubyOnRails
[21:37:59] jstrong: Quit: jstrong
[21:39:51] jstrong: has joined #RubyOnRails
[22:15:14] jstrong: Quit: jstrong
[22:23:04] jstrong: has joined #RubyOnRails
[22:33:14] jstrong: Quit: jstrong
[23:13:55] jstrong: has joined #RubyOnRails
[23:27:26] jstrong: Quit: jstrong
[23:33:04] jstrong: has joined #RubyOnRails
[23:43:23] jstrong: Quit: jstrong
[23:49:11] jstrong: has joined #RubyOnRails