Suppose three tables:
Table A
has_many :table_b
Table B
belongs_to :table_a
belongs_to :table_c
Table C
has_many :table_b
Table B and Table C have each a boolean attribute has an boolean attribute called "active"
How do I write a SQL statement or Active record expression where I get all the Table A records that don’t have
- any Table B records with active saved as true and
- and if it has, that which are not associated with any Table C with the active attribute saved as true?
You need to sign in to view this answers
Leave feedback about this