Activity Graph

Page 1 of 3 | Next »


[09:55:47] crst: has joined #RubyOnRails
[10:00:04] crst: Hi, I have a general question. What issues do you most often run-in with rails's implementation of MVC?
[20:42:56] crst: Remote host closed the connection


[10:33:21] crst: has joined #RubyOnRails
[10:35:09] crst: Hi, I have a custom env staging and staging.log is created but the file is always 0KB. config.log_level = :warn I have the suspicion that it just doesn't log anything.
[10:40:11] crst: wbednarski: that works. I don't suspect a permission issue, the same user can run production and dev and the logs are created.
[10:40:32] crst: created and filled with data
[10:40:48] crst: on staging it's just created and keeps 0KB
[11:07:16] crst: Remote host closed the connection


[07:50:49] crst: has joined #RubyOnRails
[08:16:01] crst: Ping timeout: 248 seconds


[09:31:18] crst: has joined #RubyOnRails
[09:32:40] crst: Hi, can you recommend me anything where you can manage permission and roles via checkboxes in a webinterface or do I need to build my own?
[10:17:01] crst: dionysus69: ok, thank you
[10:39:36] crst: dionysus69: In that context the same could be achieved with cancancan (which is already implemented), right?
[11:04:45] crst: Read error: Connection reset by peer


[12:26:04] crst: has joined #RubyOnRails
[12:26:56] crst: Hi, is there anything one needs to be aware of when upgrading from 5.1.5 -> 5.2 ?
[12:28:29] crst: *anything special
[12:51:00] crst: Is there a particular reason rspec is not included in "rails new" (v5.2 at least)?
[12:53:27] crst: May I ask how you prefer testing?
[12:54:24] crst: that's a relief
[13:14:13] crst: dminuoso: I've never used minitest
[13:15:01] crst: Also I'm, not much into rspec either, but I assigned writing tests in rspec recently.
[13:16:32] crst: Ah didn't know that, that's cool
[21:14:27] crst: Quit: Leaving...


[21:02:05] crst: has joined #RubyOnRails
[21:03:51] crst: Hi, when I run Model.where(status: 'paid').each {|f| f.calculate_total_price } in console it stops during the process but doesn't show me the error. How can I see what caused the interruption?
[21:31:10] crst: havenwood: oh yeah, indeed. it finishes through everything and is super fast. Unfortunately the results aren't stored in the db.
[21:36:10] crst: havenwood: wow the find_each is so much better. What does OOM mean? At the moment it does not make sense to me why it's not saving, honestly.
[21:36:48] crst: that makes sense. it's a couple of thousand records
[21:41:29] crst: Is it replaced by FREE?
[21:45:40] crst: havenwood: a little better FREE though :D
[21:47:49] crst: havenwood: Thanks so much for the explanation. I commented out the before_save and ran it again. Can you tell me if it is supposed to work then? I'm asking because it seems all fields were emptied by the calculation.
[22:32:02] crst: havenwood: Thanks man! I did this and it works now: Model.where(status: 'paid').find_each {|f| f.calculate_total_price; }
[22:44:21] crst: havenwood: hmm that's strange, when I use .find_each(&:calculate_total_price) instead nothing gets updated.


[11:45:06] crst: has joined #RubyOnRails
[11:48:52] crst: Hi, I run a production app via puma and nginx, the system has 8 virtual CPU's and 16GB Ram, nginx has worker_processes 8; Do I need to setup workers for puma, too. At the moment it has threads 4, 16.
[12:10:54] crst: dionysus69: no idea, there's also redis but I don't know if it's setup properly.
[12:11:21] crst: Also, there are hardcore n+1 issues still need to be fixed
[12:32:07] crst: Remote host closed the connection
[15:22:51] crst: has joined #RubyOnRails
[16:10:08] crst: Remote host closed the connection


[07:45:53] crst: has joined #RubyOnRails
[07:47:07] crst: Hi, is there something like this for rails?
[07:51:09] crst: sevenseacat: thanks!
[07:55:11] crst: This is bad, right? Number of executed queries: 575
[07:58:16] crst: no idea what's going on yet. I'm new to this project and my job now is to fix this mess :) Sounds a lot like N+1 indeed, most queries are the same.
[17:09:31] crst: Remote host closed the connection


