Page 1 of 12 | Next »
[12:04:39] andywww: wondered if i could get a bit of advice, I’m building a map application which has markers and routes drawn between the markers to follow the road. My models are Waypoint and Route. I want to update the route model when the marker (waypoint) is dragged to another location. I’m not sure how the relationships should be set up though because whilst both have a has_one relationship, neither really warrant a belongs to. This is what I have, how could this b
[12:06:20] andywww: I’m exposing the content of the models via jsonapi resources too so I’m not even convinced it matters as I don’t think jsonapi even has that level of detail on relationships
[13:10:27] andywww: hi, i have a model which i need to store two references to another type of model, in this instance a start and end point, both of which are instances of the waypoint model. How should this look in a migration please? I’m getting errors with the following: https://gist.github.com/andywww12/95bf75266f92302b60c8276ae8f47aa8
[19:42:11] andywww: ive been watching a few youtube vids recently that have been extremely critical of apple hardware and whilst ive always been fairly hardware agnostic, i do like apples laptops for the form factor, retina screens and the simplicity of os x/brew for setting up the ruby environment
[19:42:41] andywww: i’d be curious to hear what you guys run and if not you think a non apple device with linux is a viable alternative for dev work?
[09:06:11] andywww: What is the Registration/DNS equivalent of what LetsEncrypt is to SSL certs please?
[09:06:56] andywww: do we still have to go through all these scabby commercial vendors with their control panels or is there a good community driven and/or open source one?
[09:38:24] andywww: Is there any reason why the asset pipeline might not render scss code? I’ve added a scss file from a yarn package and it only seems to be rendering the header comments from the file. https://hastebin.com/zuzubizigi.php
[13:30:03] andywww: if i am in one timezone, eg BST (UTC+1) and I want to query all records that were created after midnight in Orlando (UTC+4) do i simply run .where(‘created_at > ?’, Time.now.beginning_of_day+4.hours) ?
[08:43:18] andywww: was wondering if i could get a bit of steer, i’ve got a feeling i might be reinventing a wheel here somehow
[08:43:34] andywww: i was to use a bastardisation of a strategy pattern to apply rules to the params hash
[08:45:14] andywww: this class will be used on multiple apps, each will have different rules to apply so I want to loop through any derivatives of Strategy (incorrectly named i know, but this is for illustration purposes) and apply them
[08:45:56] andywww: the class packages up params and sends them to a stats app so i can track application usage across the suite
[08:46:28] andywww: but i want to apply rules like removing uploads and swapping out sensitive data before sending the packet
[08:47:24] andywww: i’ve had a sniff through some of the GOF patterns and this is the closest i’ve found so far
[08:53:17] andywww: I’m using the comma gem and want to spit out some data based on a few steps through associations and was wondering if i culd get any feedback on how I might be able to use some sort of preloading to cut down the number of queries this is causing: https://gist.github.com/wanabewired/9337a91bdeadfcb917f6fe60c6e19199
[09:51:18] andywww: Repost from when the room was dead: I’m using the comma gem and want to spit out some data based on a few steps through associations and was wondering if i culd get any feedback on how I might be able to use some sort of preloading to cut down the number of queries this is causing: https://gist.github.com/wanabewired/9337a91bdeadfcb917f6fe60c6e19199
[09:55:26] andywww: ive not traced that far back in the code (its not mine) I was hoping it might be something in the code i pasted that could help preload.. i’ll have a look further back
[10:44:54] andywww: how do you preload associations of associations? This feels like i’m missig something obvious: Model.where().preload(:association).preload(<association of association>)
[10:56:33] andywww: preload(:assoc1, :assoc2, assoc1: :2nd_tier_assoc, assoc1.2nd_tier_assoc: :3nd_tier_assoc)
[17:59:49] andywww: Hi, in my test data i have Trip has_many Rides has_many waypoints with 22 waypoints spread across 4 rides in 1 trip. I’m using jsonapi-resources with the associations detailed in the resources as mentioned
[18:00:25] andywww: for some reason, despite acknowledging the ride_id, the query is not filtering the waypoints by that ride ID and is returning all waypoints for all rides
[11:51:34] andywww: i have an arrangement where Trip has_many Ride has_many Waypoint, I want to keep a cache on Ride of the position of the first and last associated Waypoint so i can say “Ride starts at X and finishes at Y” and also a cache on Trip of the first and last Ride, etc. At the minute I’m running these checks after_save on the Waypoint if location_changed? but it feels inefficient due to there being sometimes in excess of 50 waypoints in a ride. Is there a mo
[11:51:35] andywww: efficient way of the Waypoint being able to query wether it is the first or last associated with the ride without having to do if waypoint.ride.waypoints.first/waypoint.ride.waypoints.last on every waypoint save?
[12:09:22] andywww: Wondered if i could get a bit of steer please guys, I have a model that has_many URLs and has_many domains. I want to maintain a set of rules which will be parsed for ach entry in an ad hoc arrangement and flag if the associated record matches the rule. For those familiar it is a disavow file for google webmaster tools.
[12:11:21] andywww: happy to RTFM i just need a bit steer to get me going if anyone can think of anyhting
[17:16:50] andywww: please can someone let me know if there is anything obviousl I’m doing wrong with this JR config? I’m not sure I’ve deviated from the documentation enough for it to be something i’ve caused..
[10:00:22] andywww: I’m trying to do something whichi i thought was fairly simple but its proving not to be, I’d like to pass my index action an optional ids array to filter what it returns but am having some real problems with strong parameters
[08:30:33] andywww: I alo have a question, is https://hastebin.com/atozonomad.rb pushing association functionality too far? If so is there any way I can cast the key before it is used without changing it in the db?
[08:35:14] andywww: because this is one of a few systems, the uid was consistent across all systems but for some reason, outside of my control, it was stored as a string
[10:27:36] andywww: PendingNotification Load (0.2ms) SELECT "pending_notifications".* FROM "pending_notifications" WHERE "pending_notifications"."user_id" = $1 [["user_id", 1]]
[10:28:19] andywww: but i wanted [["user_id", 1]] to be a different column, how would i need my association set up on the user side?
[10:28:58] andywww: SELECT "pending_notifications".* FROM "pending_notifications" WHERE "pending_notifications”.”other_id” = $1 [[“other_id", 1]]
[10:35:33] andywww: but the pending notifications user_id field should match up to the User’s uid rather than id
[10:39:41] andywww: but when i run the query from User.pending_notifications I want User.uid to match PendingNotification.user_id
[10:40:23] andywww: my understanding is foreign key changes the column i am matching User.id against on PendingNotifications
[15:48:41] andywww: the benefits seem solid but I’m thinking the biggest benefit would be for systems processing a lot of data concurrently
[20:45:35] andywww: I want to associate a model two different ways, one directly and one through a joining table. I'd appreciate some feedback on this letting me know if what I've commented is correct for the scenario shown.
[16:37:50] andywww: i’m writing some basic logging that wraps up the details of a request into a udp packet but requests over a certain size are larger than what will fit in a single packet
[16:38:31] andywww: I’m trying to find the quickest way to identify if a post request has a file attached
[16:39:18] andywww: i’d ideally like it to work across all post requests, traversing the hash looking for a ActionDispatch::Http::UploadedFile
[11:11:52] andywww: is there a way to query arbitrarily deep hash for a value in a single line without having to do a has_key? on each level?
[20:11:41] andywww: repost from #rubyonrails I’m trying to return the value of a proc rather than a proc with the following code:
[20:14:37] andywww: i would like the return value of make_request method to be whatever is returned from the handle response method once it has called the relevant handle_* method
[20:17:53] andywww: i understand i need to call it but its the return value of make_request i’m struggling with in this instance
[20:19:58] andywww: quite possibly but as it stands, make_request is returning an array with a single proc