jscheel

Activity Graph

Page 1 of 2 | Next »

2019-08-14

[15:14:26] jscheel: has joined #RubyOnRails
[20:24:54] jscheel: Quit: jscheel

2018-10-18

[13:47:10] jscheel: has joined #RubyOnRails
[14:19:30] jscheel: Quit: jscheel

2018-08-17

[01:29:45] jscheel: has joined #RubyOnRails
[01:29:57] jscheel: Client Quit

2018-06-01

[12:58:14] jscheel: has joined #RubyOnRails
[15:18:54] jscheel: Quit: jscheel

2018-05-31

[17:04:54] jscheel: has joined #RubyOnRails
[18:22:20] jscheel: Quit: jscheel
[19:43:45] jscheel: has joined #RubyOnRails
[21:24:29] jscheel: Quit: jscheel
[21:56:25] jscheel: has joined #RubyOnRails
[23:25:59] jscheel: Quit: jscheel

2018-01-11

[18:45:04] jscheel: has joined #RubyOnRails
[22:57:42] jscheel: Quit: jscheel

2017-10-17

[21:39:52] jscheel: has joined #RubyOnRails
[21:40:33] jscheel: Client Quit

2017-10-10

[00:44:02] jscheel: Quit: jscheel
[02:17:54] jscheel: has joined #RubyOnRails
[02:24:14] jscheel: Quit: jscheel

2017-10-09

[21:11:08] jscheel: has joined #RubyOnRails

2017-08-06

[00:04:13] jscheel: Quit: jscheel
[00:15:30] jscheel: has joined #RubyOnRails
[00:16:49] jscheel: dang internet cut out, dunno if anyone answerd me, but it looks like the callbacks are not called on a has_many :through
[00:25:21] jscheel: Quit: jscheel
[00:25:55] jscheel: has joined #RubyOnRails
[00:33:40] jscheel: Quit: jscheel
[00:35:29] jscheel: has joined #RubyOnRails
[01:05:59] jscheel: Quit: jscheel
[02:16:15] jscheel: has joined #RubyOnRails
[02:46:57] jscheel: Quit: jscheel
[02:55:39] jscheel: has joined #RubyOnRails
[04:17:51] jscheel: Quit: jscheel
[04:42:27] jscheel: has joined #RubyOnRails
[04:42:32] jscheel: Client Quit

2017-08-05

[23:55:23] jscheel: has joined #RubyOnRails
[23:56:53] jscheel: I’m confused about association callbacks and the push method. If a Movie has_many Reviews, and I call `movie.reviews << review`, why do my association callbacks not get called?

2017-07-30

[03:10:50] jscheel: Quit: jscheel

2017-07-29

[14:36:30] jscheel: has joined #RubyOnRails
[14:50:40] jscheel: Quit: jscheel
[14:52:23] jscheel: has joined #RubyOnRails
[14:58:24] jscheel: Quit: jscheel
[15:19:59] jscheel: has joined #RubyOnRails
[15:38:06] jscheel: Quit: jscheel
[16:39:44] jscheel: has joined #RubyOnRails
[17:34:49] jscheel: Quit: jscheel
[18:40:08] jscheel: has joined #RubyOnRails

2017-07-28

[02:17:14] jscheel: has joined #RubyOnRails
[03:11:14] jscheel: Quit: jscheel
[03:21:30] jscheel: has joined #RubyOnRails
[03:34:44] jscheel: Quit: jscheel
[03:37:02] jscheel: has joined #RubyOnRails
[03:53:28] jscheel: Quit: jscheel
[03:54:02] jscheel: has joined #RubyOnRails
[04:01:12] jscheel: Quit: jscheel
[04:06:20] jscheel: has joined #RubyOnRails
[04:15:52] jscheel: Quit: jscheel
[04:16:50] jscheel: has joined #RubyOnRails
[04:35:44] jscheel: Quit: jscheel
[05:05:34] jscheel: has joined #RubyOnRails
[05:05:35] jscheel: Client Quit
[13:29:02] jscheel: has joined #RubyOnRails
[22:26:19] jscheel: Quit: jscheel
[22:26:50] jscheel: has joined #RubyOnRails
[22:27:07] jscheel: Client Quit
[22:27:35] jscheel: has joined #RubyOnRails
[22:27:59] jscheel: Client Quit
[22:28:30] jscheel: has joined #RubyOnRails
[22:28:43] jscheel: Client Quit

2017-07-27