[20:32:09] crst: has joined #ruby
[20:33:25] crst: Hi, how can I make name dependent on another field in the same object?
[22:33:22] crst: weaksauce: sure, thanks a lot man!
[22:34:31] crst: ok, thanks
[23:46:05] crst: Quit: Leaving...


[09:43:19] crst: has joined #RubyOnRails
[09:44:31] crst: Morning! I just upgraded a rails app from 4.2 -> 5.1 Now I'm getting /usr/local/var/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activesupport-5.1.5/lib/active_support/inflector/methods.rb:269:in `const_get': uninitialized constant User (NameError) Any idea? I think this is devise related.
[16:04:11] crst: Is it generally considered bad practice when you refactor your migrations or is it ok?
[20:22:25] crst: Quit: Leaving...


[09:56:24] crst: has joined #RubyOnRails
[09:56:31] crst: Good Morning
[11:33:50] crst: Remote host closed the connection
[18:39:49] crst: has joined #RubyOnRails
[18:40:07] crst: Quit: Leaving...


[10:57:10] crst: has joined #RubyOnRails
[10:58:12] crst: Hi, somebody here likes talking with me about devops, scaling a rails app?
[11:41:22] crst: Remote host closed the connection
[20:06:47] crst: has joined #RubyOnRails
[21:40:58] crst: Is dhh's statement true that front-end frameworks like react need much more resources than using turbolinks + stimulus? Most js guys say react is super easy going.
[21:42:16] crst: dev hours/effort mostly
[21:45:18] crst:
[22:10:50] crst: Inside: mhmm, isn't there a mp3 link usually? Anyway I've found this:
[22:11:38] crst: Or maybe this if the upper link is not working
[22:22:21] crst: Inside: Keep me updated I really like your ticker :)
[23:28:10] crst: Quit: Leaving...


[10:13:48] crst: Hi, what's a good approach making this query interactive via JS (injecting {start} and {end} and get an updated chart)? <%= line_chart Bill.group_by_month(:created_at, range: '{start}'..'{end}').sum('amount') %>
[23:01:08] crst: Quit: Leaving...


[08:10:32] crst: Where's the the file should be implemented?
[10:10:00] crst: Remote host closed the connection
[17:36:44] crst: has joined #RubyOnRails
[17:38:41] crst: Hi, I'm trying to upgrade 4.2 -> 5.1. Added gem 'rails', '5.1.5'. But when I run bundle update rails I get: The bundle currently has rails locked at 4.2.10. Try running `bundle update rails`
[17:39:49] crst: mroutis: It's a loop
[17:43:42] crst: mroutis: It's so strange, isn't it? I've been avoiding deleting Gemfile.lock since I run into multiple issues when I did.
[17:45:27] crst: yep, rbenv
[17:50:25] crst: Maybe it's because some gems link to github directly
[17:53:34] crst: lol, now when I bundle install after removal of Gemfile.lock I get: Could not find gem 'rails (= 5.1.5)' in any of the gem sources listed in your Gemfile.
[17:55:22] crst: mroutis: This is the Gemfile:
[18:01:38] crst: wait, I've got it. It's been either rbenv-bundle-exec or rbenv-binstubs which caused that. Good riddance.


