<    March 2017    >
Su Mo Tu We Th Fr Sa  
          1  2  3  4  
 5  6  7  8  9 10 11  
12 13 14 15 16 17 18  
19 20 21 22 23 24 25  
26 27 28 29 30 31
00:46 glennpratt joined
02:19 glennpratt joined
02:21 d762b440__ joined
02:33 jeremyevans joined
03:34 filterfish joined
03:35 filterfish joined
03:39 glennpratt joined
03:41 glennpra_ joined
04:55 aidalgol joined
04:56 aidalgol joined
05:26 jaequery joined
05:42 cyclotron3k joined
05:44 <cyclotron3k> Just a heads up, google search results seem to be sending me to the https:// version of sequel.jeremyevans.net, which results in the huge "this page is insecure" warning
05:44 <cyclotron3k> because the certificate is issued to github
06:26 glennpratt joined
06:44 filterfish joined
06:52 glennpratt joined
07:02 glennpratt joined
07:13 filterfish_ joined
07:14 filterfish_ joined
07:24 bougyman joined
07:24 bougyman joined
08:21 glennpratt joined
08:22 glennpra_ joined
08:48 ta_ joined
09:52 filterfish_ joined
10:10 glennpratt joined
11:04 glennpratt joined
12:52 glennpratt joined
13:46 glennpratt joined
14:38 glennpratt joined
15:21 ben___ joined
15:26 be_______ joined
17:23 glennpratt joined
17:48 <adam12> jeremyevans: I've been using model_instance.raise_on_save_failure = true for a lot of places I'd normally use `save!` in AR. I checked the docs but either it doesn't exist or I glazed over it - there isn't a save!/create! AR equivalent in Sequel right? I'd have to make my own?
18:03 <Caesium> bear in mind the save function also accepts an opts hash, and one opt is raise_on_failure
18:04 <jeremyevans> adam12: Sequel's default is to raise on save failure. If you are changing it to false by default, you may want to define your own save! method that sets it to true and then saves
18:04 <Caesium> so you could define your own save! that simply merges that into any opts passed
18:04 <adam12> Caesium: I didn't know that. Good to know.
18:04 <Caesium> is here: https://sequel.jeremyevans.net/rdoc/classes/Sequel/Model/InstanceMethods.html#method-i-save
18:04 <adam12> jeremyevans: I'll likely define my own method - was just curious if I missed the bang-version of save.
18:05 <jeremyevans> adam12: You don't want to use leave the default as raising on save failure?
18:06 <jeremyevans> adam12: Not raising on save failure is a likely source of bugs unless you are checking the return value in all callers
18:06 <adam12> Hmm. In the past it's caused me issues
18:06 <adam12> So I normally do a traditional `if model.save`
18:06 <jeremyevans> adam12: I know when I switched to raising on save failure by default, I found multiple bugs in my applications where I was silently ignoring the return value
18:06 <adam12> Do you have a better pattern? Request/Response web app style.
18:07 <jeremyevans> adam12: `if model.save` is fine. As long as you always use that and never use model.save by itself, you should be OK.
18:07 <adam12> I have been, other than manually setting raise_on_save_failure.
18:08 <adam12> I'm not adverse to raising exceptions, but then I need a rescue block to handle this in my routes
18:08 <jeremyevans> adam12: I usually use handle_validation_failure do model.save ; ... end; with handle_validation_failure rescuing Sequel::ValidationFailed and handling the validation failure by redisplaying the form (begin/rescue/end is also fine for simple cases)
18:09 <adam12> jeremyevans: Is this in one of your OSS projects? It seems simple enough to implement myself, but curious on yours.
18:09 <jeremyevans> adam12: Internally, Sequel raises an exception for all save failures, so it's not like raise_on_save_failure = false is faster
18:09 <adam12> Ah. I didn't know that - I usually avoid exceptions for flow control, which this is .. kinda borderline of?
18:10 <adam12> So you're saying hadnle_validation_failure is a yield with a rescue?
18:11 <jeremyevans> adam12: yes, yield rescue. Whether this is borderline/smell depends on whether you consider the condition exceptional
18:11 <adam12> Yeah - I'm not saying either way. I might try your method
18:11 <jeremyevans> adam12: I consider failures to save exceptional. Otherwise you are forced to check return values of all method calls, which isn't the ruby way
18:12 <adam12> I'm still figuring out Sequel, for the most part.
18:16 <adam12> jeremyevans: I'm gonna try your way. Thanks for suggestion. You too Caesium.
18:35 mewp joined
19:13 GitHub54 joined
19:13 <GitHub54> [13sequel] 15jeremyevans pushed 9 new commits to 06master: 02https://git.io/vy74y
19:13 <GitHub54> 13sequel/06master 144e70c60 15Jeremy Evans: Change deprecation warning to mention Sequel 5...
19:13 <GitHub54> 13sequel/06master 14b323454 15Jeremy Evans: Deprecate Sequel.cache_anonymous_models and Sequel.cache_anonymous_models=...
19:13 <GitHub54> 13sequel/06master 1438a9022 15Jeremy Evans: Remove per-model-class mutex for loading of anonymous model classes...
19:13 GitHub54 left
20:03 glennpratt joined
20:31 ta_ joined
21:05 ta_ joined
23:40 glennpratt joined