brick 1.0.27 → 1.0.30
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 +4 -4
- data/lib/brick/config.rb +24 -4
- data/lib/brick/extensions.rb +357 -160
- data/lib/brick/frameworks/rails/engine.rb +71 -38
- data/lib/brick/join_array.rb +1 -1
- data/lib/brick/version_number.rb +1 -1
- data/lib/brick.rb +36 -14
- data/lib/generators/brick/install_generator.rb +15 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad31136f451e04eabcc67ee09980d45d25aa8e35453aaf4c160ffc9aef3f774c
|
4
|
+
data.tar.gz: 5e3b705dfad389391b291d26bd3c0571cf0579abce3ed00c2840805fd5e05353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac2403152cae57e54ae1840920aa47e5c64297ff7698f691c0a752ae063d824073f24d040aa66580ef0e5eddac0ec164cf720bc720ad73a09ef7862116608476
|
7
|
+
data.tar.gz: b529668cde573b3c371af30b7f141a1e313d477281bc2ef5453c9751a67abea39a4d8a57e3632f6ef8789ea04ab9d4e01170fb29f096fa6ab8772df77f60f564
|
data/lib/brick/config.rb
CHANGED
@@ -122,12 +122,32 @@ module Brick
|
|
122
122
|
@mutex.synchronize { @sti_namespace_prefixes = prefixes }
|
123
123
|
end
|
124
124
|
|
125
|
-
def
|
126
|
-
@mutex.synchronize { @
|
125
|
+
def schema_behavior
|
126
|
+
@mutex.synchronize { @schema_behavior ||= {} }
|
127
127
|
end
|
128
128
|
|
129
|
-
def
|
130
|
-
@mutex.synchronize { @
|
129
|
+
def schema_behavior=(schema)
|
130
|
+
@mutex.synchronize { @schema_behavior = schema }
|
131
|
+
end
|
132
|
+
|
133
|
+
def sti_type_column
|
134
|
+
@mutex.synchronize { @sti_type_column ||= {} }
|
135
|
+
end
|
136
|
+
|
137
|
+
def sti_type_column=(type_col)
|
138
|
+
@mutex.synchronize do
|
139
|
+
(@sti_type_column = type_col).each_with_object({}) do |v, s|
|
140
|
+
if v.last.nil?
|
141
|
+
# Set an STI type column generally
|
142
|
+
ActiveRecord::Base.inheritance_column = v.first
|
143
|
+
else
|
144
|
+
# Custom STI type columns for models built from specific tables
|
145
|
+
(v.last.is_a?(Array) ? v.last : [v.last]).each do |table|
|
146
|
+
::Brick.relations[table][:sti_col] = v.first
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
131
151
|
end
|
132
152
|
|
133
153
|
def default_route_fallback
|