Hey,
I am passing a relation to a method. When the relation has been called
with the *none *method, I want to do something else than usual flow. This
is what I have to detect the NullRelation:
User.where(id: 1).extending_values.include?(ActiveRecord::NullRelation)=
false
User.where(id:
That's the only way right now.
Although, seems wrong to me check if a relation is a null relation, that's
the point of null objects, you should not know that's a null object at all
(may be necessary in your case but seems wrong to me).
What you can do is something like `relation.empty?' which
Unlike developers on *nix machines, Windows users have to be explicit about
rendering file. render can't figure it out because it tries to find ?/ in
it's first argument if it's a string or symbol.
'/' is the *nix file separator. Windows uses '\'. Ruby's File::SEPARATOR,
since 1.9.x knows the
Hey,
I agree with Gabriel Sobrinho. This check goes against the point of having
a NullRelation at all. Maybe you can provide more context about your
use-case and why you need that check.
On Monday, January 6, 2014 7:35:56 AM UTC+1, Shadab Ahmed wrote:
Hey,
I am passing a relation to a
Windows supports both, and so does Ruby:
https://github.com/ruby/ruby/blob/trunk/file.c#L2751-L2756
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Core group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
On Jan 5, 2014, at 11:46 PM, Keenan Brock kee...@thebrocks.net wrote:
Hello All,
Currently, `serialized` columns get save to the database whether they are
changed or not. [Github][1]. Since the serialized columns can be modified
inline, `Dirty` is not used. This behavior introduces too
Then the guide on rendering needs an update. It's says it's mandatory to
specify file when passing a file path argument to render.
On Monday, January 6, 2014 7:30:13 PM UTC, Steve Klabnik wrote:
Windows supports both, and so does Ruby: