« Back to channel list

#RubyOnRails - 18 October 2018

« Back 1 day Forward 1 day »
[04:30:35] helpa: has joined #RubyOnRails
[04:31:14] Radar: !botsnack
[04:31:14] helpa: Nom nom. Thanks, Radar!
[04:31:15] blackcross: it's 7000 <tr><form><td><input></td>...<td><input></td></form></tr> so in rows
[04:31:26] blackcross: cause there are 7000 lines in a batch
[04:31:37] Radar: blackcross: Are real, live humans using this form?
[04:32:05] Radar: It sounds to me like it would be very difficult to process that whole massive form in one sitting.
[04:32:19] blackcross: it's not 1 massive form
[04:32:25] blackcross: it's 7000 individual <forms>
[04:32:26] Radar: blackcross: for the 1 month's batch, could you split it so that it only loads 50 records at a time?
[04:32:50] Radar: What I'm trying to get to the essence of is: why do you need to display _all 7000 at the same time_?
[04:32:54] blackcross: Radar, I guess, and use pagination?
[04:32:57] Radar: blackcross: yeah
[04:33:15] Radar: So maybe for each record have some sort of indicator of "processed" or not, and then just show the next 50 "unprocessed" ones.
[04:33:39] Radar: Then your page would load about 140x faster.
[04:33:40] mheld: has joined #RubyOnRails
[04:34:05] apeiros: has joined #RubyOnRails
[04:34:16] blackcross: gotcha, guess that'd work, just a lot harder to find things, having to randomly click a page # and hope it's near the manufacturer u want
[04:34:17] Radar: And it'd be easier for a human to handle 50 records at a time. The screen would be clearer too.
[04:34:36] Radar: blackcross: Maybe have a way to search for these records by manufacturer too?
[04:34:39] blackcross: unless they are searching for some individual item's attribute :(
[04:34:54] Radar: It sounds like there's some UX work to be done here. Maybe talk some more with the people who are using it and see what they'd change about it.
[04:35:07] Radar: If you can, that is
[04:35:15] blackcross: i'm just surprised that at this day and age, a web browser can't load 7000 <tr> forms </tr> quickly
[04:35:36] blackcross: i work with them directly, so i can
[04:35:50] blackcross: i'm by far not a UX designer though, just backend coder with some RoR knowledge
[04:36:30] FreshCache: the problem is you're hitting your backend, of course a browser running even on low memory can handle thousands of trs
[04:36:56] Radar: Loading thousands of anything is going to have the server take a large hit.
[04:36:59] blackcross: that isn't the problem though, i don't believe, cause when we load the page with no <form> elements, it loads in 3 seconds
[04:37:25] Radar: blackcross: Hard to know if that's Rails' routing helpers or what specifically causing that.
[04:37:45] Radar: blackcross: I'd collect some feedback from the people who are using it and then after they've said their piece, I'd propose some ideas like the paginating and searching by manufacturer.
[04:37:57] blackcross: ohhh that's a great point, every line does have a rails routing link
[04:38:00] FreshCache: there's a gem called kaminari that does pagination
[04:38:01] fragamus: has joined #RubyOnRails
[04:38:40] blackcross: and the rails routing link isn't rendered in the raw table data page
[04:38:51] Radar: You don't even need kaminari for this. It's not a traditional pagination where you'd be flicking through. It sounds like you've got n thousand rows that can be processed every month. So just show the unprocessed ones in small batches.
[04:38:52] blackcross: so that is probably it, rails having to render 7000 rails routes as the page loads
[04:40:22] blackcross: ty for the help Radar, that one sentence probably solved the problem, about rails routing, i'll let you know results tomorrow :)
[04:40:34] Radar: blackcross: np :)
[04:47:32] eckhardt: has joined #RubyOnRails
[05:13:39] reber: has joined #RubyOnRails
[05:28:10] apeiros: has joined #RubyOnRails
[05:50:57] za1b1tsu: has joined #RubyOnRails
[05:51:46] fcser_: has joined #RubyOnRails
[06:05:43] apeiros: has joined #RubyOnRails
[06:16:09] sandstrom: has joined #RubyOnRails
[06:19:12] tuor: has joined #RubyOnRails
[06:19:49] Dbugger: has joined #RubyOnRails
[06:35:15] snickers: has joined #RubyOnRails
[06:36:43] DoubleMalt: has joined #RubyOnRails
[06:46:46] fragamus: has joined #RubyOnRails
[06:47:39] srinidhi: has joined #RubyOnRails
[07:09:34] Tempesta: has joined #RubyOnRails
[07:54:41] sandstrom: has joined #RubyOnRails
[07:56:34] GodFather: has joined #RubyOnRails
[07:57:11] wethu: has joined #RubyOnRails
[08:03:08] mikecmpbll: has joined #RubyOnRails
[08:06:07] ur5us: has joined #RubyOnRails
[08:08:14] schneider: has joined #RubyOnRails
[08:08:26] srinidhi: has joined #RubyOnRails
[08:09:33] lxsameer: has joined #RubyOnRails
[08:14:43] wojnar: has joined #RubyOnRails
[08:16:12] mikecmpb_: has joined #RubyOnRails
[08:20:13] blackmesa: has joined #RubyOnRails
[08:22:55] Ergo: has joined #RubyOnRails
[08:58:20] MoritaShinobu: has joined #RubyOnRails
[09:10:43] ur5us: has joined #RubyOnRails
[09:28:20] blackcross: Radar: didn't work, still takes 60s for the form page to load, and 15s for the form-free page to load, i'll try javascript <tr> replacement after page is loaded and see if that makes it goto 15s~, so 7000 link_to's was not the problem afterall :(
[09:34:59] blackcross: i noticed on my staging server (which i dev on), that 4 DB caches are being hit and 1 serial for every item (7000 items), I have eager_load enabled, so that's 28,000 cache hits and 7,000 DB queries, how would I go about doing this in 1 big query? or should i post my .html.erb source?
[09:41:10] blackcross: my _table_staff.html.erb = https://dpaste.de/V6nm
[09:48:34] blackcross: ^--- that takes 60s to load and this (without forms) takes 15s to load => https://dpaste.de/uqsm
[10:02:23] whysthatso: has joined #RubyOnRails
[10:04:15] srinidhi: has joined #RubyOnRails
[10:19:34] roshanavand: has joined #RubyOnRails
[10:23:07] hightower2: has joined #RubyOnRails
[10:28:45] ur5us: has joined #RubyOnRails
[10:33:07] lexileo: has joined #RubyOnRails
[10:42:21] whysthatso: has joined #RubyOnRails
[10:43:12] quazimodo: has joined #RubyOnRails
[10:48:20] lankanmon: has joined #RubyOnRails
[10:50:10] kapil____: has joined #RubyOnRails
[10:56:05] apparition: has joined #RubyOnRails
[10:57:57] kurko_: has joined #RubyOnRails
[10:59:56] za1b1tsu: has joined #RubyOnRails
[11:17:00] Terens: has joined #RubyOnRails
[11:39:46] Alchemical: has joined #RubyOnRails
[11:44:43] za1b1tsu: has joined #RubyOnRails
[11:51:41] halogenandtoast: has joined #RubyOnRails
[11:52:02] halogenandtoast: Would there be any reason for activestorage to throw an error on direct upload in Safari, but not Chrome?
[11:52:51] wethu: has joined #RubyOnRails
[11:52:55] halogenandtoast: using s3 as a backend
[11:54:32] nertzy: has joined #RubyOnRails
[12:00:09] halogenandtoast: The error is: Error creating Blog for "image.jpg". Status: 0
[12:02:37] halogenandtoast: Tried in Edge, doesn't error, but I do see the error in Firefox briefly
[12:05:24] ShekharReddy: has joined #RubyOnRails
[12:14:43] roshanavand: has joined #RubyOnRails
[12:17:05] ShekharReddy: Guys I am came across this scenario in the code that in the after_save method I need to access the params
[12:23:28] halogenandtoast: ShekharReddy: don't user after_save, instead write an object that takes in the params, saves your object, and then let's you do something afterwards
[12:23:43] halogenandtoast: You would still have access to the params in that case
[12:26:08] halogenandtoast: If you don't like that advice for some reason (people often don't like to listen to me for some strange reason), you can do things I would not advise like using Thread.current as local memory store for the params, you could also use Redis and create an expiring key that holds the params value.
[12:26:32] halogenandtoast: but I would avoid Thread.current at all costs
[12:39:38] ss942: has joined #RubyOnRails
[12:39:42] ss942: How to find open source projects to contribute in?
[12:39:42] ss942: I signed up for open source event as a mentor, they only wanted me to have social skill, and know how to do pull request.
[12:39:42] ss942: Any idea how to look for projects?
[12:41:22] IanMalcolm: has joined #RubyOnRails
[12:41:28] halogenandtoast: ss942: find a gem that solves a problem you are interested in and then look at the issues list
[12:46:28] halogenandtoast: just checking, but can people actually see what I'm typing?
[12:47:28] ss942: halogenandtoast: yes, and thanks
[12:48:31] halogenandtoast: ss942: okay thanks! And I know the answer is a little curt, but there isn't any real interesting way other than that, at least that I'm aware of
[12:49:11] halogenandtoast: and even then it's still difficult coming into a foreign project, with someone else's style and decisions
[12:51:13] lupine: has joined #RubyOnRails
[12:56:36] lxsameer: has joined #RubyOnRails
[13:01:32] halogenandtoast: has joined #RubyOnRails
[13:12:00] kurko_: If I do `model_a = ModelA.create(attr: 'my-attr', model_b: ModelB.first)`, will ActiveRecord keep `model_b` in memory such that `model_a.model_b` will not generate a new query for `model_b` (n+1)?
[13:21:11] kangarooo: has joined #RubyOnRails
[13:27:43] IanMalcolm: has joined #RubyOnRails
[13:47:10] jscheel: has joined #RubyOnRails
[13:47:59] hightower2: Hey, I am trying to test my extension with rspec. I have a rake task which builds a dummy app on which tests should run. But I don't understand how to tell rspec that I want to run my tests in the context of this dummy app. Any hints?
[13:49:24] jhass: extension = rails engine?
[13:51:07] jhass: https://guides.rubyonrails.org/engines.html#testing-an-engine
[13:53:35] hightower2: ooh yeah got it, thanks
[13:53:49] hightower2: I just needed to load the environment.rb from the dummy app
[13:55:11] hightower2: oh my... spent better part of 2 days on this one...
[14:07:09] samort7: has joined #RubyOnRails
[14:07:43] samort7: What is the purpose of the "listen" gem? It seems to me it just does the same thing that Git does?
[14:08:43] jhass: that's interesting, I couldn't even find a single thing they have in common
[14:09:24] jhass: from its description "The Listen gem listens to file modifications and notifies you about the changes"
[14:09:32] jhass: what's unclear about that?
[14:09:35] kapil____: has joined #RubyOnRails
[14:09:48] samort7: if I do 'git status' it tells me what files have been added/changed/removed
[14:09:52] samort7: isn't that the same thing?
[14:10:00] mikecmpbll: has joined #RubyOnRails
[14:10:49] jhass: no, not at all
[14:10:56] samort7: is it just that listen actively notifies you in console, whereas with git you have to to invoke the change yourself?
[14:11:11] tbuehlmann: samort7: it's about your rails process to listen to file changes and act on it
[14:11:41] tbuehlmann: code reloading, for example, so you don't have to restart your rails server after any code change
[14:11:43] samort7: tbuehlmann: is it something used internally by rails?
[14:11:50] jhass: when you do git status, git compares what's in your working copy vs what's the state of HEAD
[14:11:57] samort7: tbuehlmann: ah I see
[14:12:14] jhass: listen hooks the OS to get notified when a file was written
[14:12:18] jhass: very different things
[14:12:53] samort7: Ok. Just trying to figure out what each default gem does and which ones I can remove / shouldn't touch (because they'll break Rails functionality)
[14:16:57] tbuehlmann: I'd start with spring :)
[14:17:41] samort7: tbuehlmann, tell me more about spring. Is it the same spring used in, like, Java Spring? And what does it do exactly?
[14:18:18] tbuehlmann: see https://github.com/rails/spring: Spring is a Rails application preloader. It speeds up development by keeping your application running in the background so you don't need to boot it every time you run a test, rake task or migration.
[14:19:07] tbuehlmann: sounds like a great idea, but for me (and others) it has been a pain point as it can have some weird behaviour
[14:19:22] tbuehlmann: as in: don't restart the server when it should, running on old code where you wouldn't expect it
[14:32:41] samort7: tbuehlmann, ah, that does sound annoying. I feel like I have noticed that happening to me sometimes too
[14:34:41] tbuehlmann: you can be lucky and never suffer from it, but when it hits you, you'll debug quite a lot until you figure out that manually restarting spring will solve the issue
[14:35:39] za1b1tsu_: has joined #RubyOnRails
[14:48:43] samort7: haha jesus
[14:50:09] tbuehlmann: to be fair, it works for quite a lot of people I suppose
[15:08:33] orbyt_: has joined #RubyOnRails
[15:10:54] knight33: has joined #RubyOnRails
[15:22:13] mangold: has joined #RubyOnRails
[15:26:22] mauro1254: has joined #RubyOnRails
[15:30:53] snickers: has joined #RubyOnRails
[16:15:04] apeiros: has joined #RubyOnRails
[16:15:36] platoon23: has joined #RubyOnRails
[16:22:55] tdy: has joined #RubyOnRails
[16:35:33] beowuff: has joined #RubyOnRails
[16:36:28] beholders_eye: has joined #RubyOnRails
[16:42:53] GodFather: has joined #RubyOnRails
[16:55:27] ivanskie: has joined #RubyOnRails
[16:59:21] IanMalcolm: has joined #RubyOnRails
[17:00:39] IanMalcolm: has joined #RubyOnRails
[17:02:47] ss942: <%= link_to l(:label_new_item, l(:label_document_plural)), url_for(controller: "documents", action: "new", project_id: 1), class: 'icon icon-time-add', id: link_id, onclick: "get_project(event, '#{link_id}', '#{select_id}')"%>
[17:02:47] ss942: renders: onclick="get_project(event, &#39;new_document_link_for_zgłoszenia_firmy&#39;, &#39;project_for_zgłoszenia_firmy&#39;)"
[17:02:47] ss942: instead of: onclick="get_project(event, 'new_document_link_for_zgłoszenia_firmy', 'project_for_zgłoszenia_firmy')
[17:02:47] ss942: How to fix it?
[17:07:49] jhass: write the data to data- attributes and write a generic click handler in our of your .js files
[17:08:43] jhass: eh, I mean *one
[17:09:10] Skull0Inc: has joined #RubyOnRails
[17:09:27] SteenJobs: has joined #RubyOnRails
[17:15:19] ss942: has left #RubyOnRails: ()
[17:17:00] IanMalcolm: has joined #RubyOnRails
[17:20:52] orbyt_: Re-asking a question from yesterday - I've got a route that has a query param that is simply passed to a redis.get() query. Is there any reason to scrub this param to avoid execution of arbitrary strings into the redis.get() method?
[17:22:47] orbyt_: The query param is expected to be a random token. I can prefix this token after it's generated with some static string (e.g. "TOKEN ....") and then check that the query param in question begins with that string before passing it to redis.get(), but i'd prefer a method that does not involve modifying the token.
[17:25:10] conta1: has joined #RubyOnRails
[17:31:41] jhass: I think I'd just make sure it's a string and only contains characters your token generator may produce
[17:32:17] jhass: cheap and easy
[17:33:03] jhass: /\A[a-f\d]+\z/ or whatever it is
[17:33:06] sameerynho: has joined #RubyOnRails
[17:33:44] whysthatso: has joined #RubyOnRails
[17:54:01] eckhardt: has joined #RubyOnRails
[17:58:51] mikecmpbll: has joined #RubyOnRails
[18:01:11] quazimodo: has joined #RubyOnRails
[18:05:19] apeiros: has joined #RubyOnRails
[18:06:29] Dbugger: has joined #RubyOnRails
[18:21:13] Travis-42: has joined #RubyOnRails
[18:22:02] Travis-42: I'm creating a Rails application template, and I want it to fail if a command like "insert_into_file" isn't successful (Because it can't find the text to insert after). Is there a straightforward way to do that?
[18:26:24] IanMalcolm: has joined #RubyOnRails
[18:34:18] mikecmpbll: has joined #RubyOnRails
[18:38:34] sandstrom: has joined #RubyOnRails
[18:42:09] mikecmpb_: has joined #RubyOnRails
[18:44:19] mikecmpbll: has joined #RubyOnRails
[18:51:30] orbyt_: jhass hmm thanks
[18:52:38] whysthatso: has joined #RubyOnRails
[19:03:02] mikecmpbll: has joined #RubyOnRails
[19:21:46] ebl: has joined #RubyOnRails
[19:30:35] gambl0re: has joined #RubyOnRails
[19:38:43] defsdoor: has joined #RubyOnRails
[19:48:12] ebl: I'm trying to update an application from rails 5.1.5 to rails 5.2.1 and I'm getting a generic mysql error during some system tests. It only happens when running the test suite, that is, running the application and following the test steps work. Puma is running in single mode, so it doesn't seem multi process related. Any help or insight is appreciated. There is nothing on mysql logs, and the trace for the failed test is here https://hastebin.com/kepetilame.co
[19:48:12] ebl: ffeescript
[19:50:36] SteenJobs: has joined #RubyOnRails
[19:54:49] samort7: has joined #RubyOnRails
[20:03:47] jhass: tbh with that little info and if dropping and recreating the test db doesn't help, I'd pull out wireshark and snoop on the mysql connection to see if that shows some error message
[20:14:15] tdy: has joined #RubyOnRails
[20:14:51] Inside: has joined #RubyOnRails
[20:14:58] Inside: auuughh surely there has to be a faster way to generate tables
[20:15:13] Inside: I'm getting super tired of typing out the html boilerplate for tables :(
[20:39:07] defsdoor: Inside, I wrote a generator
[20:49:29] samort7: has joined #RubyOnRails
[20:52:55] kurko_: has joined #RubyOnRails
[21:04:24] ebl: jhass, thanks, i'll try snooping the connection. already tried recreating the test database but there was no difference
[21:08:00] hightower2: Hey, my rails app is using Devise for authentication, but I have a case where I have a username and password and need to manually call some authentication method
[21:08:09] hightower2: Anyone knows where/what in Devise I need to call for that?
[21:18:27] Inside: manually?
[21:33:17] dviola: has joined #RubyOnRails
[21:39:03] wojnar: has joined #RubyOnRails
[21:54:40] pharma_joe: has joined #RubyOnRails
[22:39:11] quazimodo: I've been dabbling with golang, and hopefully soon rustlang, to augment a rails app that we have which needs to do some maths that ruby's struggling with for a client
[22:40:15] quazimodo: im curious what others are doing these days, i know a lot of people send cpu intensive stuff to c programs via ffi, and the rustlang extension for ruby seems pretty neat
[22:40:44] quazimodo: still, the experience with golang was a bit of a slog to get my data converted into something go likes and then back again for ruby
[22:43:27] glasz: has joined #RubyOnRails
[22:44:57] hightower2: I am using Rails app's secret_key_base string, and in the place where I looked into it, the code takes chars 0..31 from it. Is this needed, or I can just use the whole content of secret_key_base regardless of size?
[22:45:04] hightower2: (the function in which I am using it is not length-limited)
[22:46:35] quazimodo: hightower2: im a little confused by the question, seems to me like you're using the secret key base to sign or encrypt something, in that case you'd be best be careful because there have been times wehre we've invalidated sessions by changing 1 character on it. Not sure if it's best practice or not, but a partial change could kill sessions without having the desired effect on your code if you're
[22:46:41] quazimodo: sampling a subset of it
[22:47:37] hightower2: Right, I am using it to encrypt a JWT token which I send to users who log in
[22:48:22] quazimodo: so there are 2 things here, first one is a little o/t, make sure you have a good reason to use JWT, these things aren't great for sessions, they're good for authentication & authorization between several services
[22:48:33] quazimodo: if you're using it for sessions, don't do that
[22:48:48] quazimodo: other part, best to use the entire secret key base
[22:49:04] quazimodo: i'm curious though, why do your users need to have an encrypted JWT btw
[22:49:26] hightower2: Inside, yes, (regarding my Devise question a bit above), by "manually" I mean I need some low-level function that just takes email and password and returns true/false if password matches, without any other magic
[22:50:03] hightower2: quazimodo, right, I am using it just for auth, not for sessions
[22:50:27] hightower2: also right on #2, I use all of it currently
[22:50:35] hightower2: well, you are right, it doesn't necessarily have to be encrypted, signed would be enough, but well...
[22:51:00] quazimodo: having it encrypted means that all the services that try to use it would need your secret key base, now you're sharing your secret key base
[22:51:28] hightower2: right, good point. I'll think about it
[22:51:32] quazimodo: your front end (if it exists) wouldn't be able to access the JWT either, so i'm not sure that it's a net win for you
[22:52:11] quazimodo: may i ask what your architecture is, i've been using JWT for a little bit & had some heated debates till they taught me why i was doing some ... not so smart stuff
[22:53:23] hightower2: quazimodo, I am writing a graphql endpoint for an existing rails app
[22:54:31] hightower2: regarding why exactly JWT, no particular reason, I just assumed it was sort-of standard to use it
[22:54:41] quazimodo: yeah that's what I thought too
[22:54:52] quazimodo: turns out it's not exactly, there are serious issues with using it...
[22:55:07] quazimodo: are you sending it via cookie or header (like is it a browser or an app that'll be consuming the api ?)
[22:55:45] hightower2: primary use case will be a javascript-based frontent app which will be making ajax calls to it
[22:56:22] quazimodo: ok, so are you sending it via the javascript ajax call, or does the server set it via a secure cookie
[22:56:33] quazimodo: (these questions have a very important reasons)
[22:57:03] hightower2: I was assuming it would be returned in JSON content from graphql, and not as a HTTP header
[22:57:21] quazimodo: understood, this is very dangerous!
[22:58:12] quazimodo: the browser dorks spent untold dollars & hours making sure cookie theft was very difficult, when we move the authentication 'stuff' into javascript world we make it much much easier for other js to steal this auth
[22:58:20] hightower2: indeed, agreed
[22:58:40] quazimodo: it's also way way heavier than a simple signed or encrypted cookie with the user id
[22:59:12] quazimodo: so to get rid of the theft problem it could be set via server in a secure cookie, but now you have a really quite heavy cookie for each request (including assets, etc, anything on that domain really)
[23:00:08] quazimodo: one alternative to it is to send the header and body of the JWT to the javascript, now your front end can send it back & also inspect it for user name, email, etc... but to set the signature in a secure cookie from the server. Things become lighter, but you then add this complexity that's arguably necessary
[23:01:30] hightower2: Right, sure. Good points. Actually, I thought that I could use JWT to encrypt or sign the user's username in it, and then just read it on the server on incoming requests, and thus avoid the need to use server-side sessions at all. But I just realized this won't work, since there *is* data that needs to be put into user session, and I don't intend to use the cookie for data
[23:01:36] quazimodo: I've done this btw, because my API is super simple and expects a JWT in a header on each request. I put a simple middleware up that combines the JWT signature from a secure cookie & a partial JWT header if they exist. This way the phone app can just send the JWT along while the browser app can use the jwt securly with cookies
[23:01:41] quazimodo: but... i'm not sure tat it was worth it
[23:03:34] quazimodo: in any case, unless you have many servers that need to authenticate (imagine you had 5 services that the front end used, they'd all have to either authenticate each request with another auth server, or access the user database themselves, or alternatively use somethnig signed like a jwt
[23:03:47] quazimodo: unless you have that scenario, jwt is excessive & poses problems
[23:04:55] quazimodo: the ideal solution for you is to have a secure cookie set by the server that contains the identifiable param of the user (id, email, whatever) & a signature, then put whatever the front end needs somwhere else like a script tag or whatever
[23:05:07] quazimodo: turns out devise does most af that already
[23:05:56] hightower2: sure, sure. Yeah, I can without a problem return the token in a header and data of the user whose login succeeded via JSON response
[23:07:22] quazimodo: my takeaway with all of this JWT business was 1) JS aint secure enough, don't let the JS have access to the important stuff lest it get stolen easily. 2) JWT should be very short lived & used to prove to a 3rd party that the 1st party has authenticated with the 2nd party
[23:07:59] quazimodo: in a typical browser <-> server relationship it's totally unecessary
[23:09:23] quazimodo: the devise stuff: u = User.find_by_whatever(params[:whatever]), u.valid_password?(params[:password_or_whatever])
[23:09:49] hightower2: ooh, valid_password? is what I was looking for, thanks!
[23:09:49] quazimodo: devise might have a helper method for it but it's pretty much that simple
[23:09:54] hightower2: (I was trying with .authenticate!)
[23:10:03] quazimodo: .i_hate_devise_actually
[23:10:23] hightower2: yeah, not happy myself either but the app already uses it
[23:11:10] quazimodo: man the people in #javascript tore me a new asshole when i told them that i plan on sending JWT via fragments in a header & secure cookie
[23:20:09] mlt-: has joined #RubyOnRails
[23:22:12] mlt-: What is a good way to have an Rspec dummy app for a gem that can work with different Rails versions?
[23:22:42] mlt-: I mean there are certain changes ..like versioned migrations in 5.2.1 that are not there in 4.2.10
[23:22:57] mlt-: Do I have 2 dummy apps?
[23:23:38] mlt-: Or do I make my way through even with application.js.erb to deal with rails-ujs vs jquery-ujs ?
[23:25:10] quazimodo: make 2 dummy apps I suspect
[23:25:18] quazimodo: otherwise you'll be patching differences between them
[23:25:30] quazimodo: it's abit like running multiple browsers for testing css... how nasty
[23:27:00] MrPunkin: has joined #RubyOnRails
[23:27:24] mlt-: quazimodo: that is what I was thinking...but it is quite not DRY to have 2 almost identical dummy apps
[23:28:19] quazimodo: how much code you putting into the dummy apps?
[23:28:26] glasz: has joined #RubyOnRails
[23:28:33] quazimodo: i presume you're just loading your gem into those apps & then running specs against that right??
[23:28:58] mlt-: sort of... there is some controller code and such
[23:29:28] mlt-: If I change something, I'd have to maintain the change across both apps
[23:29:57] mlt-: I feel like I can split only assets and migration folders and keep the rest shared
[23:30:10] mlt-: for assets I need only application.js
[23:30:30] quazimodo: it's likely that you can do that
[23:30:51] quazimodo: your models can be loaded from a place other than dummy_app1/models and dummy_app2/models, for example
[23:31:15] mlt-: another pain that I recall is the change of boolean representaiton in sqlite3
[23:31:27] quazimodo: this could be fragile depending on things, for example features present in one version & not another (such as AR's not method, i believe)
[23:31:40] mlt-: I'd like to keep as much common/shared stuff as I can
[23:31:53] quazimodo: essentially, by supporting multiple rails versions you're creating a complexity that's unavoidable
[23:32:28] mlt-: I'd like to NOT use newer features... so as long as it is compatible with newer Rails, that is fine
[23:32:59] mlt-: ok... just wanted some feedback whether there is a standard way to deal with such things
[23:33:00] quazimodo: go for it, put 2 dummy apps & load your shared stuff from a common place
[23:33:26] quazimodo: haven't heard of one, don't know if such a 'version switcher' exists, though that could be cool
[23:33:29] mlt-: I'll start with 1 but separate migrations and assets
[23:33:42] mlt-: 1 dummy app I mean
[23:33:47] quazimodo: i mean, a well put together version switcher for rails, for testing, would be greate
[23:34:01] mlt-: what do you mean?
[23:34:20] mlt-: You can test multiple versions
[23:34:52] quazimodo: now i don't know what you mean
[23:35:57] hightower2: has joined #RubyOnRails
[23:35:57] mlt-: quazimodo: you said it would be nice to have Rails version switcher for testing. And I said nothing prevents from testing a gem against multiple versions. It was easier when there was no such drastic changes.
[23:38:21] mlt-: speaking of that...I came across appraisal gem .. I hope it is the way to go
[23:38:48] mlt-: and they say to add various gemfiles for Travis testing explicitly
[23:42:06] pharma_joe: has joined #RubyOnRails
[23:55:29] fragamus: has joined #RubyOnRails
[23:57:47] ur5us: has joined #RubyOnRails