ibrain-core 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32c2ce34dadd75f8a4f3b9928f6329264ac1b9b2d029bbdc8bd02fc144663cda
|
|
4
|
+
data.tar.gz: d3e0ddda503ccdf30e7a6708d2b197b58c3818f1dfa49fc2e8375c19ea5abb86
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3174ba2c0cd7bff10ec5ca9bae27be08cfa933c93e34552ec7a7c3f90c657efb974cf9cdcf3df9dbe60f6c15b42057275d1726935ad6b89a1d7153bef629c68e
|
|
7
|
+
data.tar.gz: 8710c5d10f36824d66bbf2378de560a63add715ebd75d26d972c15713785c1014712f82dc600f5df7dc8b35c4bca61327594046a2ee140ebd37a9101e09775d7
|
|
@@ -51,6 +51,8 @@ module Ibrain
|
|
|
51
51
|
# Parent controller
|
|
52
52
|
preference :parent_controller, :string, default: 'ActionController::API'
|
|
53
53
|
|
|
54
|
+
preference :master_database, :string, default: 'primary'
|
|
55
|
+
|
|
54
56
|
def static_model_preferences
|
|
55
57
|
@static_model_preferences ||= Ibrain::Preferences::StaticModelPreferences.new
|
|
56
58
|
end
|
data/lib/ibrain/core/version.rb
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
namespace :ridgepole do
|
|
4
4
|
desc 'Apply database schema'
|
|
5
5
|
task apply: :environment do
|
|
6
|
-
|
|
6
|
+
databases = Rails.configuration.database_configuration.fetch(Rails.env, {}).keys
|
|
7
|
+
primary_database = Ibrain::Config.master_database
|
|
8
|
+
spec_option = databases.include?(primary_database) ? "--spec-name primary #{primary_database}" : ""
|
|
9
|
+
|
|
10
|
+
ridgepole('--apply', "-E #{Rails.env}", "--file #{schema_file}", spec_option)
|
|
7
11
|
Rake::Task['db:schema:dump'].invoke if Rails.env.development?
|
|
8
12
|
Rake::Task['annotate_models'].invoke if Rails.env.development?
|
|
9
13
|
end
|