Module: Bannable::ActiveRecord

Defined in:
lib/bannable/active_record.rb,
lib/bannable/active_record/instance_methods.rb

Defined Under Namespace

Modules: InstanceMethods

Instance Method Summary collapse

Instance Method Details

#bannable(options = {}) ⇒ Object



3
4
5
# File 'lib/bannable/active_record.rb', line 3

def bannable(options = {})
  send :include, InstanceMethods
end

#bannedObject



7
8
9
# File 'lib/bannable/active_record.rb', line 7

def banned
  where(self.arel_table[:banned].not_eq(nil))
end

#not_bannedObject



11
12
13
# File 'lib/bannable/active_record.rb', line 11

def not_banned
  where(self.arel_table[:banned].eq(nil))
end