[07:55:11] crst: has joined #RubyOnRails
[07:55:19] crst: Good Morning
[16:16:53] crst: Any idea how one can make the following with chartkick: There's a table bills, each record has a number value and a date. Now I'd like to group the x-axis my month (or else) and show the number values on the y-axis. (I'm actually trying to create a profit over time chart)
[16:33:28] crst: Or any idea how one can generate the following data set for chartkick with activerecord: There's a table `bills`, each record has a number value and a date. Whenever some records share the same day, week, month (depending on range) the number values will be summed up.
[16:50:03] crst: Exuma: thanks! This needs to be encapsulated, right?
[16:50:46] crst: In something which injects @start_date and @end_date to get the range
[16:53:38] crst: According to the first example at why can't one just do something like <%= line_chart Bill.amount.group_by_day(:created_at).count %> ?
[16:55:07] crst: dminuoso: I can't. I get: undefined method `amount'
[16:55:58] crst: And apart from that I have no idea how to make something better or why it's considered bad.
[16:57:15] crst: dminuoso: It has, when doing `Bill.last.amount` I get the value
[17:02:37] crst: dminuoso: Please give me another hint
[17:04:10] crst: dminuoso: Do you have an idea what Bill.group_by(...) is supposed to do?
[17:19:12] crst: choke: ^


[12:07:16] crst: has joined #RubyOnRails
[12:10:04] crst: Hi, any recommendations for integrating a fast searchable select box for a dataset with a couple of thousand entries? Would you say this is already a case for ajax or is it ok to put it inside html? I tried chosen & select2, both are super unresponsive.
[12:30:06] crst: thomasfedb: ok, thanks
[22:13:01] crst: Quit: Leaving...


[10:49:27] crst: has joined #RubyOnRails
[10:50:09] crst: Hi, what can you do when the main script is in the head but js only works when it's after certain dom elements? The snippet is already inside $(document).ready
[10:52:16] crst: tbuehlmann: yep
[10:53:35] crst: not in this project, no
[10:56:39] crst: tbuehlmann: for one this:
[10:57:42] crst: I have the suspicion the issue relates to the external scripts
[11:01:29] crst: This is from the view: When my js is inside the <script> tag here it works
[11:02:05] crst: Strange, console says: Uncaught ReferenceError: jQuery is not defined
[11:02:32] crst: But it certainly is included
[11:04:35] crst: tbuehlmann:
[11:08:13] crst: dminuoso: I'm having huge latency when using webpacker at least in a certain app. Might this be related to your issue?
[11:11:19] crst: dminuoso: loading, reloading, and ajax takes a couple of seconds
[11:13:05] crst: dminuoso: yep
[11:26:45] crst: dminuoso: Loading a request feels way longer than the time the profiler gives me. It seems like the profiler gives me the time the page usually loads without webpacker installed.
[11:27:21] crst: chrome gives me 35s profiler gives me 1.5s
[11:32:32] crst: dminuoso: 0.18ms according to chrome. Where can I find the Middleware stack infos that you need? I'm sorry no pro here.
[11:38:37] crst: dminuoso: I can only tell of development. Even a fresh webpacker:install without adding anything to the views is enough to trigger the latency. "Error: Command 'middleware' not recognized"
[11:39:06] crst: rails is 4.2 in this case btw
[11:39:30] crst: I need to rake, one sec
[11:40:37] crst: dminuoso:
[12:34:27] crst: dminuoso: Unfortunately not, I signed an NDA and can't reproduce the issue. Thanks anyway!
[12:39:01] crst: All right thanks. It might take me a couple of days/weeks to find the time for this.
[12:39:42] crst: There's also an upgrade to 5 planned and maybe that'll resolve the issue
[12:52:43] crst: dminuoso: Absolutely. Atm the webpack issue isn't high priority though :)
[13:05:13] crst: at the moment
[13:06:11] crst: fox_mulder_cp: gem install ud; ud atm :)
[19:56:17] crst: Quit: Leaving...


[09:57:50] crst: has joined #RubyOnRails
[11:26:19] crst: Quit: Leaving...


[00:46:45] crst: Quit: Leaving...


[13:14:12] crst: has joined #RubyOnRails
[13:14:51] crst: has joined #ruby
[13:16:29] crst: Hi, this looks really strange to me. Does it make sense? supplier_fuel_price * (invoice_order_amount || order_amount)
[13:17:08] crst: Xeago: logic
[13:18:14] crst: lol, that's a great comment actually
[13:18:41] crst: it calcultes records ind a db table
[13:18:58] crst: what if both are present? or both are null
[13:25:49] crst: dminuoso: thanks for the explanation, it makes more sense to me now
[13:27:19] crst: canton7 ^
[13:34:46] crst: dminuoso: There's not much reliability on the new project I'm working on. It's a mess to be honest and needs a big cleaning.
[13:36:18] crst: I have been working with laravel for last couple of months. Really happy working with rails again, though laravel is really ok
[13:47:09] crst: an idea why?
[13:47:09] crst: Hi, I'm using 'ajax-datatables-rails' and in the do |record| there's buying_cost: record.supplier_fuel_total_price which relies on def supplier_fuel_total_price; supplier_fuel_price * (invoice_order_amount || order_amount); end This particular columns is not sortable on click when I have buying_cost: { source: "FuelQuote.supplier_fuel_total_price" }, in view_columns Anybody
[13:55:49] crst: Mhm, maybe it's because I'm getting => #<Money fractional:2934558.0 currency:USD> for FuelQuote.first.supplier_fuel_total_price
[19:54:34] crst: What is the terminology of having a method in the model file like this: `def test; "AAA" ;end` what gives: `Model.last.test => "AAA"`
[20:02:12] crst: Ah ok, thanks. I can call the instance method this way and get a result in the console, but when I use ajax-datatables-rails I get: PG::UndefinedColumn ERROR: column Model.test does not exist I think that's because it's not really a column of the model. Is there a way to attach the instance method that it behaves like a virtual column?
[20:05:40] crst: My current query is like this: Model.includes(:client_company).where(status: 'paid').references(:client_company).distinct


