brick 1.0.248 → 1.0.250
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/extensions.rb +1 -1
- data/lib/brick/rails/engine.rb +4 -4
- data/lib/brick/rails/form_tags.rb +4 -4
- data/lib/brick/version_number.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8dfd58af439d004894147bf5e1e568c791e2044d48f945aa22fa89a8e46d3efa
|
|
4
|
+
data.tar.gz: 166b4869016f55f710f4124e8eb9d1ca4531c29a5e4c83e7c32dc661cf429c21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 354fa85b9c8e24c6bfd3a970de0fa93aec8daede747bb14a32d9c9a8ead95e19a38bbad646b70fd74c5d8aed24a55b31c9acdf9a9ea4570b8d5f24853961f484
|
|
7
|
+
data.tar.gz: '0367903f7ff42ec1ac644b08e8462bf6297fccb34fac5f7cd92eb0f365e6af2e44c93d3a7bf216bf004366ba45a73f916607e2ff67141bfb1a68fc540fed5b65'
|
data/lib/brick/extensions.rb
CHANGED
|
@@ -441,7 +441,7 @@ module ActiveRecord
|
|
|
441
441
|
CGI.escapeHTML(assoc_name)
|
|
442
442
|
end
|
|
443
443
|
model_path = ::Rails.application.routes.url_helpers.send("#{_brick_index || table_name}_path".to_sym)
|
|
444
|
-
model_path << "?#{self.inheritance_column}=#{self.name}" if self != base_class
|
|
444
|
+
model_path << "__?#{self.inheritance_column}=#{self.name}" if self != base_class
|
|
445
445
|
av_class = Class.new.extend(ActionView::Helpers::UrlHelper)
|
|
446
446
|
av_class.extend(ActionView::Helpers::TagHelper) if ActionView.version < ::Gem::Version.new('7')
|
|
447
447
|
link = av_class.link_to(assoc_html_name ? name : assoc_name, model_path)
|
data/lib/brick/rails/engine.rb
CHANGED
|
@@ -1098,14 +1098,14 @@ if (window.brickFontFamily) {
|
|
|
1098
1098
|
until this_model == base_model do
|
|
1099
1099
|
this_model = this_model.superclass
|
|
1100
1100
|
path = send(\"#\{this_model._brick_index}_path\")
|
|
1101
|
-
path << \"
|
|
1101
|
+
path << \"?__#\{base_model.inheritance_column}=#\{this_model.name}\" unless this_model == base_model
|
|
1102
1102
|
parent_links << link_to(this_model.name, path)
|
|
1103
1103
|
end
|
|
1104
1104
|
\"<tr><td colspan=\\\"#\{td_count}\\\">Parent: #\{parent_links.join(' ')}</tr>\".html_safe
|
|
1105
1105
|
end
|
|
1106
1106
|
%><%= if (children = model.descendants).present?
|
|
1107
1107
|
child_links = children.map do |child|
|
|
1108
|
-
path = send(\"#\{child._brick_index}_path\") + \"
|
|
1108
|
+
path = send(\"#\{child._brick_index}_path\") + \"?__#\{base_model.inheritance_column}=#\{child.name}\"
|
|
1109
1109
|
link_to(child.name, path)
|
|
1110
1110
|
end
|
|
1111
1111
|
\"<tr><td colspan=\\\"#\{td_count}\\\">Children: #\{child_links.join(' ')}</tr>\".html_safe
|
|
@@ -1406,7 +1406,7 @@ s << \"\\n <br>\\n\"
|
|
|
1406
1406
|
#{(inh_col = @_brick_model.inheritance_column).present? &&
|
|
1407
1407
|
" if obj.respond_to?(:#{inh_col}) && (model_name = @#{obj_name}.#{inh_col}) &&
|
|
1408
1408
|
!model_name.is_a?(Numeric) && model_name != base_model.name
|
|
1409
|
-
see_all_path << \"
|
|
1409
|
+
see_all_path << \"?__#{inh_col}=#\{model_name}\"
|
|
1410
1410
|
end
|
|
1411
1411
|
model_name = base_model.name if model_name.is_a?(Numeric)"}
|
|
1412
1412
|
model_name = nil if model_name == ''
|
|
@@ -1647,7 +1647,7 @@ flatpickr(\".timepicker\", {enableTime: true, noCalendar: true});
|
|
|
1647
1647
|
var mermaidCode;
|
|
1648
1648
|
var cbs = {<%= callbacks.map do |k, v|
|
|
1649
1649
|
path = send(\"#\{v._brick_index}_path\".to_sym)
|
|
1650
|
-
path << \"
|
|
1650
|
+
path << \"?__#\{v.base_class.inheritance_column}=#\{v.name}\" unless v == v.base_class
|
|
1651
1651
|
\"#\{k}: \\\"#\{path}\\\"\"
|
|
1652
1652
|
end.join(', ').html_safe %>};
|
|
1653
1653
|
if (imgErd) imgErd.addEventListener(\"click\", showErd);
|
|
@@ -807,7 +807,7 @@ function onImagesLoaded(event) {
|
|
|
807
807
|
klass, sti_type, rel_name = ::Brick.ctrl_to_klass(controller_path)
|
|
808
808
|
if klass
|
|
809
809
|
type_col = klass.inheritance_column # Usually 'type'
|
|
810
|
-
filter_parts << "#{type_col}=#{sti_type}" if sti_type && klass.column_names.include?(type_col)
|
|
810
|
+
filter_parts << "__#{type_col}=#{sti_type}" if sti_type && klass.column_names.include?(type_col)
|
|
811
811
|
path_params = request.path_parameters
|
|
812
812
|
pk = (klass.primary_key || ActiveRecord::Base.primary_key).to_sym
|
|
813
813
|
if ((id = (path_params[pk] || path_params[:id] || path_params["#{klass.name.underscore}_id".to_sym])) && (obj = klass.find_by(pk => id))) ||
|
|
@@ -829,7 +829,7 @@ function onImagesLoaded(event) {
|
|
|
829
829
|
.pluck(assoc_klass.primary_key).first)
|
|
830
830
|
foreign_id = new_id
|
|
831
831
|
end
|
|
832
|
-
filter_parts << "#{path_param}=#{foreign_id}"
|
|
832
|
+
filter_parts << "__#{path_param}=#{foreign_id}"
|
|
833
833
|
end
|
|
834
834
|
klass
|
|
835
835
|
end
|
|
@@ -839,7 +839,7 @@ function onImagesLoaded(event) {
|
|
|
839
839
|
if klass_or_obj
|
|
840
840
|
if klass_or_obj.is_a?(ActiveRecord::Relation)
|
|
841
841
|
klass_or_obj.where_values_hash.each do |whr|
|
|
842
|
-
filter_parts << "#{whr.first}=#{whr.last}" if whr.last && !whr.last.is_a?(Array)
|
|
842
|
+
filter_parts << "__#{whr.first}=#{whr.last}" if whr.last && !whr.last.is_a?(Array)
|
|
843
843
|
end
|
|
844
844
|
klass_or_obj = klass_or_obj.klass
|
|
845
845
|
end
|
|
@@ -849,7 +849,7 @@ function onImagesLoaded(event) {
|
|
|
849
849
|
if klass_or_obj.is_a?(Class) && klass_or_obj <= ActiveRecord::Base
|
|
850
850
|
type_col = klass_or_obj.inheritance_column
|
|
851
851
|
if klass_or_obj.column_names.include?(type_col) && klass_or_obj.name != klass_or_obj.base_class.name
|
|
852
|
-
filter_parts << "#{type_col}=#{klass_or_obj.name}"
|
|
852
|
+
filter_parts << "__#{type_col}=#{klass_or_obj.name}"
|
|
853
853
|
end
|
|
854
854
|
end
|
|
855
855
|
filter = "?#{filter_parts.join('&')}" if filter_parts.present?
|
data/lib/brick/version_number.rb
CHANGED