Class: IpAddress

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Toggleable
Defined in:
app/models/ip_address.rb

Overview

IP address

Attributes:

banned [boolean]
created_at [DateTime]
ip [inet]
object_count [integer]
updated_at [DateTime]

Class Method Summary collapse

Class Method Details

.[](ip) ⇒ Object

Parameters:

  • ip (String)


26
27
28
29
30
# File 'app/models/ip_address.rb', line 26

def self.[](ip)
  return if ip.blank?

  find_or_create_by(ip: ip)
end

.page_for_administration(page = 1) ⇒ Object

Parameters:

  • page (Integer) (defaults to: 1)


21
22
23
# File 'app/models/ip_address.rb', line 21

def self.page_for_administration(page = 1)
  list_for_administration.page(page)
end