ags
> default_scope { where(deleted_at: nil) }end
>
>
> When I call
> Article.joins(:tags)
> It adds the scope from belongs_to :articles (in this case unscope(where:
> :deleted_at)) to the where chain and overrides the default scope of tags
> (where(deleted_at:
>
Maybe the clearer way to apply it would be to allow unscoping via the merge
method?
I think the overall idea is worth pursuing in some fashion. We often have
big queries with lots of joins on aggregate dashboards, and ordering on
default scopes for joined models adds wasted expense to queries.
Would this be easier if freezing time took place in a block, and any
unfrozen time followed the closure of the block? Then we wouldn't need a
separate method. I think this was the recommended practice with Timecop.
On Sun, Sep 2, 2018, 6:18 PM Xavier Noria wrote:
> I think it makes sense. For
Hi Leo,
A suggestion if you wanted to build this feature as a gem: the Pacecar gem
used to add these scopes automatically. It's no longer maintained, but you
could dig up some of the code to just get the automatic scopes for booleans.
https://github.com/thoughtbot/pacecar
-Geoff
On Thu, Jan 4,
Hi Colin,
What Ruby and Rails versions are you using?
I'm able to use Symbol#size in a brand new Rails 5.1 application. Can you
recreate the problem in a new Rails app? I suspect the #size method is
missing in your application due to monkey patching Symbol in the app itself
or one of its
One way you could handle this would be to add a virtual attribute to your model
with `attr_accessor` called `marked_for_deletion`. You could then use that flag
as a temporary change to your model without deleting it, and then delete those
objects in the final DB transaction after the user
Brian,
I think require_tree often leads to problems (it’s one of the first things I
remove when I’m building an app), but by loading specific JS files per page,
aren’t you denying your users’ browsers the opportunity to cache the JS from
other page visits? Separate per-page JavaScript files
Hi Pete,
I don’t think it’s necessary to require SSL in development, so even if enabling
SSL by default in production environments is a good idea (which I’m not
convinced is necessary), I think requiring it in development is overkill, and
makes the path to getting started on an app more
, Geoff Harcourt wrote:
Hi Pete,
I don’t think it’s necessary to require SSL in development, so even if
enabling SSL by default in production environments is a good idea (which
I’m not convinced is necessary), I think requiring it in development is
overkill, and makes the path
Hi Pier-Olivier,
Somewhat related - you might want to take a look at this approach that LevelUp
uses to process payments when their system is too bogged down to process
transactions in the database:
http://www.confreaks.com/videos/2481-railsconf2013-zero-downtime-payment-platforms
Not sure
Hi Rain,
I don’t think that web applications are like software libraries in this
respect. Engineering teams that are pushing software out the door are already
tracking their versions with commits to their source control. SemVer is great
because it helps convey things like breaking changes,
OK, pushed. I can't push my own database data up, so I'll get four questions up
there for you.
-Geoff
--
Geoff Harcourt
On Tuesday, October 2, 2012 at 4:07 PM, dburry wrote:
One of the great things I like about rails is not always being tied to full
backwards compatibility causing
Michael,
That array isn't blank, empty strings aren't the same as nils. I think changing
that behavior would be confusing. If you don't want to count those elements,
it's probably best to filter the array for non-blank strings.
-Geoff
--
Geoff Harcourt
On Monday, July 9, 2012 at 10:15 AM
I would be in favor of either of these two options. I imagine extracting
and gem-ifying the controllers would be a hassle, but then the default path
for setting up a new view and controller action would require the user to
think about what they are doing rather than just observe the magic.
I never knew what the proper practice was for this sort of thing. In
scenarios where I had to ensure that a primary key was set to a number I
specified, I always used a callback to modify the ID to match a facade
attribute if it had been set.
I'm sure that's wrong, but I could never figure out a
Given the number of posts to the list that don't fit the list criteria,
could we move to a system where everyone's first post is screened? That
might prevent both jerks like this guy and mistaken posts that should be
sent to ror-talk from ending up in the discussion.
-Geoff
On Tue, May 24, 2011
I'm interested in the answer to Byrne's original question, but I think
another solution here is to use '-12-31' as the infinite date.
On Wed, Mar 30, 2011 at 3:25 PM, Colin Law clan...@googlemail.com wrote:
On 30 March 2011 19:45, byrnejb byrn...@harte-lyne.ca wrote:
First, if my
17 matches
Mail list logo