Activity Graph

Page 1 of 4 | Next »


[21:23:04] Takumo: Quit: WeeChat 1.9.1


[21:12:01] Takumo: has joined #RubyOnRails
[21:12:01] Takumo: has joined #ruby
[21:12:27] Takumo: Client Quit
[21:15:35] Takumo: has joined #RubyOnRails
[21:15:35] Takumo: has joined #ruby
[21:18:01] Takumo: Client Quit
[21:18:57] Takumo: has joined #RubyOnRails
[21:18:57] Takumo: has joined #ruby


[23:05:44] Takumo: Quit: WeeChat 1.4


[12:25:53] Takumo: *.net *.split
[12:27:19] Takumo: has joined #ruby
[12:27:33] Takumo: has joined #RubyOnRails
[15:01:24] Takumo: *.net *.split
[15:03:05] Takumo: has joined #RubyOnRails
[15:03:18] Takumo: has joined #ruby


[20:28:32] Takumo: *.net *.split
[20:29:47] Takumo: has joined #ruby
[20:29:57] Takumo: has joined #RubyOnRails


[06:34:46] Takumo: *.net *.split
[06:41:41] Takumo: has joined #ruby
[06:41:51] Takumo: has joined #RubyOnRails


[18:44:47] Takumo: *.net *.split
[18:52:23] Takumo: has joined #ruby
[18:52:33] Takumo: has joined #RubyOnRails


[06:15:32] Takumo: *.net *.split
[06:22:41] Takumo: has joined #ruby
[06:22:51] Takumo: has joined #RubyOnRails


[22:11:11] Takumo: has joined #ruby
[22:11:12] Takumo: has joined #RubyOnRails


[02:04:24] Takumo: Quit: WeeChat 1.4


[01:55:16] Takumo: *.net *.split
[01:56:18] Takumo: has joined #ruby
[01:56:28] Takumo: has joined #RubyOnRails


[12:06:33] Takumo: has joined #RubyOnRails
[12:06:33] Takumo: has joined #ruby


[04:13:20] Takumo: Quit: WeeChat 1.4


[14:02:38] Takumo: Hi all, I'm using the acts_as_nested_set gem, and need a way to find or create a record based on the ancestry in the set
[14:02:57] Takumo: i.e. if I have 'Foo/Bar/Baz' I want to find or create Baz, Bar and Foo in the tree
[14:04:48] Takumo: Is there a method to do this?


[05:06:18] Takumo: *.net *.split
[05:11:08] Takumo: has joined #ruby


[07:08:58] Takumo: Ping timeout: 246 seconds
[07:11:51] Takumo: has joined #ruby


[14:48:30] Takumo: *.net *.split
[14:55:03] Takumo: has joined #ruby


[20:31:12] Takumo: *.net *.split
[20:47:56] Takumo: has joined #ruby
[20:47:57] Takumo: has joined #RubyOnRails
[20:48:23] Takumo: Max SendQ exceeded
[20:49:09] Takumo: has joined #RubyOnRails
[20:49:25] Takumo: has joined #ruby


[02:28:53] Takumo: has joined #ruby
[20:09:22] Takumo: Ping timeout: 264 seconds
[20:10:19] Takumo: has joined #RubyOnRails
[20:10:35] Takumo: has joined #ruby


[17:38:35] Takumo: has joined #ruby
[17:38:35] Takumo: has joined #RubyOnRails


[12:34:10] Takumo: Hi All, how would I add some global error handling for ActiveJobs?
[12:34:30] Takumo: or even just something to run at the end of any job
[12:34:41] Takumo: weather or not it succeeded
[12:59:51] Takumo: ErhardtMundt: Rails 4.2+ ?
[13:00:31] Takumo: ActiveJob Supports Sidekiq which is much nicer than resque imo, though it does require redis... but it does maintain persistence
[13:03:17] Takumo: not sure, not touched rails 3.x since it was current


