Page 1 of 3 | Next »
[15:29:28] ravster: I'm using actionmailer backed by sidekiq. When I run 'deliver_now', I get an exception, but when I run 'deliver_later', no exception is thrown and nothing shows up in the logs. How do I get exceptions in actionmailer to bubble up?
[15:36:34] ravster: I have fixed the error, and I'm able to send emails successfully now, but I'd like to set this up so that if something goes wrong in the future, I'll get errors showing in the logs and in Sentry (so its easier to debug).
[19:54:03] ravster: I have exceptions that are thrown when using ActionMailer's 'deliver_now' method, but not when I 'deliver_later'. Nothing shows up in the logs, and nothing shows up in Sentry. How do I get errors during the mailer processing showing up in the logs and Sentry?
[14:16:52] ravster: For something like that I'd just see how far away the cursor is from the bottom of the page (+/- any margins) , and compare that to the height of the section that I want to build.
[14:25:52] ravster: fidalgo: I used to extract the creation of the contents into a function that returns the bounding-box, and then compare heights. Then I'd make the decision whether to start a new page or not, and then call that function again.
[20:56:44] ravster: FrostCandy: If I needed something like that in different models, I'd just place that in lib/ and require it wherever I needed it.
[17:12:48] ravster: I would like to ensure that all I18n.t() calls for my project are referring to keys that exist in the en.yml file. Is there a tool out there that already checks this?
[18:13:58] ravster: I'm trying to use assert_enqueued_with inside an integration-test, but I get --->> undefined method `assert_enqueued_with'
[18:14:19] ravster: I'm not sure what I should include in my test to have assert_enqueued_with recognized.
[00:20:18] ravster: I'm looking for an alternative to devise for user-authentication. I would like something that works with the rails-views as well as an api. Does anyone have suggestions for me to check out?
[18:45:42] ravster: bryanculver: I'm not sure what you want to achieve. Can you walk us through an example?
[18:47:52] ravster: So you want two different lists of users? Or if the user is looking at a list of users, they will see a marker if another user has at least one club in common?
[18:53:14] ravster: I'm thinking something like 2 queries. The first query would search the users, sorted by the number of clubs they belong to (ascending order), and pick the first user. So you have the least number of club_ids to check.
[18:55:36] ravster: The second query would look at all users in the Chat where they have a club_id for each club_id in the list, and see if any of the queries has a count equal to the number of users in the Chat.
[18:56:56] ravster: I'm pretty sure that all that can be brought down into a single SQL query, though.
[18:59:33] ravster: I think it really boils down to what you think the smallest club-membership-count would be for each Chat
[19:00:15] ravster: The SQL uber-query would be very cool, but I doubt that people need to figure things out that quickly
[17:13:55] ravster: I added devise-token-auth to an existing codebase since I need to add api authentication, and since then I've been unable to get passing tests since the 'sign_in' helper with the fixture-user isn't working. In the controller code, 'current_user' now resolves to 'nil'.
[17:14:51] ravster: when I added devise-token-auth, I had a add a bunch of columns for things like email-confirmation too. Could one of those be a failure point?
[22:50:32] ravster: I'm using rails 5 and devise, and all my tests were passing. Then I added devise-token-auth, and my tests started failing since the controller couldn't figure out the 'current_user' anymore. Is anyone able to help with this? I'm using minitest and fixtures in my tests.
[15:35:34] ravster: morfin: Do you use jsonapi with activemodelserializer or with something else? I tried it for a little bit on a new project but found it too clunky so I went back to Oat::HAL.
[15:36:37] ravster: dminuoso: Maybe I'm just too used to oat-hal; I used it for >2 years on a previous project.
[15:42:42] ravster: https://github.com/rails-api/active_model_serializers recommends using its built-in JSONAPI output mode
[16:09:45] ravster: also, that method requires that your DB tables don't use foreign-key verification.
[16:12:51] ravster: catphish: Never used mariadb, but it probably supports foreign-keys. I highly recommend them, even if rails handles the associations. I find comfort in having relationships enforced at the DB-level instead of only at the application level. ymmv
[16:14:04] ravster: catphish: thats fine. I didn't know about foreign-keys for a long time either. Then the inconsistencies bit me in the ass.
[01:13:52] ravster: michael_mbp: I think elasticsearch does something like this. It might help to look at some of the ruby-elasticsearch interface gems to see if the code gives a hint to how they do it.
[18:13:52] ravster: formal = Course.create(name: 'Formal Specification', deadline: d1, lecturer: l1)
[18:14:28] ravster: Just add lecturer at the end. You've already made the 'belongs_to' association, so rails should handle it.
[18:15:07] ravster: I would suggest doing all your seeds with 'find_or_create!' instead of 'create', just so you don't spam your db with duplicate entries all over the place.
[18:16:33] ravster: Look up 't.references' or 't.belongs_to' in the migration guides, or at api.rubyonrails.org
[18:21:23] ravster: Knockys: Doing it as an integer works. My preference is to use t.references or t.belongs_to though, simply because they are more specialized so they declare the intent better. YMMV
[19:42:17] ravster: mordof: there is a to_h method http://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-to_h
[19:50:51] ravster: It seems like a code-smell if your tests don't work with the Rails Parameter class. I've never come across this problem before
[19:53:14] ravster: I've used the direct access a few times, and if its a test then I wouldn't be too worried about it. params[:foo][:bar] or params.dig(:foo, :bar) should be fine.
[19:43:50] ravster: mwlang: I've never used capistrano. I'd suggest Ansible as an alternative to cap or docker. I've used that for a few years and haven't had problems with setup and orchestration.
[14:27:40] ravster: mikecmpbll: I've used it for months on end, but keep coming back to my native editor. I liked it.
[14:28:32] ravster: One of the things I really liked about RubyMine was the debugging tools; I'd never used an actual editor before and it kind of blew my mind.
[14:29:30] ravster: I kept switching between phases of "I really like the features" and "It offends me that it takes up a gigabyte of RAM to run this".
[14:31:03] ravster: epochwolf: absolutely, my current workflow is to use guard with tests and sprinkle 'byebug's all over the place.
[14:35:13] ravster: mikecmpbll: since JetBrains switched to a subscription model, I'd recommend trying the 1-month free trial just to check it out to see if it makes a significant difference to your productivity.
[17:46:04] ravster: Nik736: the bullet gem can help you prevent n+1 queries. Since its 3 different models, you should be able to bring it down to 3 queries.
[18:24:26] ravster: I'm trying to get fixtures working with a fresh rails 5 project, but the 'fixtures :all' in the test_helper.rb doesn't seem to be working. I don't see any fixtures in the test db.
[18:40:27] ravster: dsimon: there you go. I'm guessing that you might be doing this in the REPL, and that is why it instantiates all the Comment objects.
[18:41:02] ravster: When you do this in your actual code, it wouldn't run the DB-query till it needs to.
[18:42:54] ravster: Yeah, thats the best I can think of. I'm sure there is a gem out there that does what you want with that kind of construct, but I don't know it.
[19:51:48] ravster: When using minitest/unit, how do I do things like 'context', which is something we can do with rspec?
[19:56:20] ravster: Am I correct in guessing there isn't a native way to do that with minitest/unit? Someone would just have to have a different test class at that point?
[17:16:15] ravster: I'm using activemodelserializers with the JSONAPI adapter, and I want to serialize a join-table model and have it list out the foreign keys of the records its pointing to. I have 'attributes :id, :user_id, foo_id', but only ':id' gets into the response body.
[17:17:10] ravster: Do I have to do something special for other '_id' fields to show up as attributes when using the JSONAPI adapter? My user_serializer.rb serializes fields like 'email' and 'role' just fine.
[18:24:45] ravster: can you type in 'rbenv local 2.3.3' and then start another shell and go to the same directory and try again?
[18:58:42] ravster: Well, its getting in your way now. I'd look through ~/.bashrc and ~/.bash_profile to see where the '.rvm' is being added to your PATH, and remove that. I'd also try to get rid of that entire '.rvm' directory. My first suggestion was to just nuke your installation and do a clean install of your system, but I don't know how that works on macs.
[00:05:59] ravster: hamster88: that error message suggests something wrong with a has_many or belongs_to line in your code.
[00:08:18] ravster: I also noticed that you are running it through spring. Could you do a 'spring stop' and then run 'rails s' just to make sure that you don't have anything strange hanging around the persistent VM?
[00:11:04] ravster: The stacktrace is also looks like its running through the bootsy gem. Can you look around your code that references bootsy or ImageGallery?
[00:13:24] ravster: hamster88: What happens when you disable the bootsy engine from routes.rb. Does the error still pop up?
[22:02:18] ravster: Is there an common way to organize a rails controller-action to render data differently based on the role of the user? My first thought was to do a conditional on user-role and delegate to private methods, but I was wondering if there is another way to do this with a better pattern.