Closed ghost closed 3 years ago
Can you clarify your question please? Snippet of code would be helpful
class FirstTable
include NoBrainer::Document
include NoBrainer::Document::Timestamps
has_many :second_tables
field :field1, type: DateTime
end
class SecondTable
include NoBrainer::Document
include NoBrainer::Document::Timestamps
belongs_to :first_table
field :field2, type: DateTime
end
I need join query like:
FirstTable.join(:second_tables).where("first_table.field1 < second_table.field2")
@nviennot Do you have any ideas on this matter?
I'm not sure, you probably want to write custom RQL
I'm closing this issue due to its age but feel free to update it if needed.
Good day. Help please find me a solution because in the documentation I can not find a similar case.
I have two related tables (table_one has many table_two table_two has table_one_id field). I need to make a query from two tables with the following condition: where
table_one.updated_at < table_two.logged_at
.Thank you in advance for your help.