[10:39:24] Takumo: (Might not be the best place to ask but...) I'm having trouble with nested attributes in activeadmin, namely that newly created nested records aren't being saved. I've got `accepts_nested_attributes_for` in the model and I've allowed the nested records in activeadmin. Existing records update fine but new records do not get created
[10:40:21] Takumo: ok nvm existing records don't update...
[10:54:15] Takumo: 4.2 , ruby 2.3.0
[10:55:48] Takumo: i.e. ensuring the child record has the correct belongs_to ?
[10:56:14] Takumo: or is there an inverse of accepts_nested_attributes_for ?
[11:00:11] Takumo: oh I think I see now, I'm being a moron
[11:00:23] Takumo: need to permit :foos_attributes , not :foos
[11:02:04] Takumo: ok that's weird, I added :foos_attributes to ActiveAdmin's permit_params, but rails is still logging it as an unpermitted parameter
[11:05:48] Takumo: ah, sorted it, I had to write my own strong params function rather than rely on AA


[15:48:22] Takumo: Hey, anyone able to help me with this build error for MRI 2.2.6 ? ix.io/yWQ
[15:49:16] Takumo: gcc 7.1.1 / linux 4.12.4 / OpenSSL 1.1.0f / libffi 3.2.1
[16:04:36] Takumo: apeiros: what's missing?
[16:06:29] Takumo: there's a link to the log but as for what the issue is, to be honest I'm not really sure what in there is actually the cause of the problem, so I'm a bit lost as to what better detail to provide
[16:06:36] Takumo: when trying to build mri 2.2.6
[16:08:07] Takumo: yeah I did link the error but that was only make.log -- bit more googling seems to suggest an issue with gcc 7
[16:08:45] Takumo: oh my bad
[16:08:49] Takumo: http://ix.io/yWQ
[16:09:10] Takumo: that was meant to be a link just didn't paste properly!
[16:09:14] Takumo: PICNIC error
[16:10:34] Takumo: don't worry about answering it now though, work ends in 20 minutes so I'll just have to pick this up in the morning... got a rails 4 project I need to do a fix on but looks like ruby 2.2 doesn't like my system and rails 4 doesn't work on ruby 2.4 ... oh the fun
[16:13:06] Takumo: yeah, I did have a link just not properly formatted


[10:56:58] Takumo: has joined #ruby


[14:38:03] Takumo: jarr0dsz: depends on what `@user` is, what does `@user.class.name` say?
[14:52:00] Takumo: Hi All, I'm trying to customize some behaviour in Devise (specifically Devise::RegistrationsController#create) but it appears super do |resource| only calls the block on success, and when there's a validation error none of my own code gets called, which means things don't work


[00:17:13] Takumo: *.net *.split
[00:22:38] Takumo: has joined #RubyOnRails


[09:37:01] Takumo: has joined #RubyOnRails
[09:41:43] Takumo: Hi all, I'm using devise with a custom registration controller, and I'm creating other records transactionally with the devise resource. How can I correctly fail if one of the other resources being created fails?
[09:42:01] Takumo: I've tried super.resoure({}) but that tries to create the resource, and I just want to go back to the page with an error message.
[10:08:02] Takumo: here's the gist of it https://gist.github.com/LeoAdamek/a0f188b844b1cbbd1717b441f33729db
[10:11:54] Takumo: so add an accepts_nested_attributes_for to the user model?
[10:18:23] Takumo: is there something else I need to configure so that when `resource` gets initializde the `team` is also initialized?
[10:18:28] Takumo: otherwise `resource.team` is nil
[10:19:22] Takumo: in the view, so I can't do `fields_for resource.team` because, at that point, only `resource` is initialized, it doesn't have an associated `team`
[10:25:23] Takumo: with acceptes_nested_attributes_for, I assume that the outer resource gets created first and then the inner resource is created with the foreign key to the outer resource?
[10:26:12] Takumo: Or are the inner resources created without a foreign key first, then the outer resource is created, with the inner resources then linked to the outer resource? (Also assuming this all happens inside a DB transaction?)
[10:38:25] Takumo: sevenseacat: ok, I think I've got the idea now, just got to untangle the mess my previous implementation has left
[10:41:03] Takumo: tbuehlmann: just tried searching the docs (both Ruby and Rails) but got nothing for inverse_of, what does it do?
[10:48:27] Takumo: hmm, well the User is getting created, but there's nothing trying to create the team...


[13:48:57] Takumo: Quit: ZNC is going down!


[13:07:09] Takumo: Ping timeout: 272 seconds
[13:13:56] Takumo: Changing host
[13:13:56] Takumo: has joined #ruby
[13:13:57] Takumo: has joined #ruby
[13:14:44] Takumo: has joined #RubyOnRails


[00:04:57] Takumo: Ping timeout: 260 seconds
[00:08:23] Takumo: Changing host
[00:08:23] Takumo: has joined #ruby
[00:08:24] Takumo: has joined #ruby
[00:09:09] Takumo: has joined #RubyOnRails


[22:24:09] Takumo: Ping timeout: 246 seconds
[22:27:55] Takumo: has joined #ruby
[22:27:56] Takumo: has joined #ruby
[22:27:56] Takumo: Changing host
[22:29:02] Takumo: has joined #RubyOnRails


[22:15:56] Takumo: Ping timeout: 240 seconds
[22:22:35] Takumo: has joined #ruby
[22:22:35] Takumo: Changing host
[22:22:35] Takumo: has joined #ruby
[22:23:22] Takumo: has joined #RubyOnRails


[10:28:11] Takumo: if its just inside a `scope` block it shouldn't affect the path variable names
[10:28:31] Takumo: but you may not get the routes listed if you're using a scope to filter the matchable routes
[10:29:07] Takumo: frojnd: ^
[10:29:24] Takumo: is it just a simple `scope` call or is there other stuff, could you paste the routes.rb ?
[10:29:31] Takumo: (into gist or something, not here!)
[10:31:17] Takumo: ok, what would happen if you removed that module param on the scope call, and just added "super_users/" to one of the controllers
[10:31:21] Takumo: do the routes get listed then?
[10:34:26] Takumo: "super_users/session#new" though you should just be able to use `resource :session, controller: 'super_users/sessions'` in place of your current routes
[10:35:55] Takumo: yeah, just trying to see what the inclusion of that :module param was


[11:24:18] Takumo: has joined #ruby
[11:24:18] Takumo: Changing host
[11:24:18] Takumo: has joined #ruby
[11:25:04] Takumo: has joined #RubyOnRails
[11:26:19] Takumo: Hi all, I'm trying to use `fields_for` in order to add a set of fields for a set of items in a model's `has_many` relation
[11:27:04] Takumo: I've managed to get it submitting the data in what I think is the correct way, i.e. `outer_model[inner_model][id][field] value`
[11:27:23] Takumo: but I get an error trying to then save that data. I have `accepts_nested_attributes_for` enabled on the relation
[11:52:54] Takumo: I worked around it myself in the end, using `params[:inner_model].each_pair`


[07:56:57] Takumo: Ping timeout: 240 seconds


[10:54:09] Takumo: Hi all, I've got a model which has a custom serializer for a postgres `box` field
[10:54:19] Takumo: the serializer handles serialization into and out of a `Box` struct
[10:54:35] Takumo: however sometimes when I assign a value to that field, the created `Box` is all nil
[10:56:34] Takumo: any value
[10:57:20] Takumo: or rather, any Box
[10:59:14] Takumo: https://gist.github.com/LeoAdamek/a7c477c766df6062390f6aa5b84dc930
[10:59:26] Takumo: yeah lunch more important!
[11:02:49] Takumo: might change Box from a struct to a plain object
[11:30:20] Takumo: not yet, just refactoring my struct to a plain object so I don't have monkey patched methods on it
[11:40:08] Takumo: ^ AR will store times in UTC and use the currently set zone to adjust them
[11:40:27] Takumo: given that some DBs (like MySQL) don't support `with time zone`
[11:42:27] Takumo: Its very rare that you'd actually want to store times with zones really
[11:47:49] Takumo: usually storing date/time in UTC and using code to adjust the value to display as per the user's preferences or app settings
[11:48:19] Takumo: and adjusting user input dates/times to UTC from another zone is fine too
[11:48:43] Takumo: only case I can think of where you would need to store zones against datetime fields is something like say
[11:48:56] Takumo: where you start in one zone and end in another
[11:49:23] Takumo: ~always at in never or *always* ?
[11:50:24] Takumo: never seen the need to use `timestamp with time zone` myself for the reasons above... you usually just want sortable, selectable and filterable chronology
[11:55:33] Takumo: isn't timestamptz just shorthand for `timestamp with time zone` ?
[11:56:49] Takumo: universa1: So I thought changing my `Box` to a plain class rather than a struct would help but now even weirder things are happening
[11:58:35] Takumo: universa1: updated https://gist.github.com/LeoAdamek/a7c477c766df6062390f6aa5b84dc930 -- now even weirder :/
[12:05:04] Takumo: 5.0 indeed
[12:06:18] Takumo: matthewd: Sounds like it
[12:06:32] Takumo: I was using serializes only because I didn't think I could implement a custom `type`
[12:10:02] Takumo: yeah but let's register a type though


