Activity Graph

Page 1 of 2 | Next »


[21:46:38] Net: What's the idiomatic way to return the status of a method call?
[21:46:58] Net: e.g. :email_sent, :email_blocked, :no_connection, etc.


[07:47:51] Net: *.net *.split
[07:52:44] Net: has joined #RubyOnRails
[07:52:49] Net: has joined #elixir-lang
[07:52:50] Net: has joined #ruby
[12:48:52] Net: Ping timeout: 252 seconds
[12:53:22] Net: has joined #ruby
[12:53:22] Net: has joined #elixir-lang
[12:53:22] Net: has joined #RubyOnRails


[06:45:43] Net: How should I handle creating private helper methods in a subclass that don't override private methods of the same name in the parent class?
[07:04:42] Net: phaul: I have running into naming collisions with a subclass' parent
[07:04:46] Net: *I am running into
[07:05:27] Net: where the parent has some private methods defined with a common name
[07:05:49] Net: I could just name the subclass's methods something else
[07:05:54] Net: but the parent class has a lot of methods
[07:06:07] Net: and I would rather just have a more reliable solution
[07:06:15] Net: to what seems like should be a fairly common problem
[07:07:21] Net: phaul: agreed
[07:07:56] Net: phaul: unfortunately, "good design" is not the description I would use for this project :)
[07:18:06] Net: phaul: thanks!
[07:18:40] Net: phaul: what do you think of just prefixing method names?
[07:19:54] Net: I can imagine why
[07:19:56] Net: thank you'


[16:19:12] Net: Ping timeout: 248 seconds


[07:38:45] Net: Ping timeout: 252 seconds
[07:43:13] Net: has joined #ruby
[07:43:13] Net: has joined #elixir-lang
[07:43:13] Net: has joined #RubyOnRails
[08:04:36] Net: Ping timeout: 252 seconds
[08:09:31] Net: has joined #ruby
[08:09:31] Net: has joined #elixir-lang
[08:09:31] Net: has joined #RubyOnRails


[21:53:13] Net: anyone use interactor?


[16:03:04] Net: Is there a stdlib method that will get a value from a hash by key, or, if not value exists, will set the value using a block then return it?
[16:03:48] Net: basically I want foo[bar] ||= baz(...) but respecting `false`


[14:23:35] Net: has left #RubyOnRails: ()
[14:31:21] Net: has joined #RubyOnRails


[15:45:23] Net: I've refactored some code to make a few database queries in parallel via Threads. All our test are run in transactions, so this breaks some existing tests. What is my best option for resolving this?
[15:49:23] Net: lupine: I wish we could upgrade to the latest right now, but that will take some time
[15:50:25] Net: the only native way to handle this is to perform the cleanup manually?
[15:51:44] Net: Ah, yes we are
[15:51:55] Net: can I do that per test file?
[15:53:31] Net: You work on gitlab?


[02:57:20] Net: is it possible to write a custom join clause for a has_many association?
[02:58:21] Net: specifically, I want to have `has_many :bars, -> { where(' = ANY (foo.bar_ids)') }`


[20:58:21] Net: Ping timeout: 252 seconds
[21:08:30] Net: has joined #ruby
[21:08:30] Net: has joined #elixir-lang
[21:08:30] Net: has joined #RubyOnRails


[00:56:05] Net: Is there a better way to write `@users[@users.index { |u| == id }] = user`?
[01:02:09] Net: adam12: you're wondering if @users should be a hash?
[01:03:37] Net: adam12: it's not, I'm just lazy. It'll get refactored to a hash later
[01:04:07] Net: my question was solely if there was a better way to update an element on an array based on a condition
[01:04:50] Net: trying to familiarize myself with the stdlib :)
[01:05:53] Net: thanks!
[01:06:59] Net: havenwood: no dupes
[01:08:32] Net: interesting. in this case it's just a hacky way to update some json in redis until I move this data into postgres, but I'll keep that in mind
[01:10:08] Net: Any recommended books or articles for learning ruby and RoR?
[01:10:42] Net: I've worked with both years ago, but I could use some reading to brush up—I don't remember much.
[01:11:21] Net: Really I just want to get a feel for common idioms and more advanced concepts
[01:12:19] Net: and where might I find nicely written Ruby code? :)
[01:15:32] Net: I've got The Well Grounded Rubyest 3rd ed. on Kindle, What's Kestrels, Quirky Birds, and Hopeless Egocentricity about?
[01:16:04] Net: Looks like haskell in ruby
[01:16:29] Net: any specific GitHub projects?
[01:18:08] Net: Do I need to learn Japanese?
[01:19:18] Net: Worth watching past RubyKaigi talks?
[01:19:23] Net: thanks!
[01:20:04] Net: Will do, thank you!
[01:20:48] Net: great commenting in roda
[01:21:14] Net: 👍🏼


