danielricecodes

1

votes
0

answer
8

views

Random RSpec failures comparing Floats (Eq matcher)

I'm not even sure where to begin here. Sorry if this is a duplicate, but I don't even know what to search for or what this particular issue is called. Randomly, and not all that often, a test in my RSpec suite will fail and I'll get an error like this: expected: 0.69 got: 0.69 (0.69e0) (compared us...
danielricecodes
4

votes
1

answer
2.2k

views

Why does remote: true and confirm: 'Are You Sure?' not work together?

I have been wrestling with Rails 4 and UJS and noticed that Rails 4.1 doesn't behave (specifically, rails-ujs) the way I would expect. When using a remote link with a confirmation dialog, the UJS driver sends the XHR before the confirmation popup is approved (making the confirmation popup pointles...
danielricecodes
4

votes
0

answer
99

views

Rails Not query on entire Where clause

Is there a straight-forward way to negate an entire where expression using ActiveRecord/ARel? It seems that where.not(), when given a hash of arguments, negates each expression individually, as opposed to negating the entire thing with a single SQL NOT. Rails Example Thing.where.not(attribute1: [1,...
danielricecodes