[13:51:17] jscheel: has joined #RubyOnRails
[16:39:20] jscheel: sylario: I’ve got a followup to my question about association callbacks from yesterday. Since ActiveRecord adds a bunch of magic methods to has_many associations (e.g. collection=, collection_ids=, collection<<, etc), is there a way to hook into the changes after they are all finished? For example, if I do group.user_ids = [1,2,3,4], I don’t necessarily want to fire a callback each time, vs. firing it once after all of the users are a
[16:39:50] jscheel: granted, I know that a service object that manages this would clean that up, but it still feels like there are so many “magic” ways to add records to an association
[22:56:37] jscheel: Ping timeout: 246 seconds
[22:59:20] jscheel: has joined #RubyOnRails
[23:27:29] jscheel: Quit: jscheel

2017-07-26

[02:48:07] jscheel: has joined #RubyOnRails
[04:22:14] jscheel: Quit: jscheel
[13:40:14] jscheel: has joined #RubyOnRails
[18:53:32] jscheel: I have a jank question. Is there a way to force a model to be created/destroyed via a relationship? I have Group and GroupMembership. I have association callbacks that need to run whenever a group membership is added to or removed from the collection. But, if another dev writes code to simply destroy the GroupMembership, instead of removing it from the group’s collection of group memberships, the association callback won’t be fired. I
[18:53:33] jscheel: could add the code in both the Group’s after_remove and in the GroupMembership’s after_destroy, since only one or the other will be called, but that doesn’t work with adding, since after_add on the association and after_create on the model are both called.
[18:55:50] jscheel: sylario: using dependent: :destroy on which part?
[18:56:45] jscheel: sylario: right, but I don’t want to destroy the Group if the GroupMembership is destroyed
[18:57:41] jscheel: and I already have Group has_many :group_memberships, dependent: :destroy
[19:01:22] jscheel: sylario: I’m slowly trying to move all of this to a service
[19:01:56] jscheel: there’s actually 5 other pieces to the puzzle, with lots of polymorphic HABTM thrown in to make it super fun
[19:02:12] jscheel: trying to unwrap everything, because it’s all tied up in activerecord callbacks
[19:04:08] jscheel: so, there is a resources route for group, and it appears that the update is simply whatever rails provides by default, because there is nothing defined in the controller
[19:05:22] jscheel: and when a member of the group is added, the callbacks fire as expected. But, when a member of the group is removed, only the association callbacks defined on Group are called, the after_destroy callback on GroupMembership is not called. I seem to recall this being a specific design choice by the rails team. Am I crazy?
[19:06:06] jscheel: sylario: this ring a bell? https://stackoverflow.com/a/11341113
[19:14:26] jscheel: sylario: yes, I understand that. I’m talking about setting the collection. According to the docs (http://edgeapi.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html) setting the collection should trigger callbacks if the :through option is set, but not the destroy callbacks. Setting dependet destroy should override this behavior.
[19:14:54] jscheel: (search for “collection=objects” on page)
[19:48:02] jscheel: thanks for your help sylario
[22:24:24] jscheel: Quit: jscheel

2017-07-25

[14:08:59] jscheel: has joined #RubyOnRails
[22:12:29] jscheel: Quit: jscheel

2017-07-24

[19:00:31] jscheel: has joined #ruby
[19:00:31] jscheel: has joined #RubyOnRails
[19:06:47] jscheel: Hi all. I’m trying to figure out if there is a better way to have mixins that utilize something defined in their destination. Right now I simply have a method on the mixin that raises an expection, and I implement that method in the target class that receives the mixin. I don’t really think that’s the cleanest way to do it though. Here’s a really simple example of what I am trying to figure out:
[19:06:48] jscheel: https://gist.github.com/jscheel/2346b49226cbce316403ecf7df4383e5. Any opinions?
[19:16:58] jscheel: zenspider: ok, so same approach then (but with better error)
[19:18:25] jscheel: hehe, it’s been a while since I’ve worked in a language with true abstract methods :)
[19:19:47] jscheel: ok, thanks for looking zenspider and Papierkorb, glad to know I’m not totally crazy
[22:43:53] jscheel: Quit: jscheel

2017-07-06

[04:15:59] jscheel: has joined #RubyOnRails
[04:30:47] jscheel: Quit: jscheel
[13:19:13] jscheel: has joined #RubyOnRails
[16:47:40] jscheel: Quit: jscheel
[17:35:40] jscheel: has joined #RubyOnRails
[21:25:55] jscheel: Quit: jscheel

2017-07-05