[13:45:04] crst: has joined #RubyOnRails
[15:36:56] crst: Remote host closed the connection


[10:31:12] crst: has joined #RubyOnRails
[10:34:48] crst: I just can't get my railsapp to run under systemd. I tried multiple things similar to When I run systemctl it fails on load :(
[13:45:06] crst: has joined #ruby
[21:22:41] crst: Quit: Leaving...


[15:00:40] crst: has joined #ruby
[15:03:13] crst: Hey guys! chrisfix here. :) Why is /usr/local/var/rbenv/shims always on top of my paths? It messes around with normal binaries which I can't use properly then.
[15:46:39] crst: havenwood: that's right. I'm using rbenv to manage my ruby versions and like to keep using it. But when I want to use rg -irl 'active' . for instance it interferes with redgreen-1.2.2/bin/rg That's just one example of a handful
[15:48:13] crst: havenwood: exactly
[15:51:23] crst: havenwood: yeah, for this reason I keep my main installation path /usr/local/bin on top of all other paths, but then rbenv forces it's shims on top of that. I manage my paths pretty well but once in a while rbenv interferes and I'd like to use paste commands or use history and avoid aliasing the command.
[15:52:21] crst: havenwood: I know, but then I'd have to do that each time :)
[15:55:19] crst: havenwood: ok, thanks a lot! matthewd: I'm fairly certain it is required by at least one rails project I'm working on. havenwood: There are some gems I use often in the cli and like to avoid renaming them, too.
[15:59:34] crst: havenwood, matthewd: I see, thanks for suggesting me these possibilities! I keep these in mind while trying to create a workaround.
[16:08:35] crst: that's certainly a nice thing to do for your colleagues
[16:10:50] crst: Remote host closed the connection
[16:11:23] crst: has joined #ruby
[18:26:50] crst: Remote host closed the connection


[06:35:48] crst: Remote host closed the connection
[08:51:24] crst: has joined #RubyOnRails
[10:26:47] crst: Remote host closed the connection


[06:26:08] crst: has joined #RubyOnRails
[06:29:31] crst: Good Morning everybody! How do you differentiate between new and edit in a _form partial. For instance: I want include value: "anything" on some input form in new but omit that in edit obviously.
[06:33:33] crst: tamouse__: I'm sorry, I don't understand what you're saying. What does that mean?
[06:38:59] crst: I see. So I can use value: "anything" unless @book.perstited?
[06:39:35] crst: tamouse__: perfect, thank you!
[06:42:15] crst: tamouse__: yeah, it does that automatically for edit
[06:46:31] crst: tamouse__: And the preassignmnet looks like that, right? Controller: @value01 = "anything" (only in def new) View: value: @value01
[06:49:52] crst: tamouse__: different types. for now mainly string and integer
[06:50:48] crst: tamouse__: It's called Topup :)
[06:51:14] crst: It's maybe like a Post
[06:51:30] crst: A User has many posts
[06:51:40] crst: A User has many Topups
[06:54:04] crst: tamouse__: ok thank you very much I definitely go that route first. Seems to be more "railsy"
[07:17:53] crst: tamouse__: works great!
[07:27:21] crst: Do you know if I can send all the previously entered values of a field into autofill?
[07:40:18] crst: Ok after doing some research, this would be an autocomplete feature handled by js
[07:44:33] crst: Does anybody make use of inputmode="numeric" instead of type="number" ?
[09:21:02] crst: Read error: Connection reset by peer
[10:22:12] crst: has joined #RubyOnRails
[11:15:11] crst: Neither defaultFontColor: '#f00' in chartkick.rb nor library: { fontColor: '#f00' } inline is working for me. Did anybody have success changing the font color in chartkick?
[11:34:49] crst: noob_on_rails: I also can't change fontFamily and backgroundColor among other things. responded to an issue on gh anyway.


