Module: Stagehand::Configuration
Class Method Summary collapse
-
.ignored_columns=(hash) ⇒ Object
Columns not to copy to the production database e.g.
Instance Method Summary collapse
-
#allow_unsynced_production_writes? ⇒ Boolean
Allow unsynchronized writes directly to the production database? A warning will be logged if set to true.
- #ghost_mode? ⇒ Boolean
- #production_connection_name ⇒ Object
-
#single_connection? ⇒ Boolean
Returns true if the production and staging connections are the same.
- #staging_connection_name ⇒ Object
Class Method Details
.ignored_columns=(hash) ⇒ Object
Columns not to copy to the production database e.g. table_name => [column, column, …]
41 42 43 |
# File 'lib/stagehand/configuration.rb', line 41 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.
29 30 31 |
# File 'lib/stagehand/configuration.rb', line 29 def allow_unsynced_production_writes? !!Rails.configuration.x.stagehand.allow_unsynced_production_writes end |
#ghost_mode? ⇒ Boolean
24 25 26 |
# File 'lib/stagehand/configuration.rb', line 24 def ghost_mode? !!Rails.configuration.x.stagehand.ghost_mode end |
#production_connection_name ⇒ Object
20 21 22 |
# File 'lib/stagehand/configuration.rb', line 20 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
35 36 37 |
# File 'lib/stagehand/configuration.rb', line 35 def single_connection? staging_connection_name == production_connection_name end |
#staging_connection_name ⇒ Object
16 17 18 |
# File 'lib/stagehand/configuration.rb', line 16 def staging_connection_name Rails.env.to_sym end |