Class: ActiveRecord::Relation
- Inherits:
-
Object
- Object
- ActiveRecord::Relation
- Defined in:
- lib/rails_or/active_record/extension.rb
Instance Method Summary collapse
- #or(*other) ⇒ Object
- #or_having(hash) ⇒ Object
-
#or_not(*args) ⇒ Object
Works in Rails 4+.
- #rails5_or ⇒ Object
Instance Method Details
#or(*other) ⇒ Object
5 6 7 |
# File 'lib/rails_or/active_record/extension.rb', line 5 def or(*other) rails5_or(RailsOr.parse_parameter(self, *other)) end |
#or_having(hash) ⇒ Object
43 44 45 |
# File 'lib/rails_or/active_record/extension.rb', line 43 def or_having(hash) self.or(RailsOr.spawn_relation(self, :having, hash)) end |
#or_not(*args) ⇒ Object
Works in Rails 4+
39 40 41 |
# File 'lib/rails_or/active_record/extension.rb', line 39 def or_not(*args) # Works in Rails 4+ self.or(klass.where.not(*args)) end |
#rails5_or ⇒ Object
4 |
# File 'lib/rails_or/active_record/extension.rb', line 4 alias rails5_or or |