Inside

Activity Graph

Page 1 of 12 | Next »

2018-11-14

[00:02:18] Inside: You can't tell what exceptions statically typed languages will throw either, can you?
[00:02:53] Inside: You would need to pre-execute all code branches to every stack depth to determine if there is a throw routine somewhere
[00:03:46] Inside: Unless you were... using some esoteric language that has no side effects?
[15:30:15] Inside: has left #RubyOnRails: ()

2018-11-13

[01:16:05] Inside: Disconnected by services
[20:01:33] Inside: has joined #ruby
[20:01:36] Inside: has joined #RubyOnRails
[20:01:51] Inside: Why is IRC so quiet? OH I AM NOT CONNECTED.

2018-11-12

[15:21:28] Inside: has joined #ruby
[15:21:35] Inside: ruby has absolutely spoiled me
[15:21:45] Inside: doing some occasional javascript is fraught with so many pitfalls
[22:18:49] Inside: ACTION squints

2018-11-10

[19:16:51] Inside: Disconnected by services

2018-11-09

[20:56:36] Inside: anyone here use acts_as_list?
[20:56:45] Inside: any way to get a list of items that changed when an item was moved?
[22:45:53] Inside: I don't think so
[22:45:56] Inside: I suffer from the same problem
[22:46:29] Inside: The solution that I have been kicking around is a database connection cache/proxy application
[22:46:47] Inside: everything talks to that application, then that application is responsible for caching intermediate stuff before pushing it to the DB
[23:02:36] Inside: interesting
[23:02:44] Inside: what server do you use? I have nginx+passenger
[23:03:09] Inside: 2~3 processes per application
[23:03:18] Inside: but yeah, a database connection pool per every process

2018-11-08

[04:43:06] Inside: Disconnected by services
[15:21:47] Inside: has joined #ruby
[15:21:50] Inside: has joined #RubyOnRails
[16:50:02] Inside: What does your component look like?
[16:50:52] Inside: oh this is reactor?
[22:10:03] Inside: &>> 10.times { puts "Around The World" }
[22:10:25] Inside: Daft punk should hire me

2018-11-07

[00:19:48] Inside: that seems like an insane amount of work :D
[00:20:32] Inside: renlo: what's the code in 'some_module'?
[00:22:07] Inside: that's really not enough to go on
[00:28:14] Inside: shoot I'll just take regular dollars
[00:30:04] Inside: biberao: I uhh don't have anything useful to tell you :(
[00:30:32] Inside: Radar, on the other hand, is a fantastic ruby author so he may have a good suggestion
[00:36:45] Inside: I'm almost to the testing chapter in POODR
[00:36:51] Inside: let's see just how bad I am at writing tests
[00:45:08] Inside: yeah absolutely
[00:45:13] Inside: but even the whole testing methodology
[00:45:32] Inside: I do mostly rails and there are so many places to plug tests in
[00:45:40] Inside: ie: models, controllers, etc
[00:46:34] Inside: Here's a test I'm writing right now - how do you check that your strong parameters are correct?
[00:46:48] Inside: baweaver: Rails just calls everything an integration test now
[00:47:56] Inside: https://guides.rubyonrails.org/testing.html#a-brief-note-about-test-cases
[00:48:04] Inside: renlo: it's a framework specific feature, has nothing to do with ruby
[00:48:21] Inside: Those are all ruby on rails terms
[00:49:08] Inside: renlo: translation is basically "In rails, you have to specify which parameters a controller is allowed to update in a model using a white list"
[01:05:49] Inside: Bleh. 50 lines of code to test 15 lines of controller code to raise code coverage 0.1%
[01:15:49] Inside: https://gist.github.com/Insood/a24b12eea9999a47e8cc7692734c8636
[01:15:51] Inside: nothing fancy in here
[01:29:13] Inside: I was wondering about that too
[01:29:29] Inside: The check is actually a call to the active directory
[01:29:44] Inside: Which I think might be a terrible idea
[01:31:55] Inside: https://gist.github.com/Insood/0e7503b2d4726267518b79f1718980ac
[01:32:09] Inside: It's a bit terrifying as to house of cards that this system is built on
[04:35:53] Inside: Disconnected by services
[17:13:28] Inside: has joined #ruby
[17:13:32] Inside: has joined #RubyOnRails
[20:31:09] Inside: you might want to paste code
[21:25:59] Inside: I misread your question
[21:26:01] Inside: what Radar said
[22:15:18] Inside: Model.all ?
[22:47:00] Inside: How much can you hide in codepoints?
[22:47:13] Inside: People are copy pasting the code to execute it
[22:47:44] Inside: Could you do a sql-injection-type attack?
[22:53:59] Inside: ACTION squints.
[22:55:59] Inside: "aGVsbG8gdG8geW91IHRvbw=="unpack1 'm0' :P
[23:04:35] Inside: Model.columns_hash
[23:05:02] Inside: depends on what data you need? just the name of the columns?
[23:05:10] Inside: Model.columns_hash.keys for that
[23:06:11] Inside: I don't understand your question then
[23:09:28] Inside: that's beyond me - sorry

2018-11-06

[16:21:27] Inside: not really following
[16:23:11] Inside: def create respond_to do |format| format.json {... } end
[16:24:12] Inside: your action needs a call to render
[16:24:23] Inside: or do a redirect of some sort
[16:25:53] Inside: What do you want LikesController#create to do?
[16:27:26] Inside: I'm guessing you have a button (or something) in your form which uses javascript to make a POST to LikesController#create
[16:27:55] Inside: Rails interally uses AJAX to make the call
[16:32:33] Inside: Er.. anyway, your webserver assumes that whenever you access a resource, you have an imaginary .html at the end
[16:32:57] Inside: ie: likes/234634 is internally thought of as requesting a view for likes/234624.html
[16:33:30] Inside: rails by default assumes that you want to render a .html document so it looks in app/views/likes/show.html (or whatever your action is)
[16:34:02] Inside: when you do a remote POST, it still is asking for an html response
[16:34:30] Inside: However, you don't HAVE to provide a specific type of response
[16:34:49] Inside: you could do render( json: {}, status: :created )
[16:35:27] Inside: So - I don't know why your create action has a format.html
[16:36:31] Inside: do you have a create.js.erb file?
[16:36:35] Inside: because it's trying to render that essentially
[16:38:18] Inside: shouldn't it be in [...]/likes/create.js.erb?
[16:40:27] Inside: Can you physically visit likes/create.js in your browser?
[16:46:56] Inside: how does your routes.rb look?
[16:51:09] Inside: rake routes | grep likes
[17:04:02] Inside: I'm confused too
[17:04:33] Inside: it should render whatever is in forum_threads/forum_posts/likes.js
[17:04:42] Inside: reboot/reinstall/reformat ;D
[17:14:21] Inside: I'm still running 2.4 and rails 4.2 here
[22:49:51] Inside: can you program?
[22:50:00] Inside: ie: do you have previous experience in any other language?
[22:52:03] Inside: I'm feeling dejavu
[22:52:19] Inside: Code that was working that I'm pretty sure I didn't change is not working
[22:55:50] Inside: what language?
[22:57:19] Inside: I could've sworn that this code would work just fine: https://gist.github.com/Insood/c7eafc28a600eafbdb5edf162146d56b
[22:58:40] Inside: I guess the question is... at what level are you trying to learn it?
[22:58:44] Inside: Just the basic syntax?
[22:58:49] Inside: or design patterns?

2018-11-05

[16:09:12] Inside: has joined #ruby
[16:09:15] Inside: has joined #RubyOnRails
[17:21:58] Inside: model.save only saves it if the data is valid
[17:22:50] Inside: try .save! if you want to see if there an issue
[17:22:55] Inside: (because it will throw an error)
[17:23:30] Inside: also I wasn't even aware you could pass a regex to delete
[17:24:18] Inside: that's string::delete
[17:25:43] Inside: what are you trying to do with your regex?
[17:27:35] Inside: don't you want [0-9]*
[17:31:06] Inside: In that case - I don't know
[17:32:35] Inside: my only suggestion at this point is to do:
[17:32:55] Inside: if !msg.save then <print out msg.errors >
[17:33:09] Inside: my guess is that these records are failing some other validation
[17:41:04] Inside: are you looking for delete!
[17:41:45] Inside: since delete() returns a copy, but doesn't do an in-place replace
[17:47:54] Inside: you need gsub!
[17:48:40] Inside: delete! will probably work for you too
[17:50:08] Inside: Any time you see a function with ! at the end, that means "this function probably modifies the data in-place"
[17:50:29] Inside: that's only a standard for the ruby standard library though
[17:51:51] Inside: rails tries to follow the same standard as well, but, for example: Model.delete! doesn't exist since Model.delete already deletes stuff for you -- irreversably
[17:52:17] Inside: and the difference between save and save! is that you can recover from "save" - save! throws an exception though
[18:00:12] Inside: mices: https://gist.github.com/Insood/e7813071b8a8f5b18a64845fe26c1495
[18:00:29] Inside: for example you could modify the attributes of your model, then call .save to run the validations
[18:00:37] Inside: if they fail, you can check to see if they failed and show a message
[18:00:45] Inside: if you call save! you just get an exception thrown
[18:01:15] Inside: which - is fine for stuff that can't be handled nicely (ie: rake tasks, etc) or if you really just need to abort abort abort
[18:01:23] Inside: mlt-: Aughh that sucks
[18:01:47] Inside: since you switched systems, maybe the seed changed?
[23:02:22] Inside: crankharder: how about merge?
[23:03:03] Inside: You can do Foo.some_scope.merge(Bar.other_scope)
[23:05:23] Inside: ivanskie: I prefer silver age Thor over the other versions

