shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

270
active users

#activerecord

0 posts0 participants0 posts today
postmodern<p>What do people prefer for ensuring that ActiveRecord connections get freed?<br><a href="https://ruby.social/tags/activerecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>activerecord</span></a> <a href="https://ruby.social/tags/sidekiq" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sidekiq</span></a></p>
Jack of all trades<p>ActiveRecord's callback hell is worse than JavaScript's callback hell.</p><p>Prove me wrong.</p><p><a href="https://mas.to/tags/rails" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rails</span></a> <a href="https://mas.to/tags/ruby" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ruby</span></a> <a href="https://mas.to/tags/callbacks" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>callbacks</span></a> <a href="https://mas.to/tags/CallbackHell" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CallbackHell</span></a> <a href="https://mas.to/tags/ActiveRecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ActiveRecord</span></a> <a href="https://mas.to/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a></p>
postmodern<p>Lazy ActiveRecord: can you use query class-methods defined in another model from within where() statements when doing deep joins() from a different model?</p><p>class Bar &lt; ActiveRecord::Base<br> def self.with_baz(value)<br> ...<br> end<br>end</p><p>class Thing &lt; ActiveRecord::Base<br> def self.bars_with_baz(value)<br> joins(foo: [:bar]).where(<br> foo: {<br> bar: {with_baz: value}<br> }<br> )<br> end<br>end</p><p><a href="https://ruby.social/tags/activerecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>activerecord</span></a></p>
postmodern<p>When validating the uniqueness of a belongs_to, is it really necessary to use the foreign-key name (ex: :foo_id)? Or will the association name suffice? I'm wondering if `validates :foo_id, uniqueness: ...` is different or equivalent to `validates :foo, uniqueness: ...`, or maybe some legacy cargo culting due to old bugs?<br><a href="https://ruby.social/tags/activerecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>activerecord</span></a></p>
postmodern<p>What are people's opinions on setting the column length for string enum columns in migrations?<br><a href="https://ruby.social/tags/activerecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>activerecord</span></a> <a href="https://ruby.social/tags/rails" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rails</span></a></p>
postmodern<p>What is the preferred way to setup CI to test ActiveRecord migrations (as well as any raw SQL queries) against sqlite3, postgres, mysql? Apparently I have to setup a "service container" for postgres. How do I shoehorn it into the CI matrix?<br><a href="https://gist.github.com/RizkyRajitha/ca945c55ab09bcc2c7c150b2fed7db13" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">gist.github.com/RizkyRajitha/c</span><span class="invisible">a945c55ab09bcc2c7c150b2fed7db13</span></a><br><a href="https://ruby.social/tags/activerecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>activerecord</span></a></p>
Denis 🌏<p>okay, it's not just me... the <a href="https://hachyderm.io/tags/mongoose" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mongoose</span></a> <a href="https://hachyderm.io/tags/middleware" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>middleware</span></a> is just really poorly designed. Really frustrating for those of us coming from an <a href="https://hachyderm.io/tags/activeRecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>activeRecord</span></a> world where things are just a lot more mature.</p><p>Just wish I hadn't lost the hours I just spent banging my head against this. But at least I know now to just not attempt anything non-trivial via middleware.</p><p><a href="https://hachyderm.io/tags/nodeJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>nodeJS</span></a> <a href="https://hachyderm.io/tags/mongoDB" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mongoDB</span></a> </p><p><a href="https://futurefoundry.co/blog/mongoose-middleware-gripes/" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">futurefoundry.co/blog/mongoose</span><span class="invisible">-middleware-gripes/</span></a></p>
postmodern<p>How do you validate that at least one of three (or more) ActiveRecord belongs_to associations are set? Every example I can find mentions only two belongs_to associations.<br><a href="https://ruby.social/tags/activerecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>activerecord</span></a></p>
postmodern<p>Is adding `after { ActiveRecord::Base.clear_active_connections! }` to a non-Rails app that uses ActiveRecord still necessary in order to prevent those pesky 5 second timeout exceptions after so many requests?<br><a href="https://ruby.social/tags/sinatra" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sinatra</span></a> <a href="https://ruby.social/tags/activerecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>activerecord</span></a></p>
Collin Donnell<p>Here’s what I want. A package for persisting data that uses a <a href="https://ruby.social/tags/SwiftUI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftUI</span></a>-style DSL to define models and migrations, has simple concurrency, uses the <a href="https://ruby.social/tags/ActiveRecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ActiveRecord</span></a> pattern, and steals anything <a href="https://ruby.social/tags/Rails" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rails</span></a> gets right.</p><p>I don’t know if I have the skills to pull that off by myself, or how much Swift would fight you in trying to achieve this, but I think it would be fantastic and a better developer experience than <a href="https://ruby.social/tags/CoreData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CoreData</span></a>. </p><p>Please don’t reply to tell me about existing persistence frameworks.</p>
David Aldridge<p>Suppose you want a test in <a href="https://ruby.social/tags/Rails" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rails</span></a> <a href="https://ruby.social/tags/ActiveRecord" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ActiveRecord</span></a> that says "make sure this scope has applied". </p><p>How about using `<a href="https://ruby.social/tags/annotate" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>annotate</span></a>` in the scope definition, then testing the generated SQL for the presence of the annotation text?</p>