diff --git a/db/up/define_environment_in_db.sql b/db/up/define_environment_in_db.sql index d05c9ef74..a419e8c8a 100644 --- a/db/up/define_environment_in_db.sql +++ b/db/up/define_environment_in_db.sql @@ -1,3 +1,3 @@ -- https://jamkazam.atlassian.net/browse/VRFS-1951 -- we need to know the environment in the database for advanced behaviors -ALTER TABLE generic_state ADD COLUMN environment VARCHAR(255) NOT NULL DEFAULT 'development'; \ No newline at end of file +ALTER TABLE generic_state ADD COLUMN env VARCHAR(255) NOT NULL DEFAULT 'development'; \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/generic_state.rb b/ruby/lib/jam_ruby/models/generic_state.rb index 9390a58c2..546006794 100644 --- a/ruby/lib/jam_ruby/models/generic_state.rb +++ b/ruby/lib/jam_ruby/models/generic_state.rb @@ -4,11 +4,11 @@ module JamRuby self.table_name = 'generic_state' - validates :environment, :inclusion => {:in => ['development', 'staging', 'production', 'test']} + validates :env, :inclusion => {:in => ['development', 'staging', 'production', 'test']} def self.allow_emails? - database_environment = singleton.environment + database_environment = singleton.env # if the database says we are in production/staging, then the config has to also agree and say we are in production/staging to send emails # this is to protect against developers loading a staging or production environment and possibly sending emails to diff --git a/ruby/spec/jam_ruby/models/generic_state_spec.rb b/ruby/spec/jam_ruby/models/generic_state_spec.rb index 7fdb0137c..671daeaba 100644 --- a/ruby/spec/jam_ruby/models/generic_state_spec.rb +++ b/ruby/spec/jam_ruby/models/generic_state_spec.rb @@ -4,7 +4,7 @@ describe GenericState do def database_env (env) singleton = GenericState.singleton - singleton.environment = env + singleton.env = env singleton.save! end diff --git a/web/spec/spec_helper.rb b/web/spec/spec_helper.rb index f92c77a43..d02e69c97 100644 --- a/web/spec/spec_helper.rb +++ b/web/spec/spec_helper.rb @@ -28,7 +28,6 @@ bputs "before db_config load" db_config = YAML::load(File.open('config/database.yml'))["test"] # initialize ActiveRecord's db connection\ - bputs "before recreate db" SpecDb::recreate_database(db_config)