« Back to channel list

#RubyOnRails - 15 May 2017

« Back 1 day Forward 1 day »
[00:00:26] amperry: fryguy: I just changed it to 'url('image.png') no-repeat center center;' and it works
[00:01:34] fryguy: what's the resulting difference in the css files
[00:03:06] amperry: fryguy: not sure, but I suspect the problem was in not putting 'center center' in the rule.
[00:04:36] nachoman: has joined #RubyOnRails
[00:11:27] amperry: although it's not showing on production when I push the changes and run 'sudo rake assets:precompile'
[00:12:59] amperry: and the resulting file says "background: url('image.png) no-repeat center center;"
[00:13:51] cam27: has joined #RubyOnRails
[00:16:04] fryguy: amperry: were you doing <% image_url(... %> or <%= image_url(... %>
[00:16:57] amperry: fryguy: neither. Using "url('image.png') no-repeat center center;"
[00:17:19] fryguy: amperry: no, from before
[00:17:21] fryguy: when it wasn't working
[00:17:23] fryguy: before center center
[00:17:46] amperry: well, it wasn't saved in vc, but I believe I did not have the
[00:18:08] fryguy: you'd need htat
[00:18:16] amperry: let me give that a try
[00:18:22] fryguy: not using rails url helpers won't work with precompiled assets because of fingerprinting
[00:20:43] amperry: so do I need to use image_url when I use <%= ... %>?
[00:21:19] amperry: because '<%= url(...) %>' gives me an error
[00:21:33] amperry: but image_url doesn't render the image.
[00:22:03] fryguy: again I ask: what does the resulting css file look like
[00:23:06] amperry: fryguy: background: /assets/image-4b35c535130619179a80a03580cc1df5eba13f5ad95696f4e6d34c62f20bf3a0.png no-repeat center center;
[00:23:35] fryguy: and does that file exist in your public directory?
[00:23:45] amperry: nope, it's in app/assets/images
[00:23:55] fryguy: did you assets:precompile locally?
[00:24:16] amperry: hrm... thought I did
[00:24:26] fryguy: then, are you sure that file doesn't exist?
[00:24:30] fryguy: does the manifest file exist?
[00:24:41] fryguy: what if you rake assets:clobber and refresh
[00:25:03] amperry: let me give that a try
[00:25:27] amperry: so, rake assets:clobber, then ...?
[00:25:33] fryguy: refresh the page
[00:25:47] fryguy: possibly restart your app server depending on how it's configured
[00:27:43] amperry: still looking for it under /assets/image-4b35c535130619179a80a03580cc1df5eba13f5ad95696f4e6d34c62f20bf3a0.png
[00:28:16] fryguy: did you restart the app server?
[00:28:46] fryguy: is spring running?
[00:29:42] amperry: no; I've got zeus
[00:29:46] fryguy: is that running?
[00:30:10] amperry: yeah; let me restart it
[00:34:08] amperry: no luck, using image_url
[00:34:30] fryguy: what's the contents of your public directory
[00:35:47] amperry: I've got an assets and an images directory. I thought it was looking under app, though; is it really looking under public?
[00:36:33] fryguy: what's inside of the assets directory
[00:39:31] amperry: bunch of stuff, including image-4b35c535130619179a80a03580cc1df5eba13f5ad95696f4e6d34c62f20bf3a0.png
[00:39:53] amperry: seems to be the right fingerprint
[00:40:10] amperry: that's under public/assets
[00:40:11] fryguy: are you sure you ran rake assets:clobber earlier?
[00:40:17] amperry: I just did again
[00:40:25] fryguy: it should delete that file
[00:40:34] amperry: then ran rake assets:precompile again
[00:40:40] fryguy: no don't run precompile afterwards
[00:40:52] fryguy: obviously precompile is going to recreate it
[00:41:01] fryguy: you don't want that, not yet
[00:41:09] fryguy: make sure it works without precompilation first.
[00:41:22] fryguy: your next problem is that you likely have serving of static assets directly from rails disabled in whatever environment you are working in
[00:41:54] fryguy: take a look at config/environments/whatever.rb for the static asset setting, change it to true (don't do this in actual production though! get a real webserver), and try again
[00:43:05] amperry: is that config.assets.digest?
[00:43:24] amperry: but that's already 'true'
[00:44:05] amperry: I see no string 'static' in config/environments/development.rb
[00:44:33] fryguy: what version of rails are you using
[00:45:28] amperry:; I do see config.serve_static_files = true in production.rb; is that a bad setting?
[00:45:56] amperry: let me change that; there's no such setting in development, though
[00:46:17] endemic: has joined #RubyOnRails
[00:46:45] fryguy: add it to dev and set it to true
[00:47:55] xco: has joined #RubyOnRails
[00:48:31] xco: hi, i’m using redis. items delete on redis but in the view after deletion, they still show. any tips on avoiding this behaviour?
[00:48:44] endemic: has joined #RubyOnRails
[00:49:03] Jameser: has joined #RubyOnRails
[00:49:18] xco: usually with activerecord models, you hit delete and the disappear, but for some reason the items still show in my view even though it’s deleted on redis
[00:49:21] fryguy: xco: who code about how the items are appearing in the view
[00:49:43] fryguy: also show a failing test
[00:51:16] amperry: fryguy: okay, added to development.rb, ran rake assets:clobber, restarted zeus, restarted server, reloaded page; still no background image. Should I change application.css.erb to look for something else than "<%= image_url('image.png') %>" ?
[00:51:33] xco: fryguy: this is how the view looks like https://gist.github.com/siaw23/5579957292c21cedf42904d281ee5321
[00:52:46] xco: line 12 is the link to the item being deleted
[00:52:47] fryguy: xco: and the controller that populates stats
[00:53:00] fryguy: amperry: what do browser logs show for fetching the file
[00:53:33] xco: fryguy: controller: https://gist.github.com/siaw23/5579957292c21cedf42904d281ee5321#file-controller-rb
[00:54:01] fryguy: xco: where is the redis fetching here?
[00:54:27] xco: fryguy: line 9
[00:54:38] xco: SimilarObject is a redis model
[00:54:57] fryguy: is this the right controller? there is no setting of a stats instance variable
[00:55:02] fryguy: how is the stats instance variable getting set
[00:59:56] xco: oooo sorry
[01:01:07] xco: fryguy: updated https://gist.github.com/siaw23/5579957292c21cedf42904d281ee5321#file-controller-rb
[01:02:11] fryguy: ok and what's this "redis model" that you are talking about
[01:03:37] xco: fryguy: model https://gist.github.com/siaw23/5579957292c21cedf42904d281ee5321#file-model-rb
[01:04:32] amperry: fryguy: when you say browser logs, I do not know what you mean. Is this in chrome's dev tools, for example, or somewhere else?
[01:04:45] fryguy: amperry: chrome dev tools for example
[01:05:32] amperry: under what tab?
[01:05:54] amperry: I see network->preserve logs, but I don't know what to make of them
[01:06:00] fryguy: xco: i don't know anything about redis model that would suggest anything obvious
[01:06:04] harfangk: has joined #RubyOnRails
[01:06:11] fryguy: amperry: is it making a request for the image
[01:06:25] xco: fryguy: ok thanks anyway for trying :)
[01:07:14] amperry: fryguy: would that be under the 'Img' sub heading (if so, no) or 'Css' (in which case, I need to dig).
[01:07:47] fryguy: amperry: just pastebin the full application.css file then
[01:08:10] fryguy: surprised given how long you've been here how much of this stuff you aren't familiar with
[01:08:16] Technodrome: has joined #RubyOnRails
[01:10:46] amperry: I only retain what I use
[01:12:05] amperry: https://pastebin.com/cmZDUdC3
[01:13:48] nachoman: has joined #RubyOnRails
[01:15:32] jane_booty_doe: has joined #RubyOnRails
[01:17:13] fryguy: no, the rendered css
[01:21:00] amperry: https://pastebin.com/jtYGryds
[01:23:20] Tempesta: has joined #RubyOnRails
[01:25:28] fryguy: you still have the fingerprinted image there, is that what you want?
[01:26:25] apparition: has joined #RubyOnRails
[01:26:36] fryguy: ok, so rake assets:clobber and restart your app server (and probably zeus too)
[01:26:57] fryguy: and then show the css again
[01:28:36] amperry: still shows "background: /assets/image-4b35c535130619179a80a03580cc1df5eba13f5ad95696f4e6d34c62f20bf3a0.png no-repeat center center;" ran clobber, restarted zeus and the server, did not run "rake assets:precompile".
[01:29:03] fryguy: what is the name of the css file that you are requesting
[01:30:18] amperry: http://localhost:3000/assets/application.self-1adb01c91810993e040fcbb8bc838108f001353caea6934dfc4a2f60fda77ddd.css?body=1
[01:31:02] fryguy: there should not be a fingerprint there if you've cleared assets
[01:31:07] fryguy: what is the page that is requesting this css
[01:31:37] fryguy: i might actually be wrong about that though, i'm not sure
[01:32:05] amperry: WelcomeController#index, if that's what you mean
[01:32:56] fryguy: do `curl http://localhost:3000/assets/application.self-1adb01c91810993e040fcbb8bc838108f001353caea6934dfc4a2f60fda77ddd.css?body=1` and pastebin that
[01:35:27] waseem_: has joined #RubyOnRails
[01:36:47] amperry: fryguy: created a gist: https://gist.github.com/amp108/117017f2441f41babe0a276b25e42c33
[01:37:03] amperry: curl didn't like the '?body=1', but taking that out gives me what you see there
[01:37:20] Tempesta: has joined #RubyOnRails
[01:37:43] fryguy: yah i don't know what's up with your app server then
[01:37:51] fryguy: something is remaining running after clobbering assets
[01:37:58] fryguy: i don't know enough about zeus to offer any further advice
[01:40:24] amperry: That's cool. I try not to ask here unless it's a real stumper. Thank for looking, though.
[01:42:32] rfoust: has joined #RubyOnRails
[01:51:39] Technodrome: has joined #RubyOnRails
[02:07:51] quazimodo: has joined #RubyOnRails
[02:23:39] trooney: has joined #RubyOnRails
[02:24:21] trooney: If I do: `render json: { "2" => "2", "1" => "1" }` -- how come the hahs order isn't maintained? Rails always sorts by hash key...
[02:24:27] quazimodo: has joined #RubyOnRails
[02:25:35] waseem_: has joined #RubyOnRails
[02:51:05] fryguy: ruby does not guarantee hash ordering. it's coincidentally true of MRI versions 1.9+ in the initial hash implementation, but nothing about the language spec guarantees consistent key ordering. relatedly, it's probably a result of some processing that the json encoder is doing.
[02:51:22] fryguy: if you want to ensure ordering of elements, a Hash is not the data structure you want to be using in ruby
[03:00:28] sandstrom: has joined #RubyOnRails
[03:15:52] LightStalker: has joined #RubyOnRails
[03:30:26] aseibert: has joined #RubyOnRails
[03:35:02] tamouse__: has joined #RubyOnRails
[03:47:30] captproton: has joined #RubyOnRails
[04:10:03] pLaTo0n: has joined #RubyOnRails
[04:19:08] sevenseacat: has joined #RubyOnRails
[04:26:05] quazimodo: has joined #RubyOnRails
[04:39:34] uks: has joined #RubyOnRails
[04:41:08] xco: has joined #RubyOnRails
[04:45:41] ych: has joined #RubyOnRails
[04:54:29] clouder`grr: has joined #RubyOnRails
[05:05:03] xco: has joined #RubyOnRails
[05:10:17] Technodrome: has joined #RubyOnRails
[05:39:11] pharma_joe: has joined #RubyOnRails
[05:47:06] lurkrake: has joined #RubyOnRails
[05:49:03] srinidhi: has joined #RubyOnRails
[05:50:47] dionysus69: has joined #RubyOnRails
[05:57:21] laekur: has joined #RubyOnRails
[06:10:59] User458764: has joined #RubyOnRails
[06:37:07] conta: has joined #RubyOnRails
[06:43:52] lurkrake: has joined #RubyOnRails
[06:47:00] lurkrake: has left #RubyOnRails: ()
[06:54:23] ferr: has joined #RubyOnRails
[06:54:51] xall: has joined #RubyOnRails
[07:05:37] dionysus69: has joined #RubyOnRails
[07:16:49] kies: has joined #RubyOnRails
[07:22:00] armyriad: has joined #RubyOnRails
[07:26:59] marr: has joined #RubyOnRails
[07:27:41] tofutoon: has left #RubyOnRails: ()
[07:29:43] User458764: has joined #RubyOnRails
[07:31:37] sandstrom: has joined #RubyOnRails
[07:32:58] Doldge: has joined #RubyOnRails
[07:34:41] Volhist: has joined #RubyOnRails
[07:53:18] Jameser: has joined #RubyOnRails
[07:56:56] User458764: has joined #RubyOnRails
[07:57:03] mikecmpbll: has joined #RubyOnRails
[08:09:33] ur5us: has joined #RubyOnRails
[08:11:54] arBmind: has joined #RubyOnRails
[08:20:51] lipoqil: has joined #RubyOnRails
[08:30:26] hron84: has joined #RubyOnRails
[08:31:38] hron84: Hi! I started to upgrade an old asset gem, blueprint-rails. It works quite well now, except Rails 5.1 does not scan its assets directory for stylesheets. What do I wrong? https://github.com/hron84/blueprint-rails/tree/hron84/rails-5-upgrade
[08:32:37] hron84: I tried to move vendor/assets to app/assets locally with no success.
[08:32:59] sevenseacat: you shouldnt need to move them from there to there
[08:33:49] sevenseacat: what error are you getting?
[08:35:18] kies: has joined #RubyOnRails
[08:45:01] lxsameer: has joined #RubyOnRails
[09:00:13] v|sh: has joined #RubyOnRails
[09:03:49] hron84: sevenseacat: i get no error, just even if i restart spring and rails, config.assets.paths does not include blueprint-rails asset paths
[09:04:11] hron84: sevenseacat: and thus sprocket cannot find blueprint/typography.css for example.
[09:04:16] sevenseacat: the readme does say "We don't include those files in default stylesheets load paths, because you may want not to use some of them."
[09:05:06] hron84: OK, what should I do to do it? It's a custom fork, i can make changes what is not intended by the original author
[09:05:11] hron84: What I need to include them?
[09:05:46] hron84: I just dunno how Rails Engines work in this aspect.
[09:08:01] sevenseacat: either, but I'm sure we can figure it out
[09:08:32] sevenseacat: by comparing your gem with any existing gem that packages js - I've just been through my app today and ripped several of them out
[09:10:34] hron84: I just dunno what i have to see. I checked jquery-rails and such things, but I never see it explicitly register asset path.
[09:12:47] hron84: sevenseacat: http://guides.rubyonrails.org/asset_pipeline.html#adding-assets-to-your-gems <= this says it's enough if i have a subclass of Rails::Engine.
[09:13:44] sevenseacat: honestly, at this point I'd probably just create a new gem and compare the differences
[09:17:11] workmad3: has joined #RubyOnRails
[09:30:46] hron84: sevenseacat: tbh i have no idea how can i make an asset gem otherwise. As I see, blueprint-rails follows the recommended semantic and I can't find a step-by-step howto for an assets gem.
[09:33:00] matthewd: Moving to app/assets is necessary, fwiw
[09:33:27] sevenseacat: one of the gems I removed today from our app was https://github.com/jordanbrock/bootstrap-daterangepicker-rails
[09:33:36] sevenseacat: stuff is in vendor/assets
[09:34:11] v|sh: has joined #RubyOnRails
[09:34:46] matthewd: That's one of the changes I never understood, but yeah, as of some sprockets version, app/ and vendor/ got treated differently
[09:35:02] dyjakan: maybe someone will find it useful
[09:35:02] dyjakan: https://github.com/dyjakan/ruby-rails-interview-questions
[09:35:04] Talltree: has joined #RubyOnRails
[09:35:08] dyjakan: any input highly appreciated
[09:35:55] sevenseacat: good lord I wouldn't know the answers to half of those
[09:37:39] hron84: matthewd: i tried to move it, but it didn't solve my issue.
[09:37:45] Papierkorb: > Which is generally the better option (not only for Ruby): a recursive function or an iterative one?
[09:38:10] dyjakan: generally speaking iterative is better
[09:38:23] matthewd: Yeah, there are few that I'd be interested to know/argue the "right" answers on
[09:38:24] sevenseacat: or any language with TCO
[09:38:35] matthewd: Also, qualify "better"
[09:38:49] dyjakan: but open questions like these are doubleplusgood
[09:38:51] matthewd: Readability is a thing too
[09:38:53] dyjakan: becasue you _can_ argue
[09:39:02] dyjakan: showing that you actually _understand_ your position
[09:39:07] sevenseacat: I'm glad I'm past the point where I get asked these kinds of questions in interviews
[09:39:10] matthewd: > How would you declare and use a constructor in Ruby?
[09:39:38] matthewd: I know how I'd answer that, but I suspect an interviewer might disagree
[09:39:47] Papierkorb: matthewd: "There are none"?
[09:41:06] matthewd: `def self.my_constructor; allocate.tap { .. }; end` would be my closest interpretation
[09:41:42] hron84: matthewd: the "reference" asset gem (referred by the documentation itself!), jquery-rails uses vendor/assets too
[09:41:49] Papierkorb: dyjakan: > What is a Class, what is an Object and why do we need Module?
[09:42:20] matthewd: ACTION > What is the Convention over Configuration pattern? Provide examples of how it is applied in Rails
[09:42:40] Papierkorb: dyjakan: > Why is Enumerable is so useful?
[09:42:41] matthewd: You would get different answers about that from different *Rails core* members
[09:43:44] dyjakan: matthewd: def initialize acts like a constructor, why would you prefer your solution?
[09:43:58] hron84: dyjakan: swap the "closure" and lambda/block/proc question. If this list is taken by this order, the closure question should precede the other one.
[09:44:39] arBmind: has joined #RubyOnRails
[09:44:39] dyjakan: hron84: valid point, t/y
[09:46:45] matthewd: dyjakan: That's an initializer; unless this is "questions to ask someone switching to ruby from java" if it's using a foreign term for a common concept, I'll invent a different interpretation
[09:46:48] hron84: dyjakan: same with extend/prepend/include, this question should be moved after "What are mixins"
[09:47:11] matthewd: dyjakan: Alternatively, what is Class#new if not a constructor?
[09:47:41] dyjakan: matthewd: I disagree, constructor and destructor are concepts from OOP, it's an universal name for them as far as I know
[09:48:04] sevenseacat: ACTION gets popcorn
[09:48:09] hron84: matthewd: php uses __construct(), C and Java uses ClassName() for constructor, but basically, def initialize is the Ruby interpretation of a constructor
[09:48:15] dyjakan: not only used in Java, and the concept is exatly same with initialize
[09:49:05] matthewd: Okay, so what's Class#new ?
[09:49:53] dyjakan: I see what you did there but this is a merely language issue, playing linguistics
[09:49:57] hron84: Class.new is a kind of new operator. Class#new calls Class#initialize, except if you redefine it.
[09:50:09] dyjakan: i.e. if you would elaborate on an interview with such logic then you would pass with flying colours
[09:50:17] hron84: matthewd: like, "def <=> " implements the comparator.
[09:51:00] hron84: so if a class has a "def <=>" you can use logical comparison operators on it, like <, >= and so on.
[09:51:30] hron84: Class.new is something that other OOP languages solves with new Class()
[09:51:47] dminuoso: By "other" you seem to imply JavaScript surely.
[09:52:09] hron84: look at PHP. Look at Java. Look at C#/C++
[09:52:37] matthewd: hron84: "def <=>" is a method implementing an operator (special syntax). "def self.new" is just a method.
[09:52:56] dminuoso: Out of these one is a silly example (in particular to be named first), in C++ the keyword "new" adds a special notion of storage duration, C# I cant judge.
[09:52:59] matthewd: hron84: (and defining <=> isn't enough to make < magically work)
[09:53:25] dyjakan: https://en.wikipedia.org/wiki/Constructor_(object-oriented_programming)#Ruby
[09:54:04] dminuoso: `What does it mean that "everything in Ruby is an object"?' #=> it means the author is lying.
[09:54:11] dminuoso: Not everything is an object in Ruby. :o
[09:54:26] dyjakan: but you certainly have heard the term itself?
[09:54:44] dyjakan: hence the explaination should be why people use it, and you're free to argue that it's actually not true
[09:55:36] sevenseacat: matthewd I think you'd fail these interviews too
[09:56:21] dminuoso: Oh man, a lot of these questions would incite some serious rage in me if I was asked them.
[09:56:26] matthewd: I'm not sure that would be a bad thing
[09:56:51] dyjakan: this is typical fo experts in particular field
[09:57:06] dyjakan: such questions are always limited and any expert can elanorate deeply on them
[09:57:10] sevenseacat: thinking they're silly questions?
[09:57:32] dyjakan: but you need to have some way to assert one's knowledge in a quantifible way
[09:58:05] sevenseacat: 'here's all the stuff I've built in the past'
[09:58:30] dminuoso: Indeed. You can best judge a persons skills by just looking at their work.
[09:58:43] hron84: if they're public
[09:58:48] dminuoso: Questinnaires usually suck
[09:58:53] dyjakan: I won't go into this discussion; HN is full of threads like these ;)
[09:59:19] hron84: if your subject worked for a company that only develops closed source stuffs, good luck to judge him
[09:59:21] sevenseacat: I'll take your word for it, I don't read HN
[10:00:12] matthewd: If this is a typical reaction for experts in a particular field, this probably isn't a useful place to solicit "highly appreciated" input
[10:00:14] dminuoso: See, if I was to hire a ruby developer I would just hand them a pen and paper and tell them to draw the Ruby object model and hammer them to bits when they forget to explain how singleton classes come into existance! And record the whole thing! And put it on youtube!
[10:00:35] tbuehlmann: you are mean
[10:00:44] dminuoso: Thank you, sir.
[10:00:49] sevenseacat: I'm not a hiring manager, I'm just a developer :)
[10:01:07] dminuoso: tbuehlmann: Do you think I should switch jobs? I hear HR has some spots opening..
[10:02:10] tbuehlmann: what about customer support?
[10:02:47] dminuoso: tbuehlmann: I almost raged when a coworker came and told me that "my app was shit and buggy". When I asked what the problem was, he showed me that when typing in the middle of a text, it kept overwriting things..
[10:02:51] dminuoso: So I dont know..
[10:02:58] dminuoso: Was really hard to keep calm.
[10:03:24] dminuoso: But the question "Im sorry, are you from the past?" came up..
[10:04:10] tbuehlmann: sturgeon's law probably?
[10:08:22] Talltree_: has joined #RubyOnRails
[10:25:32] shotbug: has joined #RubyOnRails
[10:34:11] Talltree: has joined #RubyOnRails
[10:43:03] adlerdias: has joined #RubyOnRails
[10:54:27] xco: has joined #RubyOnRails
[10:59:42] dminuoso: tbuehlmann: I dont know. Just the leap to conclusion that it must be a bug and proof that the software is shitty was quite insulting.
[10:59:53] dminuoso: I wouldn't have minded an honest "stupid problem" as much really.
[10:59:54] v|sh: has joined #RubyOnRails
[11:00:59] captproton: has joined #RubyOnRails
[11:07:20] Talltree: has joined #RubyOnRails
[11:15:22] Technodrome: has joined #RubyOnRails
[11:22:38] frojnd: has joined #RubyOnRails
[11:22:41] frojnd: Hi there.
[11:28:56] frojnd: Currently I have in my sessions controller something like this: user.user_type == "student" ? redirect_to students_path : redirect_to teachers_path ... But now I would like to redirect to what user clicked before sign in. How can I achieve that?
[11:29:40] frojnd: I am using monban for authentication.
[11:29:55] frojnd: Don't know what to google to be hones.
[11:35:33] bbrowning: has joined #RubyOnRails
[11:36:42] arBmind: has joined #RubyOnRails
[11:38:57] frojnd: Is it possible and how ot "catch" somewhere where the user clicked before sign in?
[11:41:36] Ergo: has joined #RubyOnRails
[11:44:22] Ergo: has joined #RubyOnRails
[11:51:07] v|sh: has joined #RubyOnRails
[11:57:41] DrYockel: has joined #RubyOnRails
[11:58:46] frojnd: No ideas?
[12:00:34] Jameser: has joined #RubyOnRails
[12:12:52] aajjbb: has joined #RubyOnRails
[12:17:57] Jameser: has joined #RubyOnRails
[12:18:11] marr: has joined #RubyOnRails
[12:19:53] quazimodo: has joined #RubyOnRails
[12:22:53] Jameser: has joined #RubyOnRails
[12:24:27] hashrocket: has joined #RubyOnRails
[12:26:30] shotbug: has joined #RubyOnRails
[12:27:22] Jameser: has joined #RubyOnRails
[12:32:53] arup_r: has joined #RubyOnRails
[12:33:04] bbrowning: has left #RubyOnRails: ("Leaving")
[12:37:42] am55: frojnd, looks at The Rails Tutorial, specifically the sessions_helper.rb and store_location method
[12:37:43] quiller: has joined #RubyOnRails
[12:38:24] arup_r: sevenseacat: Hi.. How are you? Long time no see here :)
[12:40:28] anomaly: has joined #RubyOnRails
[12:43:49] shotbug: has joined #RubyOnRails
[12:49:33] oki: has joined #RubyOnRails
[13:13:31] arup_r: has joined #RubyOnRails
[13:14:36] chouhoulis: has joined #RubyOnRails
[13:22:41] mrgreenfur: has joined #RubyOnRails
[13:23:09] mrgreenfur: Morning everyone! I’d like to moniotr my app for errors in production, how do folks keep on top of errors and problems that happen in prod?
[13:26:23] sevenseacat: you want an exception notification service like bugsnag, airbrake, sentry, etc.
[13:26:56] mrgreenfur: @sevenseacat thanks! is there one you recommend or is popular?
[13:27:14] sevenseacat: we use bugsnag. it does the job :)
[13:27:23] oki: mrgreenfur: errbit on heroku
[13:27:30] mikecmpbll: we use sentry.io , similarly, it does the job.
[13:28:28] tbuehlmann: I've used appsignal in the past, did the job
[13:30:58] patarr: has joined #RubyOnRails
[13:31:04] DLSteve: has joined #RubyOnRails
[13:32:15] mrgreenfur: thanks for the recommendations, much appreciated
[13:32:28] mrgreenfur: sounds like there’s no clear winner, i’ll pick on ui and price then I suppose
[13:33:29] srinidhi: has joined #RubyOnRails
[13:34:39] ResidentBiscuit: has joined #RubyOnRails
[13:38:03] rfoust: has joined #RubyOnRails
[13:41:35] apparition: has joined #RubyOnRails
[13:41:41] frojnd: has joined #RubyOnRails
[13:43:34] Technodrome: has joined #RubyOnRails
[13:48:19] dyjakan: sentry's UI is a little bit shit, AppSignal much better IMO
[13:48:57] dyjakan: but as others said, there's no clear winner and they _do the job_
[13:49:10] mikecmpbll: i like sentry's UI.
[13:49:33] arup_r: has joined #RubyOnRails
[13:49:44] sevenseacat: airbrake is shit and doesnt do the job. my two cents.
[13:50:15] dyjakan: oh, hm yeah I also didn't like AirBrake
[13:50:22] dyjakan: Sentry / AppSignal much better
[13:51:09] mikecmpbll: sentry's pricing is also very agreeable.
[13:51:55] mikecmpbll: if you don't have many errors :)
[13:53:00] mikecmpbll: appsignal would cost us 10x more.
[13:58:41] arup_r: has joined #RubyOnRails
[14:00:02] mrgreenfur: anyone tried skylight.io?
[14:00:46] mrgreenfur: oh it’s for performance not errors oops
[14:02:36] mikecmpbll: i tried it fwiw—wasn't that enamoured.
[14:02:56] sevenseacat: we've used it in the past
[14:04:09] captproton: has joined #RubyOnRails
[14:05:46] xco: has joined #RubyOnRails
[14:06:29] andywww: has joined #RubyOnRails
[14:06:37] xco: has joined #RubyOnRails
[14:06:58] andywww: has left #RubyOnRails: ()
[14:07:11] andywww: has joined #RubyOnRails
[14:07:32] xco: has joined #RubyOnRails
[14:08:17] xco: has joined #RubyOnRails
[14:09:06] xco: has joined #RubyOnRails
[14:09:18] bruno-: has joined #RubyOnRails
[14:09:43] andywww: Having a bit of an encoding issue. I’m uploading a UTF-8 encoded text file to a carrierwave uploader which seems to be storing it as ascii-8bit. I’ve done a bit of preliminary reading which suggests its ruby that works to that as a default. Thats fine, but I do need to maintain the UTF8 for when the file is downloaded again.
[14:09:46] xco: has joined #RubyOnRails
[14:10:44] xco: has joined #RubyOnRails
[14:10:48] andywww: can someone give me a bit of steer as to how to best go about maintaining the encoding on carrierwave uploads? or if its a case of geting down and dirty with force_encoding etc?
[14:11:19] andywww: I’m not sure if the fix is in the carrierwave configuration domain or in the ruby string handling domain
[14:11:29] xco: has joined #RubyOnRails
[14:14:49] Jameser: has joined #RubyOnRails
[14:18:29] quazimodo: has joined #RubyOnRails
[14:22:00] xall: has joined #RubyOnRails
[14:22:25] Jameser: has joined #RubyOnRails
[14:28:54] Jameser: has joined #RubyOnRails
[14:35:30] pupsicle: has joined #RubyOnRails
[14:38:25] norfumpit: has joined #RubyOnRails
[14:38:42] chouhoulis: has joined #RubyOnRails
[14:38:57] norfumpit: i got a rails 5 api only app, and a path to a file in the public folder in my controller, need to turn that path into an absolute url
[14:39:48] arup_r: has joined #RubyOnRails
[14:40:37] Jameser: has joined #RubyOnRails
[14:41:27] boena: has joined #RubyOnRails
[14:41:47] chouhoulis: has joined #RubyOnRails
[14:43:14] mordof: has joined #RubyOnRails
[14:43:49] mordof: does anyone know if apidock.com is intentionally just taken down? or if there's a temporary issue.
[14:44:40] mordof: i don't use it much anymore since i'm updating to rails 5, but google still gives apidock high ranking priority so i keep clicking on it
[14:48:54] havenwood: mordof: You might want to just blacklist apidock.com from your search permanently. Or omit it from your particular search: https://www.google.com/search?q=rails+-apidock.com
[14:49:51] mordof: that works. didn't think about doing that :) thanks
[14:50:20] aajjbb: has joined #RubyOnRails
[14:58:31] theunraveler: has joined #RubyOnRails
[15:00:09] jphase: has joined #RubyOnRails
[15:03:23] DoubleMalt: has joined #RubyOnRails
[15:05:01] arBmind: has joined #RubyOnRails
[15:07:40] ascarter: has joined #RubyOnRails
[15:08:54] hobodave: has joined #RubyOnRails
[15:11:12] ascarter: has joined #RubyOnRails
[15:13:37] irishfromua: has joined #RubyOnRails
[15:14:44] quirkycoders: has joined #RubyOnRails
[15:15:11] ascarter_: has joined #RubyOnRails
[15:18:29] pupsicle: has joined #RubyOnRails
[15:20:07] mauro1254: has joined #RubyOnRails
[15:25:25] captproton: has joined #RubyOnRails
[15:27:05] xall: has joined #RubyOnRails
[15:29:10] djbkd: has joined #RubyOnRails
[15:29:16] mauro1254: Hi folks, is there a rails equivalent project to http://laradock.io/? The one mentioned at http://laradock.io/related-projects/ seems at early stage. I'm currently using my own solution based on https://github.com/phusion/passenger-docker
[15:32:19] mustmodify: has joined #RubyOnRails
[15:32:20] anomaly: has left #RubyOnRails: ()
[15:32:38] mustmodify: So am I correct in understanding that we're only in Standard Time for like 3 or 4 months out of the year?
[15:33:09] xco: has joined #RubyOnRails
[15:33:29] apeiros: "standard time"?
[15:37:14] mordof: mustmodify: if you're talking about 4 and a half months if you're talking about EST/EDT
[15:37:29] mordof: first sunday of november to second sunday in march
[15:37:44] arup_r: has joined #RubyOnRails
[15:37:46] mordof: lol.. i messed up my first message.. oh well
[15:38:02] xco: has joined #RubyOnRails
[15:39:19] quirkycoders: has joined #RubyOnRails
[15:40:10] xco: has joined #RubyOnRails
[15:40:26] mordof: apeiros: it's amazing how people have the capability to only look at the world we know from our point of view. even reading his message, it took your response to make me remember about other time zones
[15:41:11] apeiros: it's sometimes difficult to figure out what part of your context you have to provide others to make sense of what you say
[15:41:18] mordof: as far as north america is concerned, less people are actually in EST/EDT than not
[15:41:31] fryguy: how can I control what puma logs to stderr? it seems super verbose, especially considering I also have rails logging to {environment}.log
[15:41:36] duderonomy: has joined #RubyOnRails
[15:41:41] apeiros: but honestly, given the zero reaction of mustmodify, I just file that under "not actually interested in an answer"
[15:42:34] mordof: apeiros: lol.. i answered because i was more shocked at the truth of it myself. the concept of EDT is just ridiculous to begin with, and now i realise we have to live with that issue just because 1/3 of the year is darker earlier
[15:43:01] apeiros: DST should die.
[15:43:57] matthewd: Without DST, I think programmers would do an even worse job of remembering Time Is Hard
[15:44:01] mordof: let's just all use UTC and get over the fact that our lunch time should be noon
[15:44:34] tbuehlmann: we should be glad we haven't colonized mars yet
[15:44:45] mordof: i love how that comes into it
[15:44:51] mordof: mars is already dumb with time zones
[15:44:57] apeiros: matthewd: time is easy. just use the timecube.
[15:45:05] mordof: timecube?
[15:45:09] matthewd: I already encounter enough software (okay, only occasionally, but still) that thinks it can store a TZ as an integer hour offset
[15:45:11] apeiros: sadly the original domain is gone
[15:45:32] apeiros: mordof: http://timecube.2enp.com
[15:45:39] apeiros: seems to be a mirror of the original
[15:45:54] apeiros: matthewd: oh dear. yeah, offset != tz
[15:46:18] mordof: not only that, offsets aren't hourly
[15:46:35] mordof: aren't always*
[15:46:43] matthewd: Yeah. The former I can deal with by adjusting my TZ setting every six months. The latter I can't. :)
[15:46:45] apeiros: india, *cough*
[15:46:57] apeiros: they sometimes aren't even half-hourly
[15:47:02] apeiros: they also aren't the same in all years
[15:47:14] mordof: this discussion is getting super super depressing
[15:47:16] mordof: i hate time zones
[15:47:25] apeiros: use swatch beats!
[15:47:49] mordof: oooh interesting
[15:47:51] mordof: i haven't heard of this before
[15:49:01] apeiros: because it's (I think) mostly a marketing gag
[15:49:07] apeiros: https://www.swatch.com/en_us/internet-time/
[15:49:54] quirkycoders: has joined #RubyOnRails
[15:49:54] soule: has joined #RubyOnRails
[15:50:09] mordof: turns out it's based on some time zone in switzerland
[15:50:17] cam27: has joined #RubyOnRails
[15:50:20] apeiros: but it has no timezones!
[15:50:31] apeiros: it's the same "value" everywhere in the world at the same time!
[15:50:44] somerandomteen: has joined #RubyOnRails
[15:50:44] apeiros: also it's nicely a value in the range of 0-999
[15:50:44] matthewd: I've just transcended time and track all information via Object IDBEST
[15:50:56] apeiros: tell me more?
[15:51:15] apeiros: Isotope-differentiated binding energy shift tags?
[15:51:22] matthewd: https://www.youtube.com/watch?v=Iewwk1j4I3o
[15:51:48] somerandomteen: Hi there! Any ideas why Devise is returning the {authentication_keys} variables as capitalised? For instance, I get "Invalid Email or password" rather than "Invalid email or password" as one would expect.
[15:51:50] matthewd: It's like timecube, only references "Matz (from Ruby)" :)
[15:51:56] apeiros: oh dear :D
[15:52:27] apeiros: looks like he's on some kinds of drugs
[15:53:54] apeiros: but unlike timecube, there are short glimpses of sense!
[16:01:31] andywww: has left #RubyOnRails: ()
[16:01:53] polishdub: has joined #RubyOnRails
[16:11:34] brent__: has joined #RubyOnRails
[16:12:21] bruno-: has joined #RubyOnRails
[16:15:12] waseem_: has joined #RubyOnRails
[16:15:42] mustmodify: Stupid kiddie hackers. I keep seeing this in the params at my authentication endpoint. {"protect_against_forgery":"true","request_is_get":"true","fat":"\"1MxsA/WIN5RLLqS6jNUkmbNjTlQDineCVaOqHhRBL4U=\"","param_token":"nil","header_token":"nil","verified_request":"true"}
[16:16:06] mustmodify: I'm guessing there's a hack out there for some random site. But you'd think after failing the first N times they'd stop trying.
[16:18:13] dblessing: has joined #RubyOnRails
[16:19:35] AzaToth: has joined #RubyOnRails
[16:23:51] spheric: has joined #RubyOnRails
[16:26:05] gusrub: has joined #RubyOnRails
[16:29:25] gusrub: has joined #RubyOnRails
[16:39:13] cek: has joined #RubyOnRails
[16:39:30] cek: How do I add a local gem path that i'm developing into rails autoload?
[16:42:05] clouder|grr: has joined #RubyOnRails
[16:43:42] mustmodify: Kind of off topic. But if I wanted to keep a log of critical events, what's an appropriate way to do that?
[16:43:56] mustmodify: date, duration, affected machines, resolution
[16:44:24] mustmodify: just to look for patterns. I had a non-production server go down for 10 minutes. Nothing interesting in the logs... just ... stopped responding.
[16:44:25] baweaver: Typically issue trackers like Jira tied into something like Grafana for metric tracking
[16:44:27] cek: reload! won't make it reload
[16:44:42] mustmodify: cek: reload! isn't infallible.
[16:45:11] baweaver: when files of those paths change, re-bundle
[16:45:18] cek: config.autoload_paths is frozen
[16:45:30] cek: I'm developing the gem
[16:45:37] mustmodify: baweaver: Oh, hunh. I hadn't thought about creating tickets postmortem for critical issues. That makes sense.
[16:45:40] mustmodify: cek: we got that.
[16:46:03] mustmodify: you want your gem to affect Rails' autoload paths?
[16:46:04] baweaver: mustmodify: as far as it going down, that's why you have something like Sensu to monitor host uptime
[16:46:16] mustmodify: I have a monitor.
[16:46:21] mustmodify: I just don't know WHY it went down. :)
[16:46:33] baweaver: System logs are good as well
[16:46:34] mustmodify: doesn't seem to be leaking memory. Wasn't even in use at the time.
[16:51:42] cam27: has joined #RubyOnRails
[16:56:37] xall: has joined #RubyOnRails
[16:57:05] ascarter: has joined #RubyOnRails
[16:58:09] advorak: has joined #RubyOnRails
[17:00:49] quazimodo: has joined #RubyOnRails
[17:04:02] pupsicle: has joined #RubyOnRails
[17:13:45] duderonomy: has joined #RubyOnRails
[17:18:13] defsdoor: has joined #RubyOnRails
[17:26:54] quazimodo: has joined #RubyOnRails
[17:29:02] ascarter: has joined #RubyOnRails
[17:40:31] aajjbb: has joined #RubyOnRails
[17:46:50] cek: well, added gem path to autoload_paths , but it still won't reload
[17:47:35] mustmodify: cek: why does your gem alter Rails' autoload paths?
[17:48:04] cek: it doesn't.
[17:48:33] sandstrom: has joined #RubyOnRails
[17:49:22] cek: config.autoload_paths in config/application.rb , as per guide. const hash remains the same, model hash changing. So it's definitely either not picking it up or i don't know what else.
[17:50:00] cek: ActiveSupport::Dependencies.autoload_paths lists the path i added.
[17:50:18] arup_r: has joined #RubyOnRails
[17:50:34] mustmodify: Why do you want to alter the autoload path?
[17:53:37] mustmodify: has left #RubyOnRails: ()
[17:57:14] ascarter: has joined #RubyOnRails
[18:00:34] arup_r: has joined #RubyOnRails
[18:02:58] hobodave: has joined #RubyOnRails
[18:03:17] hahuang65: has joined #RubyOnRails
[18:05:04] dionysus69: has joined #RubyOnRails
[18:12:04] cek: it worked once I removed it from Gemfile.
[18:12:13] cek: has left #RubyOnRails: ()
[18:15:03] borodin: has joined #RubyOnRails
[18:20:34] xall: has joined #RubyOnRails
[18:21:40] sandstrom: has joined #RubyOnRails
[18:25:38] mrgreenfur: has joined #RubyOnRails
[18:26:29] quirkycoders: has joined #RubyOnRails
[18:26:47] quirkycoders: has joined #RubyOnRails
[18:27:11] tercenya: has joined #RubyOnRails
[18:30:45] ahrs: has joined #RubyOnRails
[18:32:58] arup_r: has joined #RubyOnRails
[18:37:37] raul782: has joined #RubyOnRails
[18:38:21] raul782: Hey guys, Is there a way I can force to use https, when I receive requests from an apache server
[18:38:37] raul782: and use http when I receive request from an nginx server?
[18:40:48] EXCHGR: has joined #RubyOnRails
[18:41:24] raul782: apache listens on port 443 and nginx on port 80
[18:42:04] raul782: Right now, when I receive a request from apache, it stays in https for all links, but once I do a redirect or I submit a form, it gets back to http
[18:42:14] raul782: which is weird, it should stay in https
[18:43:41] dminuoso: raul782, 3 things. a) config.force_ssl, b) redirect on your webbrowsers and most importantly: HSTS.
[18:44:27] dminuoso: Do _not_ skip that last part. I just finished reading a study that shows how little people pay any attention to the green icon next to the URL bar..
[18:44:38] raul782: But if I force config.force_ssl since the beginning, when a user access through http, will be redirected to https, and that's not what we want
[18:44:53] dminuoso: What do you want?
[18:45:16] raul782: right now, apache uses a different authentication system than nginx
[18:45:36] raul782: and when accessing from apache we want users to access through https
[18:45:39] dminuoso: If you have a portion of non-HTTPS you might as well drop the entire HTTPS because it just became useless.
[18:45:54] dminuoso: A MITM can just downgrade any https into http.
[18:45:56] raul782: well, it's not, at least not for this use case
[18:47:14] dminuoso: raul782, that does not explain why you cant use TLS on both.
[18:48:10] dminuoso: This sounds fishy enough as it is.
[18:49:29] raul782: we'll migrating the auth stage from regular ruby auth to an identity provider, during this process. we need to make sure if something goes wrong, people can still use the system with regular ruby, so they can fallback to http through nginx
[18:49:44] dminuoso: What does one have to do with the other?
[18:50:20] dminuoso: Certificates are free these days with LE. Apply it, force HTTPS application wide and focus on real problems.
[18:50:35] dminuoso: And then you can use SNI to separate these two.
[18:52:34] raul782: I don't follow how could I distinguish one from the other if both are using https. Because if a user enters through nginx port 80, It will be given a login form, otherwise it will go to an id provider.
[18:53:50] dminuoso: raul782, TLS permits a single piece of information send in the clear, which is the SNI. This can be used by the backend to do early decisions how to treat that TLS stream.
[18:54:03] dminuoso: (Well through an extension but every relevant implementation supports that)
[18:54:39] raul782: so that means that nginx needs an extension to send their own headers
[18:54:46] dminuoso: Its built in
[18:54:54] dminuoso: You just define multiple vhosts with tls and everything will work out
[18:55:16] borodin: what is the puppet method for installing rails on redhat-family servers?
[18:55:28] raul782: humm, there is an ELB in front which manage the certs
[18:55:39] borodin: #puppet doesn't know, hoped #rails might :)
[18:55:41] dminuoso: raul782, most ELBs should have SNI support
[18:55:49] mrbubbles: has joined #RubyOnRails
[18:56:00] dminuoso: no it doesnt
[18:56:12] dminuoso: raul782, you could still use SAN certs
[18:56:24] dminuoso: or terminate TLS at your backend
[18:56:46] chouhoulis: has joined #RubyOnRails
[18:57:05] dminuoso: Or use separate ELBs
[18:57:18] mrbubbles: Is there any way for me to get a url_helper path based on a model name? So, in a partial, I'd want to pass the model name (e.g. Dog, Cat) and then be able to render edit_dog_path, edit_cat_path etc. I know I can interpolate the string but it just felt a bit dirty
[18:57:38] mrbubbles: edit_path(@model) or something
[18:57:38] dminuoso: raul782, the reason Im pushing so hard for this is because by having TLS in the first place you must have admitted the need for secrecy and privacy of your data.
[18:57:42] srinidhi: has joined #RubyOnRails
[18:57:48] dminuoso: So having both seems silly
[18:58:11] dminuoso: mrbubbles, http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html
[18:59:21] raul782: yeah, that makes sense, but in this case we're applying this only on our staging env so our users keep working without problems, in production everything will go through https
[18:59:29] mrbubbles: Thanks dminuoso I saw that earlier, couldn't see anything that looked suitalbe though
[19:00:14] dminuoso: mrbubbles, http://api.rubyonrails.org/classes/ActionDispatch/Routing/UrlFor.html
[19:00:18] dminuoso: Sorry about the other.
[19:01:32] matthewd: Maybe http://api.rubyonrails.org/classes/ActionDispatch/Routing/PolymorphicRoutes.html
[19:02:16] dminuoso: There is a distinct possibility that matthewd knows more about Rails than me.
[19:03:34] matthewd: I'm actually not sure which will work better / more directly if you're working with the model *name*
[19:04:06] arup_r: has joined #RubyOnRails
[19:04:22] matthewd: But in general, I'd recommend not doing that, and using e.g. edit_polymorphic_path(@some_dog)
[19:04:47] matthewd: OTOH, url_for([:edit, @some_dog]) will give you the same thing, so ¯\_(ツ)_/¯
[19:05:31] mrbubbles: Boom that worked a treat, thanks dminuoso
[19:05:51] Technodrome: has joined #RubyOnRails
[19:06:06] mrbubbles: Oh and thanks matthewd, I did something similar - <%= link_to 'Show', action: 'show', id: member %>
[19:06:43] matthewd: Is member a model instance?
[19:07:32] matthewd: If so, `<%= link_to 'Show', member %>` should do the same thing
[19:07:50] dminuoso: It's been ages since I've written a view. :o
[19:08:22] dminuoso: It feels strange to look at this.. makes me feel.. old..
[19:08:45] mrbubbles: Yep I had to namespace it - link_to 'Show', [:admin, member] but aye that worked, thanks matthewd
[19:09:14] gambl0re: has joined #RubyOnRails
[19:14:09] hobodave_: has joined #RubyOnRails
[19:16:58] tercenya: has joined #RubyOnRails
[19:24:37] mustmodify: has joined #RubyOnRails
[19:24:59] mustmodify: What happens if you use a UTF-16 character on a webpage with a meta charset of utf-8?
[19:25:03] chouhoulis: has joined #RubyOnRails
[19:26:39] dminuoso: mustmodify, Im wondering whether it would just try and display the two respective UTF 8 codepoints?
[19:27:07] dminuoso: (Or up to 4 I guess depending on the code units)
[19:28:00] gusrub: has joined #RubyOnRails
[19:31:41] kristofferR: has joined #RubyOnRails
[19:38:15] mustmodify: well, should be an adventure! :)
[19:39:58] matthewd: mustmodify: The answer is pretty simple: "you can't". You can include the bytes corresponding to a UTF-16 character, but if the page is marked as being UTF-8 encoded, then so is that data.
[19:49:27] netzfisch: has joined #RubyOnRails
[19:54:54] hahuang65: has joined #RubyOnRails
[20:05:48] dionysus69: has joined #RubyOnRails
[20:11:04] workmad3: has joined #RubyOnRails
[20:18:00] AnotherOne: has joined #RubyOnRails
[20:18:22] quirkycoders: has joined #RubyOnRails
[20:26:07] shilon: has joined #RubyOnRails
[20:26:27] ResidentBiscuit: has joined #RubyOnRails
[20:27:47] netzfisch: has joined #RubyOnRails
[20:34:59] guacamole: has joined #RubyOnRails
[20:35:45] ascarter: has joined #RubyOnRails
[20:40:08] brent__: has joined #RubyOnRails
[20:40:24] mustmodify: sure. We've always used UTF-8 but now need I18n for Mandarin. I guess we're switching encodings!
[20:40:27] mustmodify: has left #RubyOnRails: ()
[20:42:14] armyriad: has joined #RubyOnRails
[20:42:41] apeiros: if they hadn't just left we could have told them that utf-16 can be converted to utf-8
[20:47:13] Shilon_: has joined #RubyOnRails
[20:53:35] blackmesa: has joined #RubyOnRails
[20:55:42] lxsameer: has joined #RubyOnRails
[20:59:09] ascarter: has joined #RubyOnRails
[21:07:23] cnk: has joined #RubyOnRails
[21:07:35] quirkycoders: has joined #RubyOnRails
[21:07:54] quirkycoders: has joined #RubyOnRails
[21:09:16] ur5us: has joined #RubyOnRails
[21:10:38] arBmind: has joined #RubyOnRails
[21:20:12] Technodrome: has joined #RubyOnRails
[21:23:42] workmad3: has joined #RubyOnRails
[21:30:16] ascarter: has joined #RubyOnRails
[21:47:49] ascarter: has joined #RubyOnRails
[21:53:45] dnyy: so my app lets users store when they're available on what days. so they can select any (or all) hours from 9-5 on any week day. what is the best way to store that data? kinda at a loss of how to store it without overcomplicating everything with a ton of has_manys going on
[21:56:15] bpmedley: has joined #RubyOnRails
[21:59:47] waseem_: has joined #RubyOnRails
[22:03:51] hndk: has joined #RubyOnRails
[22:04:26] tercenya: has joined #RubyOnRails
[22:07:34] ascarter: has joined #RubyOnRails
[22:07:57] shilon: has joined #RubyOnRails
[22:09:08] ascarter: has joined #RubyOnRails
[22:21:41] Technodrome: has joined #RubyOnRails
[22:27:22] ascarter: has joined #RubyOnRails
[22:29:41] Radar: GOOD MORNING
[22:31:13] hndk: has joined #RubyOnRails
[22:38:10] bruno-_: has joined #RubyOnRails
[22:43:20] Papierkorb: and good night
[22:43:33] Radar: good night Papierkorb
[22:47:53] duderono_: has joined #RubyOnRails
[23:02:45] mikecmpbll: has joined #RubyOnRails
[23:05:10] mrgreenfur: Anyone here a genius at redids/sidekiq? Something happened in the last few days and now I can’t look at the sidekiq UI and there are tons of errors like: Error fetching job: Error connecting to Redis on x.x.x.x:6380 (Errno::ECONNREFUSED)
[23:05:18] mikecmpbll: i'm a genius at everything
[23:05:22] mrgreenfur: I can connect just fine in a rails console and in the redis-cli
[23:05:31] mrgreenfur: @mikecmpbll :D
[23:05:40] mikecmpbll: that means that it can't connect to redis
[23:05:55] mikecmpbll: no but seriously. that's what it means
[23:06:18] mrgreenfur: yeah, but i can’t figure how where to look. I can connect from host to redis via redis-cli AND via a shell using the Redis.new....
[23:06:34] mrgreenfur: something slippery is afoot
[23:06:43] mikecmpbll: you'll have a sidekiq initializer in your rails proj.?
[23:07:07] mrgreenfur: it sets the redis url and namespace
[23:07:28] mikecmpbll: right. is the connection stuff correct?
[23:07:40] mikecmpbll: has it been changed without restarting your app?
[23:07:49] mrgreenfur: i can copy/paste it into console to test it and it works fine
[23:08:06] mikecmpbll: can you enqueue jobs from sidekiq in the console?
[23:08:35] mrgreenfur: let me try. As far as I can see jobs ar estill enqueuing and de-queueing just fine, just the web UI barfs
[23:10:11] mrgreenfur: yup enqueing works fine
[23:10:41] mikecmpbll: what's the error from the web ui?
[23:11:22] mrgreenfur: it’s showing my apps 500 page
[23:12:01] mikecmpbll: is your client config the same as your server config? and is redis, the app, and the worker(s) running on the same machine?
[23:12:20] mikecmpbll: you'll have configure_client and configure_server in your sidekiq initializer
[23:13:03] mrgreenfur: Got those lines in the initializer
[23:13:09] mikecmpbll: both configs the same?
[23:13:49] mrgreenfur: Sidekiq.configure_server do |config|
[23:13:50] mrgreenfur: config.redis = redis_options
[23:13:52] mrgreenfur: Sidekiq.configure_client do |config|
[23:13:53] mrgreenfur: config.redis = redis_options
[23:14:42] mikecmpbll: what's redis_options? (not exactly, but is it loading stuff from secrets or anything like that?)
[23:14:56] mrgreenfur: just setting the url and the namespace
[23:15:23] mikecmpbll: k, idk then. you loaded the console in production env?
[23:15:36] mikecmpbll: odd. restarted the app?
[23:15:42] mrgreenfur: yeah, tried redeploying a few times
[23:15:52] mrgreenfur: will try restarting redis next i guess
[23:16:22] mikecmpbll: if the web UI error is the "Error connecting to Redis on x.x.x.x:6380" then i've no idea
[23:16:48] mrgreenfur: i dont relaly know either. I can see the 500 in the web page and then there are workers failling to connect
[23:16:58] mrgreenfur: there’s no max-connections limit on the redis instance
[23:19:25] mrgreenfur: oh well, i’ll keep banging on it, thanks mikecmpbll
[23:19:44] mikecmpbll: 👍🏼 not such a genius afterall.
[23:21:14] mrgreenfur: nah, u mensa man
[23:24:42] dnyy: so my app lets users store when they're available on what days. so they can select any (or all) hours from 9-5 on any week day. what is the best way to store that data? kinda at a loss of how to store it without overcomplicating everything with a ton of has_manys going on
[23:24:50] dnyy: (copy/pasted from earlier when nobody was here lol)
[23:25:40] xall: has joined #RubyOnRails
[23:30:24] mikecmpbll: dnyy : hm. maybe start and end dates of availability? depends how it's used really
[23:30:29] mikecmpbll: are they recurring?
[23:31:03] fryguy: has joined #RubyOnRails
[23:31:14] dnyy: recurring yea. so the date itself doesn't matter, just the times and the day of the week they fall on
[23:32:24] dnyy: it's used for scheduling. so if i want john doe to do something, i can see when he's available on a calendar (that uses this + few other things)
[23:33:26] mrgreenfur: could copy the cron syntax
[23:33:28] dnyy: serialized hash seems like quickest way i guess
[23:41:49] mostlybadfly: has joined #RubyOnRails
[23:45:47] amperry: has joined #RubyOnRails
[23:51:29] amperry: Hi folks. I've got an odd situation where I'm trying to save an object, 'apt', with an attribute, 'non_revenue_status_id', set to 8, but it gets ROLL'ed BACK. It saves with any other number (that matches a NonRevenueStatus.id), or nil, but not 8. I tried saving it in the console with apt.save! and got "ActiveRecord::RecordNotSaved: Failed to save the record", but no explanation why. apt.errors.count is 0. So it's not saving, but not
[23:51:30] amperry: telling me anything more than that.
[23:54:32] amperry: Nor does the dev log say anything more informative than that. Any other ideas as to how I could troubleshoot this?
[23:56:15] Technodrome: has joined #RubyOnRails
[23:59:52] aajjbb: has joined #RubyOnRails