You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing an error that is intriguing me, doesn't seem to happen all the time.
I have my overlap conditions defined as:
scope:active,(->{where(deleted: false,available: true)})validates:starttime,:endtime,overlap: {query_options: {active: nil},scope: :user_id,exclude_edges: ["starttime","endtime"],load_overlapped: true,message_title: 'overlap',message_content: 'overlaps with another stop',}
And I've been getting the following error recently:
ActiveRecord::PreparedStatementInvalid: missingvaluefor:user_id_valuein(stops.endtimeISNULLORstops.endtime > :starts_at_value)AND(stops.starttimeISNULLORstops.starttime < :ends_at_value)ANDstops.user_id=:user_id_valuefromactive_record/sanitization.rb:198:in`block in replace_named_bind_variables' from active_record/sanitization.rb:192:in `gsub' from active_record/sanitization.rb:192:in `replace_named_bind_variables'fromactive_record/sanitization.rb:126:in`sanitize_sql_array' from active_record/sanitization.rb:26:in `sanitize_sql_for_conditions' from active_record/relation/where_clause_factory.rb:14:in `build'fromactive_record/relation/query_methods.rb:591:in`where!' from active_record/relation/finder_methods.rb:370:in `construct_relation_for_exists' from active_record/relation/finder_methods.rb:320:in `exists?'fromvalidates_overlap/overlap_validator.rb:52:in`overlapped_exists?' from validates_overlap/overlap_validator.rb:21:in `validate'
...
I've verified and user_id used on the :scope is never nil (no records like that, and validations protect against that. Also looked into the conditions on overlap_validator and don't see anything wrong. The save statement triggering this runs inside a transaction.
The text was updated successfully, but these errors were encountered:
I haven't been maintaining this gem for a while. So not sure, what changed in the Rails world from that time. But may I ask you, what version of rails are you using?
Can you please push somewhere some example application where I can see and test the exception?
I'm currently using Rails 5.2.3. I'll keep investigating this and will let you know if I can isolate the reason why this is happening. This is not happening all the time, so there might be some other factor involved.
I'm seeing an error that is intriguing me, doesn't seem to happen all the time.
I have my overlap conditions defined as:
And I've been getting the following error recently:
I've verified and
user_id
used on the:scope
is nevernil
(no records like that, and validations protect against that. Also looked into the conditions onoverlap_validator
and don't see anything wrong. The save statement triggering this runs inside a transaction.The text was updated successfully, but these errors were encountered: