ruby on rails - Is it possible to generate SQL `OR` clauses by using scope methods? -


I am using ruby ​​on Ruby 3.2.2 and white gem I would like to know that if used in a way If there is a way to generate SQL queries from the SQL states related to those scope methods, then or can be generated. That's it, I have:

  class articles & lt; ActiveRecord :: base df self.scope_method_1 ... # scope_method_1 End of SQL statuses df self.scope_method_2 ... # scope_method_2 Situations of SQL positions self.scope_method_combination # # I'm looking for some # # where {scope_method_1 | Scope_method_2} # Note: '|' This means that the SQL 'or' Claus Scalcel context # # is in place so that the following SQL query can be prepared: # # Select from the articles, where scope_man_1_1 SQL conditions & gt; Or & lt; Scope_method_2 sql positions & gt;    

Is it possible to generate clauses (using or not using silk gem) with the methods of sculpture or ?

We are discussing this and the original answer does not seem like this. Not least with scope; But if you change the scope to ciphers, then you can.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -