Class: ActiveRecord::Relation

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_or/active_record/extension.rb

Instance Method Summary collapse

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_orObject



4
# File 'lib/rails_or/active_record/extension.rb', line 4

alias rails5_or or