I really don’t understand the actual usecase of the except method
http://api.rubyonrails.org/classes/ActiveRecord/SpawnMethods.html#method-i-except
If I don’t want a condition to apply in my query, then why should I
add it?
After adding a condition, what is the point of removing it again. This
how the
doco
http://api.rubyonrails.org/classes/ActiveRecord/SpawnMethods.html#method-i-except
is saying.
–
Regards,
Arup R.
Debugging is twice as hard as writing the code in the first place.
Therefore,
if you write the code as cleverly as possible, you are, by definition,
not
smart enough to debug it.
–Brian Kernighan
–Matt J.
Very useful example. Does it mean, we can use it also scope or on
default
scope ? Will it be a good choice although to use scope relation if it
fits any
query, with some tailoring using except ?
–
Regards,
Arup R.
Debugging is twice as hard as writing the code in the first place.
Therefore,
if you write the code as cleverly as possible, you are, by definition,
not
smart enough to debug it.
–Brian Kernighan
On Sunday, 6 July 2014 13:29:15 UTC-5, Arup R. wrote:
doesn’t want to use.
–Matt J.
Very useful example. Does it mean, we can use it also scope or on
default
scope ? Will it be a good choice although to use scope relation if it
fits any
query, with some tailoring using except ?
Yep. There are also some related methods; rewhere
, reorder
, and
unscope
. They allow somewhat finer control than except
.
–Matt J.