[00:22:51] Net: Ping timeout: 252 seconds
[00:37:59] Net: has joined #RubyOnRails
[00:38:01] Net: has joined #elixir-lang
[00:38:03] Net: has joined #ruby
[00:39:42] Net: Max SendQ exceeded
[00:40:29] Net: has joined #elixir-lang
[00:40:29] Net: has joined #RubyOnRails
[00:40:30] Net: has joined #ruby
[16:49:41] Net: *.net *.split


[18:28:56] Net: What do you think of passing procs around as callbacks. Is that frowned upon in Ruby?
[18:29:36] Net: I suppose the more conventional format would be to take a block, but this needs to be passed inside a hash


[19:54:55] Net: I'm getting undefined local variable or method `csp_meta_tag' when I use csp_meta_tag in a layout. Any advice?
[19:55:00] Net: csrf_meta_tag works fine
[19:56:05] Net: nvm, restarting the server seems to have fixed it
[20:10:28] Net: Does AR support polymorphism with multiple id columns instead of a type column?
[23:59:12] Net: nacsurte: try adding `optional: true` to the belongs_to association and then setting the association to `nil` on the model with belongs_to


[12:14:38] Net: *.net *.split


[17:22:41] Net: setting config.active_record.logger = nil doesn't seem to silence logs on rails 5.1.6. did something change?
[17:49:23] Net: hahuang65: local dev
[17:49:50] Net: ActiveRecord::Base.logger = nil does work
[17:52:30] Net: hmm, seems it was because we moved it out of our config and into an initializer
[17:53:29] Net: into config/initializers
[17:56:24] Net: Why would setting it in a config/initializers not work but setting it in development.rb work?
[21:00:58] Net: jackcambridge: Gemfile
[21:06:29] Net: ahovgaard: Timex


[19:00:42] Net: if I have a `has_one :foo` relation of Bar, does ` = create :foo` delete bar's previous foo?
[20:27:43] Net: jtperreault: thanks


[20:05:55] Net: Ping timeout: 252 seconds
[20:06:36] Net: has joined #ruby
[20:06:36] Net: has joined #elixir-lang
[20:06:36] Net: has joined #RubyOnRails


[19:52:31] Net: any idea why `default: false` would be appearing in our schema.rb?
[19:55:49] Net: looks like the columns are `default: false` in their original migrations
[19:56:01] Net: question is: why aren't they default: false in our local and production databases then
[19:59:01] Net: noob69: See what?
[20:01:53] Net: the db has no default. I don't know what the model defaults to, but I'm not sure that matters
[20:05:21] Net: the model default is nil


[18:31:49] Net: Ankhers: maybe


[19:20:08] Net: markh:
[19:22:50] Net: sylario: what's a group?


[21:27:56] Net: I'm getting `find_spec_for_exe': can't find gem irb (>= 0.a) with executable irb when running irb with rbenv
[21:30:14] Net: that's when using the system ruby
[21:30:47] Net: gem install irb fixed it, but seems weird
[21:49:09] Net: I did try rehashing, if that was meant for me
[21:49:40] Net: didn't fix it
[21:49:51] Net: seems like my system irb just got uninstalled somehow
[22:32:27] Net: I believe it's alphabetical
[22:58:23] Net: Zarathu: try increasing max_parallel_workers_per_gather


[23:26:10] Net: Calinou: org_hash is probably [filename, hash]
[23:29:10] Net: davidfetter_work: YourModel.reflect_on_all_associations(:belongs_to).map(&:foregin_key) maybe
[23:39:43] Net: davidfetter_work: that will only show belongs_to associations
[23:40:11] Net: (which, I believe, should be the only columns in the table with fk constraints)


