Class: Rabarber::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/rabarber/railtie.rb

Class Method Summary collapse

Class Method Details

.server_running?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/rabarber/railtie.rb', line 7

def self.server_running?
  !!defined?(Rails::Server)
end

.table_exists?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/rabarber/railtie.rb', line 11

def self.table_exists?
  ActiveRecord::Base.connection.data_source_exists?("rabarber_roles")
rescue ActiveRecord::NoDatabaseError, ActiveRecord::ConnectionNotEstablished
  false
end