[18:28:45] jscheel: has joined #RubyOnRails
[18:28:46] jscheel: Client Quit
[18:50:42] jscheel: has joined #RubyOnRails
[20:16:47] jscheel: Ping timeout: 260 seconds
[20:17:39] jscheel: has joined #RubyOnRails
[22:12:54] jscheel: Quit: jscheel

2017-06-30

[13:56:58] jscheel: has joined #RubyOnRails
[14:04:45] jscheel: Read error: Connection reset by peer
[14:05:01] jscheel: has joined #RubyOnRails
[18:12:21] jscheel: Quit: jscheel

2017-06-29

[20:58:47] jscheel: has joined #RubyOnRails
[22:48:31] jscheel: Read error: Connection reset by peer
[22:48:43] jscheel: has joined #RubyOnRails
[23:14:08] jscheel: Ping timeout: 260 seconds

2017-05-08

[07:50:35] jscheel: Client Quit
[07:50:35] jscheel: has joined #RubyOnRails

2017-05-07

[15:47:21] jscheel: has joined #RubyOnRails
[17:23:22] jscheel: Quit: jscheel

2017-04-18

[09:07:56] jscheel: has joined #RubyOnRails
[11:56:35] jscheel: Ping timeout: 240 seconds
[11:57:11] jscheel: has joined #RubyOnRails
[12:43:52] jscheel: Quit: jscheel
[12:51:47] jscheel: has joined #RubyOnRails
[12:52:04] jscheel: Client Quit

2017-04-11

[13:35:40] jscheel: has joined #RubyOnRails
[13:39:46] jscheel: Client Quit

2017-04-01

[13:16:02] jscheel: Quit: jscheel

2017-03-31

[04:57:14] jscheel: has joined #RubyOnRails
[04:58:49] jscheel: Client Quit
[06:53:15] jscheel: has joined #RubyOnRails
[08:04:45] jscheel: Read error: Connection reset by peer
[08:11:59] jscheel: has joined #RubyOnRails
[08:22:35] jscheel: Read error: Connection reset by peer
[16:37:10] jscheel: has joined #RubyOnRails

2017-03-07

[15:01:16] jscheel: has joined #ruby
[15:01:16] jscheel: has joined #RubyOnRails
[15:34:46] jscheel: Quit: jscheel
[15:37:05] jscheel: has joined #RubyOnRails
[15:47:04] jscheel: Quit: jscheel
[16:45:22] jscheel: has joined #RubyOnRails
[18:06:18] jscheel: Quit: jscheel

2016-07-28

[19:29:07] jscheel: has joined #RubyOnRails
[21:03:31] jscheel: Ping timeout: 250 seconds
[21:06:58] jscheel: Client Quit
[21:06:58] jscheel: has joined #RubyOnRails

2016-06-27

[00:31:25] jscheel: has joined #RubyOnRails
[00:32:02] jscheel: Client Quit
[05:39:33] jscheel: has joined #RubyOnRails
[06:46:00] jscheel: Quit: jscheel

2016-06-25

[02:49:32] jscheel: has joined #RubyOnRails
[03:04:45] jscheel: Quit: jscheel
[03:56:26] jscheel: has joined #RubyOnRails
[03:59:11] jscheel: Client Quit

2016-06-24

[21:25:29] jscheel: has joined #RubyOnRails
[21:33:21] jscheel: Quit: jscheel

2016-06-23

[14:25:00] jscheel: has joined #RubyOnRails
[14:35:13] jscheel: Quit: jscheel

2016-06-20

[13:46:02] jscheel: has joined #RubyOnRails
[15:14:21] jscheel: Quit: jscheel

2016-06-19

[16:17:39] jscheel: has joined #RubyOnRails
[17:07:07] jscheel: Quit: jscheel
[17:37:36] jscheel: has joined #RubyOnRails
[17:52:41] jscheel: Quit: jscheel

2016-06-18

[13:10:44] jscheel: has joined #RubyOnRails
[13:49:59] jscheel: Quit: jscheel

2016-06-17

[14:26:06] jscheel: has joined #RubyOnRails
[14:50:30] jscheel: Quit: jscheel

2016-05-19

[13:54:50] jscheel: has joined #RubyOnRails
[13:58:39] jscheel: Client Quit

2016-05-18

