Module: Stagehand::Configuration

Extended by:
Configuration
Included in:
Configuration
Defined in:
lib/stagehand/configuration.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ignored_columns=(hash) ⇒ Object

Columns not to copy to the production database e.g. table_name => [column, column, …]



40
41
42
# File 'lib/stagehand/configuration.rb', line 40

def self.ignored_columns=(hash)
  super HashWithIndifferentAccess.new(hash)
end

Instance Method Details

#allow_unsynced_production_writes?Boolean

Allow unsynchronized writes directly to the production database? A warning will be logged if set to true.

Returns:

  • (Boolean)


28
29
30
# File 'lib/stagehand/configuration.rb', line 28

def allow_unsynced_production_writes?
  !!Rails.configuration.x.stagehand.allow_unsynced_production_writes
end

#ghost_mode?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/stagehand/configuration.rb', line 23

def ghost_mode?
  !!Rails.configuration.x.stagehand.ghost_mode
end

#production_connection_nameObject



19
20
21
# File 'lib/stagehand/configuration.rb', line 19

def production_connection_name
  Rails.configuration.x.stagehand.production_connection_name || Rails.env.to_sym
end

#single_connection?Boolean

Returns true if the production and staging connections are the same. Use case: Front-end devs may not have a second database set up as they are only concerned with the front end

Returns:

  • (Boolean)


34
35
36
# File 'lib/stagehand/configuration.rb', line 34

def single_connection?
  staging_connection_name == production_connection_name
end

#staging_connection_nameObject



15
16
17
# File 'lib/stagehand/configuration.rb', line 15

def staging_connection_name
  Rails.env.to_sym
end