[00:00:56] Net: I have a json column that I'd like to be editable via yaml in a textarea. What's a simple way to implement this?
[16:38:44] Net: What’s the proper way to transform a param for create/update actions?
[16:39:44] Net: In my case I have a param that comes in as a YAML string, and I need to parse it before it’s saved as a JSON attribute.
[17:46:39] Net: Inside: any particular convention?
[17:57:40] Net: is it idiomatic for validators to write attributes?
[18:02:23] Net: this is the way I did it, I don't know if it's better or worse –
[18:03:10] Net: (this is rails 5.0 so no ActiveRecord::Type::Json)


[22:31:35] Net: I'm golfing, can I avoid the assignment in `foo = bar.baz; foo.nil? ? false : foo`?
[22:55:47] Net: havenwood: right, realized I can just do !!bar.baz
[22:56:18] Net: havenwood: I'd rather have a boolean than rely on falseyness
[22:57:04] Net: leftylink's looks fancy, but not sure what it's doing
[23:00:59] Net: Radar: where are you? australia?
[23:01:13] Net: ah nice
[23:05:52] Net: I see, bitwise or with special handling for nil


[00:00:22] Net: Radar: heading out. thanks for the chat. this channel feels pretty dead these days.
[16:19:47] Net: scapegoatee: hi :)
[16:48:45] Net: Is Random::DEFAULT seeded from /dev/urandom when Ruby starts?
[16:48:57] Net: Or should I call srand on load?
[16:52:18] Net: elomatreb: no crypto, just user surveying
[16:54:50] Net: the downside is I'd have to find somewhere to put srand
[17:07:21] Net: elomatreb: I think the seed is generated in the same way as srand
[17:07:44] Net: could anyone with familiarity with the ruby source confirm?
[17:09:45] Net: you're right
[17:21:01] Net: I want to hash one integer to a fraction such that the hashes of an even distribution of integers will be an even distribution of fractions between 0 and 1.
[17:21:06] Net: What's the best way to do this?
[17:21:37] Net:


[18:12:16] Net: Should env vars be changable at runtime?
[18:12:33] Net: that is, should setting constants to env vars at the top of module/class definitions be avoided?
[18:21:28] Net: _phaul: but env vars can be set within the process
[18:22:04] Net: so it seems advantageous to me to be able to change env vars at runtime and see their effect without re-interpreting modules & classes
[18:22:50] Net: I'm looking at class Foo; BAR = ENV['BAR'] and wondering if it's a bad idea
[18:57:20] Net: does anyone know of a definitive guide to auto-[re]loading lib/ in Rails 5?
[18:58:25] Net: What's the point of multi threading ruby if the GIL blocks parallel execution?
[19:02:41] Net: havenwood: I see
[20:12:32] Net: any suggestions for namespacing files to avoid conflicts with gems?
[23:01:17] Net: Radar: Why do you consider it better to be explicit with loading?
[23:02:33] Net: I wonder why it's not documented that require_dependency sets up reloading
[23:04:40] Net: Radar: pain from constant resolution or something more?
[23:05:32] Net: I'm almost always in favor of explcitness, but I'm inexperienced with Rails autoloading and don't know problems
[23:05:58] Net: I'd expect your love for Elixir would've biased you towards of eager loading
[23:06:37] Net: I can see that. Seems like a major flaw in Ruby's constant resolution.
[23:06:56] Net: String::Array => Array is terrible
[23:07:16] Net: what do you mean by that?
[23:08:01] Net: what have I gotten myself into
[23:09:06] Net: in practical terms, does require_dependency just require + set up reloading?
[23:10:29] Net: What do you think about storing domain logic that doesn't fit nicely into the default Rails categories in lib/?
[23:10:53] Net: even logic that depends on app/?
[23:12:04] Net: where in app?
[23:12:26] Net: FooTransaction or Transaction::Foo?
[23:12:36] Net: s/Transaction/Transactions/
[23:12:56] Net: is rails happy with that?
[23:13:52] Net: I think I'd prefer lib/transactions/ so I'm not mixing design pattern grouping and semantic grouping
[23:14:01] Net: as in models, controllers, etc, are design pattern groups
[23:14:18] Net: unless transactions are the same
[23:14:52] Net: what about lib/users/, lib/companies/, etc/
[23:15:19] Net: modules and classes related to the handling of users
[23:16:07] Net: though personally not a fan of phoenix dictating and naming that pattern
[23:16:19] Net: too rails-y :)
[23:16:57] Net: Is it expected that most domain entities will be models, regardless of persistance?
[23:17:20] Net: looks lovely
[23:19:10] Net: I like that
[23:19:19] Net: So, you categorize all files by behaviour?
[23:19:24] Net: (not specifically with rom-rb)
[23:20:18] Net: That seems limiting to me. Do you encounter cases where you're not sure what directory a file should belong in?
[23:21:42] Net: For example, let's say you need to write some classes/modules to parse and write Excel files. Where would you put them?
[23:22:28] Net: What if (for some unimaginable reason) they need to rely on app models or transactions or repositories
[23:25:29] Net: What if you had an Excel file model that you wanted to use to represent Excel files after they're parsed and before their written?
[23:26:12] Net: in app/models/excel_file.rb?
[23:26:34] Net: or app/models/excel_file/parser.rb ?
[23:27:38] Net: How does the parsed data become an instance of ExcelFile?
[23:29:23] Net: Do you think that's better than the parser constructing the ExcelFile directly?
[23:30:05] Net: I hope I'm not wasting too much of your time. This is extremely helpful for me :)
[23:30:54] Net: When you said "I think it falls apart in a Rails application slightly ... because of the Active Record pattern. There is no real clear separation between structs and database queries.", what did you mean?
[23:31:22] Net: what structs and database queries were you referring to?
[23:37:37] Net: I'm imagining a pattern where models handle DB queries and simple data holding, but where most buisness logic has been moved out of the models to other classes or modules that reside in lib/
[23:40:37] Net: So the models are simple value-holding entity representations—usually tied to a db table—which are acted upon by more conventional logic outside of rails patterns.
[23:40:55] Net: Like how you wouldn't build your buisness logic inside the String class.
[23:42:18] Net: I'd like to treat app/ and certain patterns in it as building blocks for more conventional, less pattern-oriented code.
[23:42:54] Net: It's rare to find people who think this is a good idea, which makes me think it's not.
[23:44:11] Net: sometimes feels that way, but it's less arogant to believe I'm just not in the Rails mindset
[23:45:08] Net: Thanks, I'll watch it later :D