[00:35:18] jscheel: Quit: jscheel
[01:51:25] jscheel: has joined #RubyOnRails
[02:00:42] jscheel: Quit: jscheel
[02:15:59] jscheel: has joined #RubyOnRails
[05:55:38] jscheel: Quit: jscheel
[05:56:25] jscheel: Client Quit
[05:56:25] jscheel: has joined #RubyOnRails
[12:40:54] jscheel: has joined #RubyOnRails
[13:26:33] jscheel: Quit: jscheel
[14:17:09] jscheel: has joined #RubyOnRails
[22:45:52] jscheel: Quit: jscheel

2016-05-17

[21:54:31] jscheel: has joined #RubyOnRails

2016-04-22

[03:48:45] jscheel: has joined #RubyOnRails
[03:49:52] jscheel: hi all! Is there any way for a model to know when one of it’s associations has saved? So, blog has_many posts, callback for blog when post is persisted?
[03:51:58] jscheel: roamingdog: oh, interesting, so it’s touching the parent
[03:52:43] jscheel: roamingdog: no sorry, was a dumb question, brain is mush today
[03:58:15] jscheel: roamingdog: hehe, it’s a rabbit hole :) parent has after_add callback on association that creates some other models in a different association. I need them to save if the child from the first association is built, then saved
[03:58:38] jscheel: problem is that the after_add association callback only cares about something getting added in memory
[03:58:43] jscheel: it doesn’t care about persistence
[03:59:12] jscheel: apparently there was some debate about this several years ago, but it didn’t come to anything
[04:00:08] jscheel: roamingdog: it’s an association callback
[04:02:17] jscheel: hmm, I don’t think touch actually fires callbacks
[04:04:27] jscheel: oh, a subset of callbacks
[04:06:01] jscheel: for the touch callbacks?
[04:06:12] jscheel: http://apidock.com/rails/ActiveRecord/Persistence/touch
[04:06:33] jscheel: “after_touch, after_commit and after_rollback callbacks are executed”
[04:12:12] jscheel: roamingdog: no, I got it working with after_touch, I think
[04:12:16] jscheel: running specs now
[07:54:39] jscheel: Quit: jscheel
[13:57:34] jscheel: has joined #RubyOnRails
[20:16:10] jscheel: Quit: jscheel

2016-04-02

[00:48:17] jscheel: Quit: jscheel
[01:03:13] jscheel: has joined #RubyOnRails
[01:11:07] jscheel: Quit: jscheel
[01:56:28] jscheel: has joined #RubyOnRails
[09:28:40] jscheel: Quit: jscheel
[19:12:56] jscheel: has joined #RubyOnRails
[19:53:20] jscheel: Quit: jscheel
[22:24:48] jscheel: has joined #RubyOnRails
[22:55:47] jscheel: Quit: jscheel

2016-04-01

[02:59:35] jscheel: has joined #RubyOnRails
[03:02:42] jscheel: Client Quit
[03:03:15] jscheel: has joined #RubyOnRails
[03:05:54] jscheel: Read error: Connection reset by peer
[03:06:17] jscheel: has joined #RubyOnRails
[03:09:54] jscheel: Client Quit
[14:59:09] jscheel: has joined #RubyOnRails
[19:57:59] jscheel: Quit: jscheel
[20:08:22] jscheel: has joined #RubyOnRails

2016-03-31

[20:57:22] jscheel: has joined #RubyOnRails
[21:07:09] jscheel: Hi all! I have an association that is created on after_commit. Normally the parent is saved, which persists the associated models too, but I also need to ensure the associated models are persisted when just parent.update_attributes is called. What’s the best way to do this?
[21:14:59] jscheel: smathy: ok, so I added autosave to the association
[21:16:06] jscheel: smathy: ticket has_many actions. called `ticket.update_attributes(state: ‘closed’)`, but association still shows unpersisted
[21:22:11] jscheel: smathy: ah, I think I have it. The association was legitimatly invalid
[23:00:49] jscheel: Quit: jscheel

2016-03-24

[20:20:29] jscheel: has joined #RubyOnRails
[20:52:42] jscheel: Quit: jscheel
[22:24:22] jscheel: has joined #RubyOnRails
[22:46:39] jscheel: Quit: jscheel

2016-03-15

[14:42:30] jscheel: has joined #RubyOnRails
[21:07:50] jscheel: Quit: jscheel
[21:24:37] jscheel: has joined #RubyOnRails
[21:25:00] jscheel: Client Quit

2016-03-09

[13:41:08] jscheel: has joined #RubyOnRails
[18:34:57] jscheel: Quit: jscheel

2016-03-08

[18:06:50] jscheel: has joined #RubyOnRails
[18:46:35] jscheel: Quit: jscheel