[14:28:46] Takumo: any reason why db:migrate rather than db:schema:dump? Just curious.
[14:29:46] Takumo: morning for some ;)
[14:30:02] Takumo: epochwolf: sadly that didn't fix it,
[14:30:13] Takumo: although the recreated db/schema.rb is a `point`
[14:31:29] Takumo: epochwolf: except that won't really work so well on prod ;(
[14:32:06] Takumo: I think for now postgis support in-rails will need to wait
[14:32:11] Takumo: I can still use postgis without it
[14:32:13] Takumo: just manually
[14:34:22] Takumo: I'm assuming it thinks its a postgis st_point rather than a regular postgres geometric point
[14:34:44] Takumo: yeah those are in fact totally different fields for different purposes
[14:35:04] Takumo: I have the wonderful situation where I need both
[14:35:18] Takumo: regular point for mapping a position on a flat plane
[14:35:25] Takumo: and geometric point for geometric position
[14:35:54] Takumo: I mean you could just eschew the db layer and do it in app but when you have postgis and postgres' geometric operators... (ab)use them!
[14:43:25] Takumo: Given that for now, what I need from PostGIS is reasonably limited, I think I'll just handle it myself
[14:43:39] Takumo: maybe re-use their serializers if needed
[14:44:11] Takumo: its fine, sometimes there isn't an easy fix
[14:44:19] Takumo: if only clients understood that :(
[14:47:49] Takumo: epochwolf: Indeed, dealing with someone who is angry our AngularJS based application doesn't work in IE8
[14:49:47] Takumo: masterasia: sounds like it should be polymorphic!
[14:50:17] Takumo: epochwolf: Similar story here, no support for IE < 10, and I'm very picky about TLS configs
[14:50:54] Takumo: epochwolf: though I /really/ upset a client when I didn't really know what I was doing and accidentally put their domain in chrome's hsts preload
[14:51:50] Takumo: epochwolf: FERPA? We don't actually have any compliance policies we have to meet tbh, we just all sleep better with strict TLS policies in place :)
[14:52:48] Takumo: epochwolf: ah ok, for any specific country?
[14:53:32] Takumo: ah ok, I'm in .uk so as far as I know we just have to comply with the standard DPA (Data Protection Act)
[14:53:47] Takumo: which is basically "don't hand out personal info to random strangers"
[14:55:55] Takumo: epochwolf: Just that it comes with expensive and breaucratic certification process?
[14:56:59] Takumo: epochwolf: and let me guess, they're not standard so you can't just re-use the same one?
[14:57:57] Takumo: and yeah, have extra fun with PCI-DSS
[14:58:18] Takumo: there's a reason we refuse to do anything that requires us to be fully PCI-DSS compliant ;)
[14:58:37] Takumo: embedded payment forms and single-use token hashes all dy
[14:59:03] Takumo: was it fun? :P
[14:59:27] Takumo: tbh I've never done it, don't really have any desire to do so either, neither does work
[14:59:42] Takumo: if we can make PCI-DSS someone else's problem, we will
[14:59:51] Takumo: and get by with an SAQ
[15:00:58] Takumo: epochwolf: we did that for a while but after about a year of it finding nothing on any system and causing more than a few outages
[15:01:00] Takumo: it went away
[15:01:25] Takumo: most of our apps/sites don't take payments anyway, the few that do we ensure we're not handling any card data
[15:02:15] Takumo: can you do the audits in-house? Do they not need to be impartially verified?
[15:02:34] Takumo: epochwolf: yeah we try to stick to stripe and worldpay
[15:03:03] Takumo: nice apis, no need to be in-house PCI as no CC data internally
[15:03:08] Takumo: also for what we do
[15:03:13] Takumo: PayPal won't take our customer's business
[15:03:23] Takumo: (Travel and Tourism)
[15:03:38] Takumo: I think its because it involves a *lot* of refunds
[15:04:08] Takumo: yeah, travel and tourism companies tend to sell stuff they don't have for a refundable deposit
[15:04:13] Takumo: then cancel it if not enough people buy it
[15:04:17] Takumo: and refund it all
[15:04:31] Takumo: don't think PayPal likes that model
[15:05:10] Takumo: A lot of our clients are "group tour" operators, so they say "A group of people will go here and do this stuff on this date"
[15:05:24] Takumo: and unless enough people put a deposit in, they cancel and refund
[15:05:35] Takumo: if enough people book it, then it goes on and they take the rest and do it
[15:05:58] Takumo: (they usually have all the stuff pre-booked with the upstream supplier, and have a period where they're allowed to cancel it all)
[15:06:53] Takumo: I love how one of our clients has above very CC entry form "WE DO NOT TAKE AMEX CARDS" (they refuse to pay Amex fees)
[15:07:05] Takumo: still, dozens of people per day try an Amex card... multiple times
[15:09:26] Takumo: epochwolf: less neat are the systems these companies have to manage this stuff... most of them are written in VB6, and some of them are so slow its a joke
[15:10:22] Takumo: Yeah, I'm a aware of Delphi... ick
[15:10:42] Takumo: wooo mainframes!! :P
[15:11:01] Takumo: one of the VB6 apps we've integrated is off-the-shelf and has a C♯ (ish) based SOAP api
[15:11:05] Takumo: complete with >800 methods
[15:11:17] Takumo: including GetFoo GetFoos GetFoosXML and GetFoos1
[15:11:32] Takumo: most of the methods pass the whole XML request to an SQL stored procedure that manually parses parameters out of the XML :)
[15:12:13] Takumo: another VB6 system was custom, so I wrote a Grape based API to expose its DB
[15:12:31] Takumo: another was actually Django based so I just extended our app's Golang API to integrate with it
[15:12:38] Takumo: epochwolf: no. nope nope nope. Pls no more soap
[15:13:52] Takumo: epochwolf: Yeah but if it breaks and your JSON is valid its not your problem and not in your SLA :)
[15:14:51] Takumo: tbh we have a UAT env for each app but that's about it
[15:15:29] Takumo: epochwolf: I think I solve my problem!!
[15:16:14] Takumo: epochwolf: yeah, I'd basically say "My JSON is spec compliant. Therefore your parser is the thing which is broken."
[15:16:44] Takumo: epochwolf: I had the line `attribute :point_field, :point` to handle the regular point field
[15:16:47] Takumo: removed that and now it works
[15:17:15] Takumo: buuut now its an array rather than an ActiveRecord::Point :(
[15:18:01] Takumo: yeah, I sorta jumped ahead and adopted the upcoming 5.1 point handling
[15:18:26] Takumo: which the rest of my app uses so I kinda need to make it work :(
[15:18:47] Takumo: so just `serialize :point_field, ActiveRecord::Point` ?
[15:24:57] Takumo: epochwolf: tbh I've opened it as an issue on activerecord-postgis-adapter
[15:26:33] Takumo: because it *should* really just work, might even have to have a go at fixing it myself though