andywww

Activity Graph

Page 1 of 12 | Next »

2018-11-14

[14:22:16] andywww: has joined #RubyOnRails
[14:24:57] andywww: Client Quit
[14:25:53] andywww: has joined #RubyOnRails
[15:33:24] andywww: Quit: andywww

2018-11-13

[11:54:06] andywww: has joined #RubyOnRails
[12:04:39] andywww: better put do you think?
[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:04:40] andywww: https://gist.github.com/andywww12/6f94ae82b6bfcd8b8f20f2bee54b8b82
[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
[15:16:44] andywww: Quit: andywww
[15:19:00] andywww: has joined #RubyOnRails
[15:19:25] andywww: has left #RubyOnRails: ()

2018-11-10

[13:07:11] andywww: has joined #RubyOnRails
[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
[13:57:42] andywww: Quit: andywww
[14:13:26] andywww: has joined #RubyOnRails
[14:13:36] andywww: Client Quit
[14:31:19] andywww: Client Quit
[14:31:19] andywww: has joined #RubyOnRails
[14:33:30] andywww: has joined #RubyOnRails
[14:33:34] andywww: Client Quit
[14:40:35] andywww: has joined #RubyOnRails
[14:54:04] andywww: Quit: andywww

2018-11-08

[19:38:27] andywww: has joined #RubyOnRails
[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?
[19:49:01] andywww: Quit: andywww

2018-11-04

[14:49:18] andywww: has joined #RubyOnRails
[15:10:50] andywww: Quit: andywww
[15:20:34] andywww: has joined #RubyOnRails
[15:20:51] andywww: Client Quit

2018-10-30

[19:55:31] andywww: has joined #RubyOnRails
[20:42:13] andywww: Quit: andywww
[20:43:13] andywww: has joined #RubyOnRails
[20:44:10] andywww: Client Quit
[21:28:35] andywww: has joined #RubyOnRails
[22:10:52] andywww: Quit: andywww
[22:15:12] andywww: has joined #RubyOnRails
[22:15:39] andywww: Client Quit

2018-10-17

[09:55:42] andywww: has joined #RubyOnRails
[09:55:46] andywww: Client Quit

2018-10-08

[09:32:29] andywww: has joined #RubyOnRails
[10:08:05] andywww: Quit: andywww

2018-10-05

[09:02:41] andywww: has joined #RubyOnRails
[09:05:45] andywww: Client Quit

2018-09-15

[13:00:56] andywww: has joined #RubyOnRails
[13:49:03] andywww: Ping timeout: 252 seconds
[14:04:25] andywww: has joined #RubyOnRails
[14:04:31] andywww: Client Quit

2018-09-10

[09:03:46] andywww: has joined #RubyOnRails
[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:32:31] andywww: Quit: andywww

2018-08-31

[07:52:07] andywww: has joined #RubyOnRails
[07:52:12] andywww: Client Quit

2018-08-30

[15:28:16] andywww: has joined #RubyOnRails
[15:50:09] andywww: has left #RubyOnRails: ()

2018-08-09

[17:26:00] andywww: has joined #RubyOnRails
[17:43:08] andywww: Quit: andywww

2018-08-05

[09:36:46] andywww: has joined #RubyOnRails
[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
[09:54:54] andywww: Quit: andywww
[10:22:35] andywww: has joined #RubyOnRails
[10:24:44] andywww: Client Quit

2018-07-28

[15:18:21] andywww: has joined #RubyOnRails
[15:56:13] andywww: Quit: andywww
[16:00:07] andywww: has joined #RubyOnRails
[16:21:23] andywww: Quit: andywww
[18:03:58] andywww: has joined #RubyOnRails
[18:05:07] andywww: Client Quit

2018-07-13

[07:53:10] andywww: has joined #RubyOnRails
[08:46:00] andywww: Quit: andywww

2018-07-12

[10:19:55] andywww: has joined #RubyOnRails
[10:23:30] andywww: has left #RubyOnRails: ()

2018-06-28

[21:26:10] andywww: has joined #RubyOnRails
[23:10:33] andywww: Quit: andywww

2018-06-24

[21:18:17] andywww: has joined #RubyOnRails
[21:23:06] andywww: Client Quit

2018-06-17

[13:59:25] andywww: has joined #RubyOnRails
[19:18:10] andywww: Quit: andywww

2018-06-13

[13:27:40] andywww: has joined #RubyOnRails
[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) ?
[14:05:40] andywww: Quit: andywww

2018-06-08

[17:26:27] andywww: has joined #RubyOnRails
[17:59:20] andywww: Quit: andywww
[18:46:23] andywww: has joined #RubyOnRails
[18:46:25] andywww: Client Quit

2018-06-07

[19:10:45] andywww: has joined #RubyOnRails
[19:25:23] andywww: Quit: andywww
[20:36:46] andywww: has joined #RubyOnRails
[21:59:36] andywww: Quit: andywww

2018-05-31

[08:42:28] andywww: has joined #RubyOnRails
[09:19:26] andywww: has left #RubyOnRails: ()

2018-05-29

[08:42:08] andywww: has joined #RubyOnRails
[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:43:37] andywww: https://gist.github.com/wanabewired/8db7e59c24825cf9b505f8e328bb5fab
[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:46:37] andywww: so the rules have to sit on the apps side
[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:47:35] andywww: but i can’t work out how to chain it
[08:50:16] andywww: okay brill i’ll have a read into it, thanks
[08:50:27] andywww: feel free to fire any other suggestions/links over
[08:54:08] andywww: hmm, the production line analogy is a good one, just had a skim read
[08:54:20] andywww: gonna swot up a bit
[10:15:26] andywww: Quit: andywww

2018-05-28

[16:23:18] andywww: has joined #RubyOnRails
[16:23:33] andywww: Client Quit

2018-05-27

[14:07:36] andywww: has joined #RubyOnRails
[14:28:11] andywww: Quit: andywww

2018-05-24

[08:46:30] andywww: has joined #RubyOnRails
[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
[08:53:24] andywww: thanks in advance for any feedback
[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:32:11] andywww: has left #RubyOnRails: ()
[10:43:30] andywww: has joined #RubyOnRails
[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:45:00] andywww: what would that look like?
[10:46:19] andywww: and that would work if bar was an association of foo and not of model?
[10:47:17] andywww: thanks for that
[10:51:54] andywww: preload(:assoc1, :assoc2, assoc1: :2nd_tier_assoc) seems to work beautifully
[10:52:01] andywww: suspiciously well, infact
[10:52:06] andywww: much appreciated
[10:55:48] andywww: is it possible to go a level further?
[10:56:33] andywww: preload(:assoc1, :assoc2, assoc1: :2nd_tier_assoc, assoc1.2nd_tier_assoc: :3nd_tier_assoc)
[10:56:37] andywww: if that makes sense?
[10:58:33] andywww: you can come again!
[10:58:40] andywww: thanks for that!
[12:24:22] andywww: Quit: andywww

2018-05-21

[17:57:01] andywww: has joined #RubyOnRails
[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
[18:00:26] andywww: https://gist.github.com/wanabewired/32bec30d79ff316f8c61dfe9fda56d84
[18:00:37] andywww: am i doing something obviously wrong?
[18:18:27] andywww: Quit: andywww

2018-05-19

[11:45:38] andywww: has joined #RubyOnRails
[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?
[13:32:51] andywww: Quit: andywww
[13:40:12] andywww: has joined #RubyOnRails
[13:40:17] andywww: Client Quit

2018-05-18

[12:03:49] andywww: has joined #RubyOnRails
[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:09:28] andywww: https://gist.github.com/wanabewired/d1d99c3c4e2cc03443e6c619515d9ddf
[12:10:03] andywww: I was wondering if there was a pattern/gem that would be well suited to this?
[12:11:21] andywww: happy to RTFM i just need a bit steer to get me going if anyone can think of anyhting
[12:32:05] andywww: https://leanpub.com/everydayrailsrspec this is decent
[12:46:19] andywww: yeah pretty much, introduces the basic tdd concepts, factories, stubbing etc
[12:46:40] andywww: you should be able to get the contents page on the site i think
[12:48:11] andywww: Quit: andywww
[15:33:28] andywww: has joined #RubyOnRails
[15:34:07] andywww: Client Quit

2018-05-12

[14:08:45] andywww: has joined #RubyOnRails
[14:23:14] andywww: Quit: andywww
[18:26:08] andywww: Client Quit
[18:26:08] andywww: has joined #RubyOnRails

2018-05-05

[17:10:06] andywww: has joined #RubyOnRails
[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..
[17:16:51] andywww: https://gist.github.com/wanabewired/ea016da268f4df8ac3c3b0e7e9e5947d
[17:22:27] andywww: hmm, never mind, i’m supposed to ommit the index action, solved, thanks
[17:23:45] andywww: Quit: andywww

2018-04-13

[09:59:01] andywww: has joined #RubyOnRails
[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
[10:00:25] andywww: https://gist.github.com/wanabewired/e677f07322ae931be763741f67c5372c
[10:03:13] andywww: aah, I see, thanks
[10:08:15] andywww: has left #RubyOnRails: ()

2018-04-12

[08:25:04] andywww: has joined #RubyOnRails
[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
[08:36:16] andywww: i appreciate it looks like a stupid problem to have
[08:45:49] andywww: thats what i did initially but i was told to change it
[08:46:01] andywww: trust me this is frustrating for me also
[10:32:20] andywww: Quit: andywww

2018-04-11

[10:26:22] andywww: has joined #RubyOnRails
[10:27:33] andywww: bit stumped here, forgive my sql understanding but if i were to have:
[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:34:34] andywww: sorry, what ran that was User.last.pending_notifications
[10:35:33] andywww: but the pending notifications user_id field should match up to the User’s uid rather than id
[10:38:04] andywww: where, sorry?
[10:38:53] andywww: the PendingNotification (belongs to user) has a user_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
[10:40:34] andywww: but i still want it to use user_id
[10:46:34] andywww: ah it just needed rimary_key :uid on both sides
[10:46:36] andywww: thanks for that
[11:06:41] andywww: has left #RubyOnRails: ()

2018-04-04

[22:42:08] andywww: has joined #RubyOnRails
[22:55:51] andywww: Quit: andywww

2018-03-11

[15:47:03] andywww: has joined #RubyOnRails
[15:47:42] andywww: does anyone have an opinion on transitioning from ror to elixir/phoenix?
[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
[15:50:08] andywww: Client Quit

2018-02-26

[20:26:28] andywww: has joined #RubyOnRails
[20:41:58] andywww: just add it in your path helper: model_path(@model, timestamp: Time.now.to_i)
[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.
[20:45:41] andywww: https://gist.github.com/anonymous/1692c7a1ccda0467c1bb43b3325b3549
[22:38:29] andywww: has left #RubyOnRails: ()

2018-02-20

[18:38:08] andywww: has joined #RubyOnRails
[19:06:41] andywww: Quit: andywww

2018-02-07

[23:44:47] andywww: has joined #RubyOnRails
[23:50:28] andywww: Quit: andywww

2018-01-16

[13:31:15] andywww: has joined #RubyOnRails
[13:31:22] andywww: Client Quit

2017-11-27

[14:48:09] andywww: has joined #RubyOnRails
[16:08:59] andywww: has left #RubyOnRails: ()

2017-11-24

[16:35:50] andywww: has joined #RubyOnRails
[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:38:41] andywww: any ideas?
[16:39:18] andywww: i’d ideally like it to work across all post requests, traversing the hash looking for a ActionDispatch::Http::UploadedFile
[16:45:00] andywww: Quit: andywww

2017-11-14

[13:25:30] andywww: has joined #RubyOnRails
[13:27:39] andywww: has left #RubyOnRails: ()

2017-11-04

[11:11:06] andywww: has joined #RubyOnRails
[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?
[11:12:04] andywww: something like @tweet_hash.fetch([:extended_tweet][:entities][:urls], [])
[11:17:39] andywww: Quit: andywww

2017-11-03

[20:09:32] andywww: my return value is an array with a single proc in it
[20:09:43] andywww: i need it to be the value of the executed proc
[20:10:49] andywww: has joined #ruby
[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:11:43] andywww: https://gist.github.com/anonymous/c7f230d4ef838bf0af7997fd79326352
[20:12:32] andywww: the return value of the proc once it is called
[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:14:43] andywww: I’m just not sure how to go about it
[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
[20:20:23] andywww: its the behaviour of typhoeus from what i understand
[20:20:45] andywww: yes thats right exactly
[20:21:08] andywww: i want to return the result of the handle_response line inside the block
[20:22:07] andywww: i was starting to think that
[20:22:30] andywww: what are the immediate errors?
[20:24:00] andywww: i removed a line in my faffing about
[20:24:27] andywww: the top method now calls request.run
[20:24:37] andywww: which is making it follow the links as expected
[20:25:19] andywww: https://gist.github.com/anonymous/9152451ee7dcdcfd3a5c66641d7363f5
[20:25:34] andywww: thats got me a lot closer because it is now recursively following redirects
[20:25:50] andywww: but if you can spot any immediate errors I’d appreciate a heads up
[20:38:28] andywww: Quit: andywww