[16:00:56] Net: Could someone explain to me how putting nginx in front of puma helps parallelize requests? Does it involve running multiple puma servers and having nginx balance between them?
[16:01:31] Net: Does puma buffer requests from and responses to slow clients?
[16:10:12] Net: havenwood: thanks
[16:11:13] Net: Trying to find if there’s still a reason to proxy puma
[16:18:35] Net: what about gzip or other possible static file advantages?
[16:19:19] Net: havenwood: and what about parallelizing requests if using MRI?
[16:40:58] Net: I see, thanks


[19:09:26] Net: in the latest rails ActiveJob workers will use the time zone when the job was queued, right?
[21:38:27] Net: looks like that was rails 6, not latest


[17:01:02] Net: how can I ensure rails will load a module in dev


[01:47:14] Net: we want to migrate a few fields away from attr_encrypted
[01:47:53] Net: what's the best path for this? we'll need to backfill the decrypted data, and keep the attr_encrypted and decrypted fields in sync while backfilling
[01:49:36] Net: these are moderately large tables (~50 million rows)


[23:51:27] Net: anyone know what difference between sidekiq's delete and kill is?


[04:08:05] Net: phaul: thank you! when you say that's technically not how let works do you mean because the real reason lets are redefined is because they are (lazily) redefined for each `it`?


[20:19:57] Net: are rspec lets reevaluated if a referenced let is redefined?
[20:46:58] Net: havenwood: if it is redefined later in the spec file
[20:48:37] Net: It *seems* like dependent lets will be reevaluated, but I can find this documented anywhere
[20:50:20] Net: havenwood: like this
[20:52:17] Net: specs like the above will pass for me, but I cannot find anything that references this behavior
[21:12:26] Net: havenwood: neat
[21:12:38] Net: very neat!


[17:12:56] Net: *another model
[17:17:40] Net: havenwood: this is all it is right now
[17:19:57] Net: I don't plan on it
[17:20:27] Net: more that once instance of WebhookEvent?
[17:22:03] Net: havenwood: makes sense, thanks
[17:25:20] Net: what's some suggested reading so I don't ask stupid questions like that ^?
[18:54:30] Net: yoshie902a: does t.array even work with pg?
[18:57:29] Net: t.array, :A_options will try to create a column with the type "array", which does not exist in postgres
[18:58:01] Net: the former will try to create a column with the type "string[]" (an array of strings) which does exist
[19:00:15] Net: I'm surprised ActiveRecord doesn't support ON CONFLICT.