2018-11-03

[00:08:09] Inside: Disconnected by services

2018-11-02

[19:11:46] Inside: dachi: I use react rails
[19:15:46] Inside: I've never used server side rendering unfortunately
[19:15:52] Inside: I don't even understand your question, sadly
[21:19:13] Inside: mlt-: I had misconfigured my database.yml to point to a production database when I ran a test and the fixture loading code wiped out some production data ... without me even knowing :)

2018-11-01

[16:32:24] Inside: well - it is what I am using
[16:32:48] Inside: but yup yup looks like it's just Hash these days
[16:32:49] Inside: fun times
[18:51:19] Inside: Design Q: Controllers. Let's say I'm using acts_as_list and a model has a position within its parent's context.
[18:51:48] Inside: MyObjectsController::move_up / mode_down are not considered kosher
[18:52:11] Inside: so... I guess I do.. MyObjectMoveUpsController?
[18:52:15] Inside: ... seems odd
[19:49:35] Inside: you want a join table it sounds like
[19:49:47] Inside: Because you have distinct users and you have distinct kit lists
[19:50:07] Inside: So you'll wnat a join table called.. KitListUsers
[19:50:36] Inside: https://guides.rubyonrails.org/association_basics.html
[19:50:38] Inside: see 3.3.2
[19:51:13] Inside: Yes exactly that
[19:55:10] Inside: you'll need has_and_belongs_to_many
[19:55:31] Inside: but I think people recommend to use has_many :Through
[19:56:15] Inside: https://flatironschool.com/blog/why-you-dont-need-has-and-belongs-to-many/
[19:56:23] Inside: one is magic and you can't extend it
[19:56:37] Inside: ie: let's say you want call back to fire whenever a user has like 500 kits to give them a badge
[19:56:51] Inside: you'd want to be inside an actual model
[19:57:23] Inside: I believe has_and_belongs_to_many just assumes that you have a table and magically creates records in that table
[19:58:25] Inside: with has many_through, the association model gets created and you can add logic later
[19:58:31] Inside: for a cost of an extra file and a few more characters
[19:58:55] Inside: https://github.com/rubocop-hq/rails-style-guide#has-many-through
[20:01:36] Inside: or rubo cop will get you
[21:16:48] Inside: holy crap that's a lot of work
[21:16:50] Inside: that's cool though
[21:17:02] Inside: glasz: I am using centos 7, but not rh-ruby25 :(
[21:17:04] Inside: or am I..
[21:17:14] Inside: Oh, I am using rvm
[21:22:28] Inside: and you're executing scl enable rh-ruby25 bash everytime?
[21:22:35] Inside: I mean - for every new shell you make?
[21:23:59] Inside: I vaguely recally trying to use scl with ruby, but must've had a similar issue
[21:24:15] Inside: oh wait no, that's because I had multiple rails projects running different versions of ruby
[21:24:17] Inside: ACTION shudders
[21:24:46] Inside: Q: does your gemfile specify a ruby version?
[21:25:15] Inside: and does that version match rh-ruby?
[21:31:45] Inside: Greetings.
[21:32:05] Inside: you mean hungover?
[21:32:10] Inside: who schedules halloween parties on a wednesday anyway
[21:39:29] Inside: must you use scl ruby 2.5? latest is already 2.5.2
[21:40:37] Inside: I hate asking questions like that, but I think with ruby it's more standard to use the existing environment managers since they're better supported
[21:41:42] Inside: https://gist.github.com/Insood/079d3dc08c049431f7494fa36745e2fe
[21:43:23] Inside: you want minitest-bisect
[21:44:09] Inside: minitest-bisect is built exactly for tracking down test-order dependency
[21:44:33] Inside: you give it a seed and it'll tell you which tests you need to run in order to reproduce your test failure
[21:51:01] Inside: mlt-: Try iittt
[21:57:40] Inside: have you tried running minitest-bisect?
[22:09:20] Inside: ACTION shrugs
[22:14:56] Inside: convention over configuration ~_~
[22:38:34] Inside: What's WSL?
[22:40:21] Inside: how did I not hear about this
[22:41:00] Inside: fun times.
[22:41:10] Inside: destroy through assimilation
[22:41:14] Inside: gentrification of linux :D