ravster

Activity Graph

Page 1 of 3 | Next »

2017-12-07

[00:30:11] ravster: Remote host closed the connection

2017-12-06

[15:27:42] ravster: has joined #RubyOnRails
[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:29:45] ravster: I tried setting raise-delivery-errors, but it doesn't seem to work.
[15:35:51] ravster: No, because the error was still thrown
[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).
[16:31:27] ravster: Read error: Connection reset by peer
[16:31:40] ravster: has joined #RubyOnRails
[18:51:42] ravster: Ping timeout: 240 seconds
[19:38:36] ravster: has joined #RubyOnRails
[21:22:57] ravster: Ping timeout: 240 seconds
[23:26:47] ravster: has joined #RubyOnRails

2017-12-05

[19:52:58] ravster: has joined #RubyOnRails
[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?
[21:02:57] ravster: Ping timeout: 248 seconds

2017-09-27

[13:11:28] ravster: has joined #RubyOnRails
[22:50:44] ravster: Ping timeout: 246 seconds

2017-09-26

[13:01:19] ravster: has joined #RubyOnRails
[16:19:13] ravster: Quit: Leaving.
[16:41:02] ravster: has joined #RubyOnRails
[16:42:50] ravster: Read error: Connection reset by peer
[17:14:38] ravster: has joined #RubyOnRails
[21:08:44] ravster: orbyt_: Why not just call it directly, like "I18n.t()" ?
[21:32:05] ravster: Ping timeout: 240 seconds

2017-09-25

[13:52:52] ravster: has joined #RubyOnRails
[14:12:49] ravster: fidalgo: I've used prawn in the past.
[14:13:18] ravster: I didn't find it to be worse than CSS, tbh
[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.
[14:34:23] ravster: fidalgo: Let me see if I can find how I did it before.
[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.
[22:14:49] ravster: Quit: Leaving.

2017-09-22

[17:11:33] ravster: has joined #RubyOnRails
[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?
[20:26:47] ravster: thanks mlt-
[22:47:46] ravster: Ping timeout: 264 seconds

2017-08-16

[14:06:24] ravster: has joined #RubyOnRails
[21:21:05] ravster: Ping timeout: 240 seconds

2017-06-20

[00:17:25] ravster: *.net *.split

2017-06-19

[18:10:23] ravster: has joined #RubyOnRails
[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.

2017-05-26

[18:18:55] ravster: has joined #RubyOnRails
[22:59:27] ravster: Ping timeout: 240 seconds

2017-05-07

[00:25:12] ravster: has joined #RubyOnRails
[02:53:40] ravster: Ping timeout: 240 seconds
[11:59:25] ravster: has joined #RubyOnRails
[12:11:57] ravster: Ping timeout: 240 seconds
[14:47:12] ravster: has joined #RubyOnRails
[15:27:51] ravster: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")

2017-05-06

[03:36:10] ravster: Ping timeout: 240 seconds
[13:37:18] ravster: has joined #RubyOnRails
[19:37:52] ravster: Ping timeout: 260 seconds

2017-05-05

[00:55:25] ravster: Ping timeout: 240 seconds
[10:01:02] ravster: has joined #RubyOnRails
[10:31:37] ravster: Ping timeout: 260 seconds
[18:59:34] ravster: has joined #RubyOnRails

2017-05-04

[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?
[00:55:30] ravster: Remote host closed the connection
[14:01:40] ravster: has joined #RubyOnRails
[14:24:42] ravster: vedu: you mean like a nil?
[14:43:16] ravster: vedu: How about just making the field a 'nil' by default?
[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:49:36] ravster: So its a query about whether the Chat is in a 'green' or 'red' state?
[18:49:50] ravster: So you really want a boolean response
[18:51:41] ravster: But if the clubs were [1, 2, 3], [2, 4, 6], and [3,5,2], then it should pass?
[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:53:43] ravster: I can't recall anything in AR that does this already.
[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:55:52] ravster: bryanculver: exactly, n+1
[18:56:08] ravster: Which is why you look for the user with the least number of club memberships
[18:56:56] ravster: I'm pretty sure that all that can be brought down into a single SQL query, though.
[18:57:07] ravster: Depending on how strong your sql-fu is.
[18:58:25] ravster: And how much of a value-add it is to the business to really optimize it.
[18:59:33] ravster: I think it really boils down to what you think the smallest club-membership-count would be for each Chat
[18:59:42] ravster: oh, pfft, nvm.
[19:00:15] ravster: The SQL uber-query would be very cool, but I doubt that people need to figure things out that quickly
[19:00:50] ravster: Still, it would be a really cool read if you put it up on a blog somewhere.
[19:02:56] ravster: well, nice given that I'm not doing it

2017-05-03

[17:12:36] ravster: has joined #RubyOnRails
[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?
[17:25:05] ravster: username1: I usually start placing print statements to figure that out.
[18:20:01] ravster: Remote host closed the connection
[22:48:47] ravster: has joined #RubyOnRails
[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.

2017-05-02

[14:20:04] ravster: has joined #RubyOnRails
[21:28:56] ravster: Ping timeout: 240 seconds

2017-04-27

[10:00:48] ravster: has joined #RubyOnRails
[10:08:33] ravster: Ping timeout: 245 seconds
[14:31:08] ravster: has joined #RubyOnRails
[18:57:54] ravster: Ping timeout: 246 seconds

2017-04-26

[19:08:29] ravster: has joined #RubyOnRails
[20:02:04] ravster: Ping timeout: 240 seconds

2017-04-25

[15:24:14] ravster: has joined #RubyOnRails
[22:00:20] ravster: Ping timeout: 264 seconds

2017-04-24

[04:15:21] ravster: Ping timeout: 255 seconds
[15:32:39] ravster: has joined #RubyOnRails
[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:38:30] ravster: I might give it another shot one day, maybe with a different serializer gem.
[15:38:37] ravster: if I don't go full graphql
[15:38:53] ravster: morfin: was that directed at me?
[15:42:42] ravster: https://github.com/rails-api/active_model_serializers recommends using its built-in JSONAPI output mode
[15:43:39] ravster: morfin: oh ok
[15:44:08] ravster: morfin: sweet, I'll check it out.
[15:46:34] ravster: interesting, so its like a parallel set of controllers?
[15:47:14] ravster: I'll check it out, thanks for the link
[16:09:20] ravster: catphish: sounds like you are reinventing garbage collection
[16:09:45] ravster: also, that method requires that your DB tables don't use foreign-key verification.
[16:11:21] ravster: catphish: which DB?
[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.
[22:50:09] ravster: Ping timeout: 258 seconds

2017-04-23

[14:16:23] ravster: has joined #RubyOnRails

2017-04-22

[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.
[02:54:56] ravster: Ping timeout: 240 seconds

2017-04-21

[18:06:57] ravster: Knockys: Can you put up a gist or something to show what you have right now?
[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:15:46] ravster: Knockys: Do you have lecturer_id as a column in your 'courses' table?
[18:16:33] ravster: Look up 't.references' or 't.belongs_to' in the migration guides, or at api.rubyonrails.org
[18:16:46] ravster: (without the 't.')
[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:49:50] ravster: what happens with params.require(:tag) ?
[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:51:45] ravster: and the test is a controller/integration test?
[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.

2017-04-20

[12:08:17] ravster: has joined #RubyOnRails
[14:24:02] ravster: agent_white: good morning

2017-04-19

[15:59:32] ravster: has joined #RubyOnRails
[16:11:20] ravster: Remote host closed the connection
[16:27:31] ravster: has joined #RubyOnRails
[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.
[20:52:43] ravster: Ping timeout: 245 seconds

2017-04-18

[00:33:24] ravster: Quit: ERC (IRC client for Emacs 24.5.1)
[11:29:13] ravster: has joined #RubyOnRails
[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:31:33] ravster: agent_white: hello
[14:32:29] ravster: LyndsySimon: I think rails 5 is able to do 'OR' conditions now.
[14:33:02] ravster: universa1: nice
[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.
[21:51:05] ravster: Ping timeout: 240 seconds

2017-04-17

[18:22:56] ravster: has joined #RubyOnRails
[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:27:15] ravster: oh, nvm, didn't think about the default scope
[18:35:05] ravster: dsimon: the rails guides didn't help? What are you trying to do?
[18:36:57] ravster: dsimon: What is 'User.where(..).comments.class' ?
[18:39:08] ravster: Comment.joins(:user).where(users: {admin: true})
[18:39:18] ravster: What is 'User.where(..).comments.class' ?
[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:50:38] ravster: tasaif: use 'exit' ?
[19:51:48] ravster: When using minitest/unit, how do I do things like 'context', which is something we can do with rspec?
[19:54:25] ravster: havenwood: is that only with minitest/spec?
[19:55:19] ravster: havenwood: huh, ok. I'll fiddle around with that. Thank you.
[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?

2017-03-29

[02:06:58] ravster: Ping timeout: 264 seconds

2017-03-28

[01:08:53] ravster: Ping timeout: 246 seconds
[10:01:05] ravster: has joined #RubyOnRails

2017-03-27

[17:14:04] ravster: has joined #RubyOnRails
[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:21:32] ravster: mstashev: don't ask to ask. Just ask
[18:22:50] ravster: when you do 'rbenv versions', which listing has the '*' before it?
[18:23:26] ravster: and you are running both commands from the same directory?
[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:26:20] ravster: 'which ruby'
[18:54:07] ravster: mstashev: dude, why does that path include rvm? Do you have rvm installed?
[18:54:25] ravster: You'll need to pick one of either rvm or rbenv. Not both.
[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.

2017-03-10

[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?
[00:17:41] ravster: And its the same error message?
[00:22:28] ravster: And spring stop still says that no spring is running, right?
[00:23:11] ravster: weird. I'm out of ideas. Sorry dude
[01:14:17] ravster: Quit: ERC (IRC client for Emacs 24.5.1)

2017-03-09

[21:55:02] ravster: has joined #RubyOnRails
[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.
[22:02:30] ravster: Its a JSON endpoint
[22:10:21] ravster: dminuoso: Ok, I'll try and set the filters in the view layer. Thanks.

2016-06-14

[01:16:00] ravster: has joined #RubyOnRails
[01:20:41] ravster: Ping timeout: 240 seconds
[03:16:56] ravster: has joined #RubyOnRails
[03:21:41] ravster: Ping timeout: 240 seconds
[05:17:49] ravster: has joined #RubyOnRails
[05:22:01] ravster: Ping timeout: 240 seconds
[07:18:33] ravster: has joined #RubyOnRails
[07:23:21] ravster: Ping timeout: 240 seconds
[09:19:32] ravster: has joined #RubyOnRails
[09:23:41] ravster: Ping timeout: 240 seconds
[11:20:17] ravster: has joined #RubyOnRails
[11:25:01] ravster: Ping timeout: 240 seconds
[13:12:04] ravster: has joined #RubyOnRails
[14:14:53] ravster: Disconnected by services

2016-06-13

[13:31:01] ravster: Ping timeout: 240 seconds
[13:44:21] ravster: has joined #RubyOnRails
[17:06:01] ravster: Ping timeout: 240 seconds
[17:24:07] ravster: has joined #RubyOnRails
[21:18:41] ravster: Ping timeout: 240 seconds
[23:15:11] ravster: has joined #RubyOnRails
[23:19:41] ravster: Ping timeout: 240 seconds