[07:18:19] crst: has joined #RubyOnRails
[07:22:26] crst: Hi, what's the best way to implement into a select for a form? Where exactly should one put it (inline, yml, model, migration)? (I18n the full country names later is also important)
[07:39:03] crst: Remote host closed the connection
[10:30:12] crst: has joined #RubyOnRails
[10:30:44] crst: Radar: thanks for the memo!
[12:00:52] crst: Is there a datepicker without jquery?
[13:02:58] crst: lol. I'm aware that that I can build my own :D
[13:31:11] crst: Remote host closed the connection


[06:15:04] crst: has joined #RubyOnRails
[06:17:41] crst: Could it be that markdown blocks via slim don't work in latest rails? I get "cannot load such file -- pandoc-ruby"
[06:18:07] crst: and when I add the pandoc r
[06:18:24] crst: uby gem. I get a complete server error
[07:57:29] crst: How would you implement that a filed in a new record must be bigger or equal than it's previous. Also, in the view how can you get the last value and put it in the form as default?
[08:29:05] crst: dminuoso: thanks it seems perfect for that
[10:10:47] crst: Is there something better than this ? When you're on the edit page and reload the you'll stay on edit and never come back to the original.
[10:12:39] crst: dminuoso: hmm, does not for me :(
[10:13:30] crst: sure gimme a sec
[10:28:51] crst: here's the gist
[10:30:24] crst: I'm working on the computer for yeeeeaaaars but still feel like an amateur
[10:50:46] crst: appreciate the help, I need to postpone solving this issue for the moment
[10:51:26] crst: because it's taking me too long
[10:52:04] crst: and there's a big thread of thought I need to go back
[14:12:48] crst: Remote host closed the connection


[08:24:32] crst: has joined #RubyOnRails
[08:26:58] crst: My checkbox gets a type=hidden assigned
[08:31:25] crst: Oh, that's not the issue. The issue is it can't be checked.
[08:48:25] crst: nevermind, got it. id field had a typo
[10:16:09] crst: has joined #ruby
[10:16:53] crst: How can I pass &:date as argument instead of a block here: .chart= area_chart Hash[cartops.group_by_month_of_year { |u| }.map { |k, v| [k, v.size] }]
[10:33:06] crst: elomatreb: this works: .chart= area_chart Hash[cartops.group_by_month_of_year(&:date).map { |k, v| [k, v.size] }] thank you!
[20:04:22] crst: Quit: Leaving...


[08:42:51] crst: has joined #ruby
[08:45:03] crst: Hi, is it possible to make a one liner out of this snippet ?
[12:49:01] crst: Remote host closed the connection


[13:22:10] crst: has joined #RubyOnRails
[13:22:14] crst: has joined #ruby
[13:23:00] crst: Hi, how can I make this work? = f.submit (current_page?(user_path) ? : "t" : "f")
[13:27:28] crst: dminuoso: it should give either f.submit "t" or f.submit "f"
[13:30:12] crst: maybe this is better, i tried so much already: f.submit current_page?(user_path) ? "t" : "f"
[13:32:45] crst: oh, it does work now...
[13:32:51] crst: thanks :)
[13:35:20] crst: dminuoso: how is your lambda calculus going?
[13:37:08] crst: cool, keep up the good work :)
[17:19:26] crst: Quit: Leaving...


[12:57:15] crst: I'm new to testing, what technology should I invest my time to learn? I've read that chrome headless changed a lot and selenium is kind of eol, not sure if I got that correctly.
[13:19:47] crst: Remote host closed the connection
[15:39:35] crst: has joined #RubyOnRails
[16:20:47] crst: Remote host closed the connection