Activity Graph

Page 1 of 1


[21:28:40] linetrace: has left #RubyOnRails: ()


[18:10:01] linetrace: has joined #RubyOnRails
[18:11:06] linetrace: I have a .js.erb file and `root_path` is available, but not `root_url`. why?


[02:39:29] linetrace: Ping timeout: 248 seconds


[12:25:36] linetrace: *.net *.split
[12:27:16] linetrace: has joined #ruby
[12:27:32] linetrace: has joined #RubyOnRails
[15:01:06] linetrace: *.net *.split
[15:04:06] linetrace: has joined #RubyOnRails
[15:04:07] linetrace: has joined #ruby


[05:27:25] linetrace: has joined #RubyOnRails
[05:27:25] linetrace: has joined #ruby


[01:23:25] linetrace: Read error: Connection reset by peer


[06:23:32] linetrace: Ping timeout: 276 seconds
[06:47:48] linetrace: has joined #RubyOnRails
[06:47:48] linetrace: has joined #ruby


[03:51:37] linetrace: How do I confirm fragment caching is working?
[03:53:16] linetrace: I can see collection caching working in logs since that shows the cache hits/misses
[03:54:34] linetrace: but I have some views that have fragment caching and I don't see anything regarding whether they're cached or not and render times don't seem to change with caching enabled/disabled
[14:49:46] linetrace: Is there a way to enable logging of fragment cache hits/misses?
[14:49:56] linetrace: I see them for collection caching
[14:51:48] linetrace: (Rails 5.0.x)
[17:49:54] linetrace: Is there a reasonale way to determine if a PR was backported to 5.0 (i.e.
[17:51:07] linetrace: In my dev environment (log_level is debug), I'm not getting any fragment cache logging, even with enable_fragment_cache_logging = true


[11:41:18] linetrace: Read error: Connection reset by peer


[20:49:45] linetrace: Read error: Connection reset by peer
[20:55:04] linetrace: has joined #ruby


[08:27:53] linetrace: has joined #ruby


[16:58:10] linetrace: Read error: Connection reset by peer


[19:49:11] linetrace: has joined #ruby
[19:50:08] linetrace: Suggestions on preferred OAuth gem(s) to use these days?
[19:50:58] linetrace: Use case is auth for a JSON API, not being used w/Rails
[19:51:18] linetrace: (OAuth client, not server)


[20:03:14] linetrace: has joined #RubyOnRails
[20:03:43] linetrace: has joined #ruby
[20:04:25] linetrace: can render_to_string access instance variables?
[20:06:15] linetrace: deevil: thanks, I'm guessing it can read instance variables, but not write back to them
[20:07:01] linetrace: Using a breadcrumb gem that writes to an instance variable when you add a breadcrumb in view...
[20:07:19] linetrace: ...then calls a render method in the layout, works fine...
[20:08:04] linetrace: ...but when used with comfortable-mexican-sofa, which uses render_to_string to build the content and pass to layout, it doesn't work
[20:08:33] linetrace: deevil: thanks, that's what I thought
[20:08:58] linetrace: deevil: probably no reasonable way around that?
[20:15:15] linetrace: deevil: yeah, instance vars pass through to render_to_string fine, but it's just an interesting way that the breadcrumb gem works by storing state in an instance var so it's accessible from view & layout
[20:16:15] linetrace: deevil: thanks for confirming
[20:31:49] linetrace: has left #RubyOnRails: ()
[20:31:53] linetrace: has left #ruby: ()


[19:29:03] linetrace: has left #RubyOnRails: ()


[00:14:15] linetrace: Remote host closed the connection


[22:30:28] linetrace: how do get a "AS" column to show up as virtual attribute in ActiveRecord select() results?
[22:45:56] linetrace: for my select() "AS" column not showing up question:
[22:51:48] linetrace: or is it just that .to_a doesn't show that column/attribute in the console?
[22:51:57] linetrace: .to_yaml does appear to show it


[19:48:39] linetrace: has joined #RubyOnRails
[19:49:52] linetrace: is there a way to group sql logical expressions together to force precedence using ActiveRecord (Rails 5.1) without resorting to writing raw sql?
[19:51:03] linetrace: i.e. generating parens


[15:25:51] linetrace: has left #RubyOnRails: ()


[22:15:48] linetrace: has joined #RubyOnRails
[22:16:53] linetrace: any changes related to fields_for between rails 5.0 and 5.1 that I'm missing?
[22:29:54] linetrace: getting ActionView::Template::Error: undefined method `name' for nil:NilClass
[22:30:17] linetrace: when calling f.fields_for :tags do |tag_form|
[22:31:17] linetrace: I've been pouring over the code and can't find any obvious changes
[22:33:16] linetrace: dminuoso: yeah, sadly, not sure i can similify and obfuscate this enough for a public gist, though I know that's preferred, hence trying to come at it from a different angle
[22:33:29] linetrace: dminuoso: i'll keep debugging
[22:43:43] linetrace: dminuoso: unfortunately, it's in an old, massive, complex #new _form


[18:57:24] linetrace: Quit: leaving


[01:28:13] linetrace: has joined #RubyOnRails
[01:35:19] linetrace: what's the proper way to sanitize input in an active record #select call?
[01:38:33] linetrace: the following doesn't work like it does for #where calls, for example:"*, MATCH(`name`) AGAINST(:input) as score", input: some_string)
[13:46:46] linetrace: what's the proper way to sanitize sql for a select call (it doesn't seem to support parameterization, like where)?
[13:49:43] linetrace: pupsicle: thanks, I was looking at ActiveRecord::Sanitization.sanitize_sql_for_conditions
[13:53:02] linetrace: pupsicle: no worries, thanks
[13:56:35] linetrace: pupsicle: it looks like you can't parameterize with ?, but %s instead, correct?
[14:03:51] linetrace: tbuehlmann: perfect, thanks!


[03:21:10] linetrace: Read error: Connection reset by peer


[13:02:52] linetrace: *.net *.split


[01:50:51] linetrace: Quit: leaving
[15:12:52] linetrace: has joined #ruby
[15:13:15] linetrace: has joined #RubyOnRails
[21:48:06] linetrace: stack level too deep errors with mutually associated models, each having validates_associated
[21:49:00] linetrace: what's best practice on validates_associated to prevent recursive validations? on the has_one or the has_many or just pick?
[21:49:43] linetrace: (in my case, one has to exist before the other, so maybe only validates_associated on the one that has to be created second (since the prior had to be valid to save)?
[21:58:12] linetrace: looks like validates_associated may not work for has_one associations anyway?


[21:26:10] linetrace: Ping timeout: 240 seconds
[21:26:55] linetrace: has joined #ruby


[19:40:48] linetrace: testing a mailer via delayed_job and getting "ActionView::Template::Error: No route matches {}"
[19:41:02] linetrace: what might cause that?
[19:43:09] linetrace: looks like maybe a link_to
[19:45:35] linetrace: I'm only using *_url (not *_path) and I have config.action_mailer.default_url_options set


[15:40:29] linetrace: has joined #RubyOnRails
[15:41:07] linetrace: How would I call some_method in my ApplicationController from the rails console?
[15:44:12] linetrace: mordof: ah, right, need to instanciate it first. doh!
[15:45:11] linetrace: mordof: sadly, some functionality that really should be in a rake task, but some old code/bad habits stick in this codebase


[21:24:02] linetrace: Read error: Connection reset by peer
[21:24:16] linetrace: has joined #ruby


[21:39:20] linetrace: has joined #RubyOnRails
[21:40:28] linetrace: best way to tackle making some old routes more resourceful/nested? (e.g. `get 'blog/category/:id' => 'blog#category', :as => :blog_category`)
[21:42:41] linetrace: could maybe refactor so it had its own controller, but would prefer not to as its already fakery ontop of ComfyMexicanSofa (similar to comfy_blog, but slightly different)
[21:43:39] linetrace: could such a route be reasonably nested within a :blog resourceful route?


[16:32:06] linetrace: Read error: Connection reset by peer


[17:22:29] linetrace: has joined #RubyOnRails
[17:53:39] linetrace: has joined #ruby
[19:45:36] linetrace: what is best practice for calling functions/methods in Rails 5, space delimited function/method name & parameters or function/method name w/comma delimited parameters within parentheses?
[19:59:10] linetrace: baweaver: thanks, the first one only vaguely touches on parenthesis omission when using keyword args, looking at the 2nd now
[20:04:31] linetrace: baweaver: the 2nd article is much more explicit, only omit parens for methods with no args, Rake/Rails/RSpec, or that have keyword status
[20:05:17] linetrace: matthewd: that's certainly what I'm seeing to be popular, but finding the inconsistency confusing with aging codebases
[20:06:17] linetrace: baweaver, matthewd understandable
[20:08:13] linetrace: baweaver, matthewd haha, good to know
[20:10:06] linetrace: assume the reasoning is fewer characters typed and less chance for syntax errors, amongst others?
[20:14:19] linetrace: matthewd, baweaver: thanks, that gives me a better understanding as to the reason I see so many different styles across old/new codebases and various projects
[20:16:08] linetrace: (as is always the case)


[13:28:21] linetrace: Quit: linetrace


[00:07:41] linetrace: have to admit I’m newish to Rails, it there an advised method (Rails 5) to fetch just values from an ActiveRecord query, not instantiate models from the results in such cases (query just selects year & month of published page for building archive links)
[00:13:20] linetrace: matthewd: pluck looks promising, thanks


[23:30:46] linetrace: an ActiveModel::MissingAttributeError is raised when I iterate over query results for a model using friendly_id (the select statement doesn’t include slug, hence the error)
[23:31:04] linetrace: what’s the best workaround, supress the exception?
[23:31:26] linetrace: due to grouping/ordering of the query, I can’t include the slug in the select statement
[23:33:50] linetrace: matthewd: the exception is thrown on the `each`, but i’ll triple check that
[23:36:20] linetrace: matthewd: yup, exception is thrown on the `each` (e.g. `models.each do |m|`)
[23:43:15] linetrace: matthewd: looking at the full backtrace, it appears to be while instanciating the model because it validates the slug attribute
[23:47:22] linetrace: matthewd: I’ll try converting to an array, so it’s not trying to instantiate since it’s not the full model data anyway
[23:53:37] linetrace: matthewd: backtrace:


[19:23:11] linetrace: has joined #RubyOnRails