Module: Brick::Rails

Defined in:
lib/brick/rails.rb,
lib/brick/rails/engine.rb

Defined Under Namespace

Modules: FormBuilder, FormTags Classes: Engine

Constant Summary collapse

BRICK_CSS =

CONSTANTS

"<style>
#titleSticky {
  position: sticky;
  display: inline-block;
  left: 0;
  z-index: 2;
}

.flashNotice {
  color: green;
}
.flashAlert {
  color: red;
}

h1, h3 {
  margin-bottom: 0;
}
#rowCount {
  display: table-cell;
  height: 32px;
  vertical-align: middle;
  font-size: 0.9em;
  font-family: sans-serif;
}
#imgErd {
  display: table-cell;
  background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAABNCAMAAADU1xmCAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAARxaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyI+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjwvdG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1FZIVVRdeEZrk359fj52ppubm3l6e4qbqJOTlBlGfM3k3Nzc3K6lnk9RWaenp0FjikGDyJGRkWJiYk2L0Li4uJubnH5+flFbeNPT02tpac3NzVBGJkCCyMvLy9LS0oxETk2U3tLS0tXV1cPDw+Xl5amDftbX19na2uLj4+jo6dzd3OXl511dXd/g31paWlZXV9TU1HBwcOvr687OzdDQ0u/u7fTx79PSzcrJx6KiooWFhujn5NvW05WUk7S1t3R1d7y9vcLCv37J68vMzVJTVOLY1gMiSpmamnt7e7K6zHq+43LQ9Vyez+Pf3LGyscXGybzD1sXDw46v02vI8I+Pj7vEtNvIx7q4ubnZ54a3it3f5s+8vGS/6L6trK+6qICs1H+33cXc6KiuwAOr48fN20ee0Fao0lyz4W6s1qyrrKKlt3XdkoqnyyFoqzuTy6ixosuVeobA4YHNl8TOv3/Ck9bc4I3P7Uqq3tDIxz2FwzN/vF+VxdDe59mIfU+OxJmovxl+wX7S9WjbhovW9jihyKGalIq31uNyY36exJCatJONhTm36nKj0B2q4Mqxsae2zc/U3tvf1cqKa7zAyJS4npqyyTh2tUhMT1drj5ixtN98cEfC8U2Y5vf39355cSN0s4mDfKaomlrG8b2cmcFvaGx/m2CeZge68HG64YCNntSgoVHUdJzKnIHIh6c+BalVVaPM5qrG2CZZkyaHH3WRtYrdn5nH2rxoP22+gN1VQTyxW1aXl0iO2GaxtFuzaCCAQyXSWDOKlDZwkxIINVZPP52Io3uldtIoC1uGVxmzRP6PHn8AAADVdFJOUwAmEf6t/v4EAQVR/oT+Hl4U/v1bR/7+Kf7+a/76Q4Y2Wf1b4j71sXm0y2hF/bBwbtXN/fyGl8Sxiu382Preqfzia9iIkdP51/Povnineu+9n6H7ov5ksLfYy/7////////+/////////////////////v/////////////////////////////////////////////////////////////////////////////+/////////////////////////////////////////////////////r5xM8kAAA0qSURBVFjDpZh3WFNnG8YDMZOiLEFEsVhn1Vq1Vq1abWv3br+dc5IQsklCSEiIyAoJyAhb9h4ishVQcCAIOLC4UBFx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azvFhtE1Hm2w8fzl2Yf6g6hLp3y1K2QwjkTGYP/hiZpz2U/BASs/HDsCPHc09l26Du8oa8uSIHOnihpsJj/B7mvTj/M63GzAAAAAElFTkSuQmCC);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  width: 28px;
  height: 32px;
  cursor: pointer;
}
#mermaidErd {
  display: none;
}
#mermaidErd .exclude {
  position: absolute;
  color: red;
  top: 0;
  right: 0;
  cursor: pointer;
}
.relatedModel {
  cursor: pointer;
}

#dropper {
  background-color: #eee;
}
#btnImport {
  display: none;
}

#headerTopContainer {
  position: sticky;
  display: inline-block;
  top: 0px;
  background-color: white;
  z-index: 1;
}
#headerTopAddNew {
  position: absolute;
  width: 100%;
  top: -33px;
}
#headerButtonBox {
  display: inline-block;
  position: sticky;
  right: 0px;
  float: right;
}
#headerButtonBox a, #headerButtonBox svg {
  display: table-cell;
  height: 24px;
  width: 24px;
  padding: 2px;
}
#addNew {
  background-color: #008061;
}

table {
  border-collapse: collapse;
  font-size: 0.9em;
  font-family: sans-serif;
}
table.shadow {
  min-width: 400px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

tr th {
  background-color: #009879;
  color: #fff;
  text-align: left;
}
.col-sticky {
  position: sticky;
  left: 0;
}
#headerTop tr th {
  position: relative;
}
#headerTop tr th .exclude {
  position: absolute;
  display: none;
  top: 0;
  right: 0;
  cursor: pointer;
}
#headerTop tr th:hover, #headerTop tr th.highlight {
  background-color: #28B898;
}
#exclusions {
  font-size: 0.7em;
}
#exclusions div {
  border: 1px solid blue;
  display: inline-block;
  cursor: copy;
}
#headerTop tr th:hover .exclude {
  display: inline;
  cursor: pointer;
  color: red;
}
tr th a {
  color: #80FFB8;
}
.add-hm-related {
  float: right;
}
#tblAddCol {
  position: relative;
  z-index: 2;
  border: 2px solid blue;
}
tr th, tr td {
  padding: 0.2em 0.5em;
}

tr td.highlight {
  background-color: #B0B0FF;
}

table tr .col-sticky {
  background-color: #28B898;
}

.show-field {
  background-color: #004998;
}
.show-field a {
  color: #80B8D2;
}

table.shadow > tbody > tr {
  border-bottom: thin solid #dddddd;
}

table tbody tr:nth-of-type(even) {
  background-color: #f3f3f3;
}
table tbody tr:nth-of-type(even) .alternating-gray {
  background-color: #fff;
}
table tbody tr:nth-of-type(odd) .alternating-gray {
  background-color: #f3f3f3;
}

table.shadow > tbody > tr:last-of-type {
  border-bottom: 2px solid #009879;
}

table tbody tr.active-row {
  font-weight: bold;
  color: #009879;
}

a.show-arrow {
  font-size: 1.5em;
  text-decoration: none;
}
a.big-arrow {
  font-size: 2.5em;
  text-decoration: none;
}
.dimmed {
  background-color: #C0C0C0;
  text-align: center;
}
.right {
  text-align: right;
}
.paddingBottomZero {
  padding-bottom: 0px;
}
.paddingTopZero {
  padding-top: 0px;
}
.orphan {
  color: red;
  white-space: nowrap;
}
.thumbImg {
  max-width: 96px;
  max-height: 96px;
}
.danger {
  background-color: red;
  color: white;
}
.brick-note {
  font-size: 0.7em;
  color: #A0FFA0;
  max-width: 0;
}

#revertTemplate {
  display: none;
}
svg.revert {
  display: none;
  margin-left: 0.25em;
}
input+svg.revert {
  top: 0.5em;
}

.update {
  position: sticky;
  right: 1em;
  float: right;
  background-color: #004998;
  color: #FFF;
}
</style>
"
AVO_SVG =
"<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 84 90\" height=\"30\" fill=\"#3096F7\">
  <path d=\"M83.8304 81.0201C83.8343 82.9343 83.2216 84.7996 82.0822 86.3423C80.9427 87.8851 79.3363 89.0244 77.4984 89.5931C75.6606 90.1618 73.6878 90.1302 71.8694 89.5027C70.0509 88.8753 68.4823 87.6851 67.3935 86.1065L67.0796 85.6029C66.9412 85.378 66.8146 85.1463 66.6998 84.9079L66.8821 85.3007C64.1347 81.223 60.419 77.8817 56.0639 75.5723C51.7087 73.263 46.8484 72.057 41.9129 72.0609C31.75 72.0609 22.372 77.6459 16.9336 85.336C17.1412 84.7518 17.7185 83.6137 17.9463 83.0446L19.1059 80.5265L19.1414 80.456C25.2533 68.3694 37.7252 59.9541 52.0555 59.9541C53.1949 59.9541 54.3241 60.0095 55.433 60.1102C60.748 60.6134 65.8887 62.2627 70.4974 64.9433C75.1061 67.6238 79.0719 71.2712 82.1188 75.6314C82.1188 75.6314 82.1441 75.6717 82.1593 75.6868C82.1808 75.717 82.1995 75.749 82.215 75.7825C82.2821 75.8717 82.3446 75.9641 82.4024 76.0595C82.4682 76.1653 82.534 76.4221 82.5999 76.5279C82.6657 76.6336 82.772 76.82 82.848 76.9711L83.1822 77.7063C83.6094 78.7595 83.8294 79.8844 83.8304 81.0201V81.0201Z\" fill=\"currentColor\" fill-opacity=\"0.22\"></path>
  <path opacity=\"0.25\" d=\"M83.8303 81.015C83.8354 82.9297 83.2235 84.7956 82.0844 86.3393C80.9453 87.8829 79.339 89.0229 77.5008 89.5923C75.6627 90.1617 73.6895 90.1304 71.8706 89.5031C70.0516 88.8758 68.4826 87.6854 67.3935 86.1065L67.0796 85.6029C66.9412 85.3746 66.8146 85.1429 66.6998 84.9079L66.8821 85.3007C64.1353 81.222 60.4199 77.8797 56.0647 75.5695C51.7095 73.2593 46.8488 72.0524 41.9129 72.0558C31.75 72.0558 22.372 77.6408 16.9336 85.3309C17.1412 84.7467 17.7185 83.6086 17.9463 83.0395L19.1059 80.5214L19.1414 80.4509C22.1906 74.357 26.8837 69.2264 32.6961 65.6326C38.5086 62.0387 45.2114 60.1232 52.0555 60.1001C53.1949 60.1001 54.3241 60.1555 55.433 60.2562C60.7479 60.7594 65.8887 62.4087 70.4974 65.0893C75.1061 67.7698 79.0719 71.4172 82.1188 75.7775C82.1188 75.7775 82.1441 75.8177 82.1593 75.8328C82.1808 75.863 82.1995 75.895 82.215 75.9285C82.2821 76.0177 82.3446 76.1101 82.4024 76.2055L82.5999 76.5228C82.6859 76.6638 82.772 76.8149 82.848 76.966L83.1822 77.7012C83.6093 78.7544 83.8294 79.8793 83.8303 81.015Z\" fill=\"currentColor\" fill-opacity=\"0.22\"></path>
  <path d=\"M42.1155 30.2056L35.3453 45.0218C35.2161 45.302 35.0189 45.5458 34.7714 45.7313C34.5239 45.9168 34.2338 46.0382 33.9274 46.0844C27.3926 47.1694 21.1567 49.5963 15.617 53.2105C15.279 53.4302 14.8783 53.5347 14.4753 53.5083C14.0723 53.4819 13.6889 53.326 13.3827 53.0641C13.0765 52.8022 12.8642 52.4485 12.7777 52.0562C12.6911 51.6638 12.7351 51.2542 12.9029 50.8889L32.2311 8.55046L33.6894 5.35254C32.8713 7.50748 32.9166 9.89263 33.816 12.0153L33.9983 12.4131L42.1155 30.2056Z\" fill=\"currentColor\" fill-opacity=\"0.22\"></path>
  <path d=\"M82.812 76.8753C82.6905 76.694 82.3715 76.2207 82.2449 76.0444C82.2044 75.9739 82.2044 75.8782 82.1588 75.8127C82.1132 75.7473 82.1335 75.7724 82.1183 75.7573C79.0714 71.3971 75.1056 67.7497 70.4969 65.0692C65.8882 62.3886 60.7474 60.7393 55.4325 60.2361C54.3236 60.1354 53.1943 60.08 52.055 60.08C45.2173 60.1051 38.5214 62.022 32.7166 65.6161C26.9118 69.2102 22.2271 74.3397 19.1864 80.4308L19.151 80.5013C18.7358 81.3323 18.3458 82.1784 17.9914 83.0194L16.9786 85.2655C16.9077 85.3662 16.8419 85.472 16.771 85.5828C16.6647 85.7389 16.5584 85.9 16.4621 86.0612C15.3778 87.6439 13.8123 88.8397 11.995 89.4732C10.1776 90.1068 8.20406 90.1448 6.36344 89.5817C4.52281 89.0186 2.9119 87.884 1.76676 86.3442C0.621625 84.8044 0.00246102 82.9403 0 81.0251C0.00604053 80.0402 0.177178 79.0632 0.506372 78.1344L1.22036 76.5681C1.25084 76.5034 1.28639 76.4411 1.32669 76.3818C1.40265 76.2559 1.47861 76.135 1.56469 76.0192C1.58531 75.9789 1.60901 75.9401 1.63558 75.9034C7.06401 67.6054 14.947 61.1866 24.1977 57.5317C33.4485 53.8768 43.6114 53.166 53.2855 55.4971L48.9155 45.9286L41.9276 30.6188L33.8256 12.8263L33.6433 12.4285C32.7439 10.3058 32.6986 7.92067 33.5167 5.76573L34.0231 4.69304C34.8148 3.24136 35.9941 2.03525 37.431 1.20762C38.868 0.379997 40.5068 -0.0370045 42.1668 0.0025773C43.8268 0.0421591 45.4436 0.536787 46.839 1.43195C48.2345 2.32711 49.3543 3.58804 50.0751 5.07578L50.2523 5.47363L51.8474 8.96365L74.0974 57.708L82.812 76.8753Z\" fill=\"currentColor\" fill-opacity=\"0.22\"></path>
  <path opacity=\"0.25\" d=\"M41.9129 30.649L35.3301 45.0422C35.2023 45.3204 35.0074 45.563 34.7627 45.7484C34.518 45.9337 34.2311 46.0562 33.9274 46.1048C27.3926 47.1897 21.1567 49.6166 15.617 53.2308C15.279 53.4505 14.8783 53.555 14.4753 53.5286C14.0723 53.5022 13.6889 53.3463 13.3827 53.0844C13.0765 52.8225 12.8642 52.4688 12.7777 52.0765C12.6911 51.6842 12.7351 51.2745 12.9029 50.9092L32.0285 8.99382L33.4869 5.7959C32.6687 7.95084 32.7141 10.336 33.6135 12.4586L33.7958 12.8565L41.9129 30.649Z\" fill=\"currentColor\" fill-opacity=\"0.22\"></path>
</svg>
"
AA_PNG =
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAAgCAYAAABNXxW6AAAMPmlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEBooUsJvQkiNYCUEFoA6V1UQhIglBgDQcVeFhVcu1jAhq6KKFhpFhRRLCyKvS8WVJR1sWBX3qSArvvK9873zb3//efMf86cO7cMAGonOCJRHqoOQL6wUBwbEkBPTkmlk54CBOgCGsAAgcMtEDGjoyMAtKHz3+3ddegN7YqDVOuf/f/VNHj8Ai4ASDTEGbwCbj7EhwDAK7kicSEARClvPqVQJMWwAS0xTBDiRVKcJceVUpwhx/tkPvGxLIjbAFBS4XDEWQCoXoI8vYibBTVU+yF2EvIEQgDU6BD75udP4kGcDrEN9BFBLNVnZPygk/U3zYxhTQ4naxjL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P =
"<svg height=\"36px\" viewBox=\"0 0 214 274\" xmlns=\"http://www.w3.org/2000/svg\">
    <g transform=\"matrix(4.16667,0,0,4.16667,-1049.47,-789.371)\">
      <path d=\"M281.386,193.134L287.086,193.134C287.433,193.134 287.716,193.417 287.716,193.764C287.716,194.11 287.433,194.394 287.086,194.394L281.386,194.394C281.04,194.394 280.756,194.11 280.756,193.764C280.756,193.417 281.04,193.134 281.386,193.134ZM284.252,245.638C282.456,245.638 281.008,247.086 281.008,248.851C281.008,250.645 282.456,252.094 284.252,252.094C286.047,252.094 287.496,250.645 287.496,248.851C287.496,247.086 286.047,245.638 284.252,245.638ZM284.252,246.331C282.835,246.331 281.701,247.465 281.701,248.851C281.701,250.268 282.835,251.401 284.252,251.401C285.638,251.401 286.803,250.268 286.803,248.851C286.803,247.465 285.638,246.331 284.252,246.331ZM275.843,208.63L287.559,218.11L275.843,227.622L275.843,221.858L251.874,221.858L251.874,214.394L275.843,214.394L275.843,208.63ZM278.866,239.906L278.866,233.102C278.866,232.851 278.677,232.693 278.456,232.693L271.622,232.693C271.401,232.693 271.212,232.851 271.212,233.102L271.212,239.906C271.212,240.157 271.401,240.314 271.622,240.314L278.456,240.314C278.677,240.314 278.866,240.157 278.866,239.906ZM280.41,233.102L280.41,239.906C280.41,240.157 280.599,240.314 280.819,240.314L287.653,240.314C287.874,240.314 288.063,240.157 288.063,239.906L288.063,233.102C288.063,232.851 287.874,232.693 287.653,232.693L280.819,232.693C280.599,232.693 280.41,232.851 280.41,233.102ZM289.606,233.102L289.606,239.906C289.606,240.157 289.795,240.314 290.047,240.314L296.851,240.314C297.071,240.314 297.26,240.157 297.26,239.906L297.26,233.102C297.26,232.851 297.071,232.693 296.851,232.693L290.047,232.693C289.795,232.693 289.606,232.851 289.606,233.102ZM269.197,189.449L299.276,189.449C301.354,189.449 303.055,191.149 303.055,193.197L303.055,251.275C303.055,253.355 301.354,255.055 299.276,255.055L269.197,255.055C267.118,255.055 265.449,253.355 265.449,251.275L265.449,223.496L267.842,223.496L267.842,242.488L300.63,242.488L300.63,198.394L267.842,198.394L267.842,212.725L265.449,212.725L265.449,193.197C265.449,191.149 267.118,189.449 269.197,189.449Z\" style=\"fill:rgb(31,147,209);\"/>
    </g>
</svg>"

Class Method Summary collapse

Class Method Details

.display_binary(val, max_size = 100_000) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/brick/rails.rb', line 83

def display_binary(val, max_size = 100_000)
  return unless val

  @image_signatures ||= { (+"\xFF\xD8\xFF\xEE").force_encoding('ASCII-8BIT') => 'jpeg',
                          (+"\xFF\xD8\xFF\xE0\x00\x10\x4A\x46\x49\x46\x00\x01").force_encoding('ASCII-8BIT') => 'jpeg',
                          (+"\xFF\xD8\xFF\xDB").force_encoding('ASCII-8BIT') => 'jpeg',
                          (+"\xFF\xD8\xFF\xE1").force_encoding('ASCII-8BIT') => 'jpeg',
                          (+"\x89PNG\r\n\x1A\n").force_encoding('ASCII-8BIT') => 'png',
                          '<svg' => 'svg+xml', # %%% Not yet very good detection for SVG
                          (+'BM').force_encoding('ASCII-8BIT') => 'bmp',
                          (+'GIF87a').force_encoding('ASCII-8BIT') => 'gif',
                          (+'GIF89a').force_encoding('ASCII-8BIT') => 'gif' }

  if val[0..1] == "\x15\x1C" # One of those goofy Microsoft OLE containers?
    package_header_length = val[2..3].bytes.reverse.inject(0) {|m, b| (m << 8) + b }
    # This will often be just FF FF FF FF
    # object_size = val[16..19].bytes.reverse.inject(0) {|m, b| (m << 8) + b }
    friendly_and_class_names = val[20...package_header_length].split("\0")
    object_type_name_length = val[package_header_length + 8..package_header_length+11].bytes.reverse.inject(0) {|m, b| (m << 8) + b }
    friendly_and_class_names << val[package_header_length + 12...package_header_length + 12 + object_type_name_length].strip
    # friendly_and_class_names will now be something like:  ['Bitmap Image', 'Paint.Picture', 'PBrush']
    real_object_size = val[package_header_length + 20 + object_type_name_length..package_header_length + 23 + object_type_name_length].bytes.reverse.inject(0) {|m, b| (m << 8) + b }
    object_start = package_header_length + 24 + object_type_name_length
    val = val[object_start...object_start + real_object_size]
  end

  if ((signature = @image_signatures.find { |k, _v| val[0...k.length] == k }&.last) ||
      (val[0..3] == 'RIFF' && val[8..11] == 'WEBP' && binding.local_variable_set(:signature, 'webp'))) &&
     val.length < max_size
    "<img src=\"data:image/#{signature.last};base64,#{Base64.encode64(val)}\">"
  else
    "&lt;&nbsp;#{signature ? "#{signature} image" : 'Binary'}, #{val.length} bytes&nbsp;>"
  end
end

.display_value(col_type, val, lat_lng = nil) ⇒ Object

Low-level way to render read-only data for a field based on its data type. Used by both brick_grid and brick_form_for (which gets down to this low-level implementation from brick_field).



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/brick/rails.rb', line 11

def display_value(col_type, val, lat_lng = nil)
  is_mssql_geography = nil
  # Some binary thing that really looks like a Microsoft-encoded WGS84 point?  (With the first two bytes, E6 10, indicating an EPSG code of 4326)
  if col_type == :binary && val && ::Brick.is_geography?(val)
    col_type = 'geography'
    is_mssql_geography = true
  end
  case col_type
  when 'geometry', 'geography'
    if Object.const_defined?('RGeo')
      @is_mysql = ['Mysql2', 'Trilogy'].include?(ActiveRecord::Base.connection.adapter_name) if @is_mysql.nil?
      @is_mssql = ActiveRecord::Base.connection.adapter_name == 'SQLServer' if @is_mssql.nil?
      val_err = nil

      if @is_mysql || (is_mssql_geography ||=
                        (@is_mssql ||
                          (val && ::Brick.is_geography?(val))
                        )
                      )
        # MySQL's \"Internal Geometry Format\" and MSSQL's Geography are like WKB, but with an initial 4 bytes that indicates the SRID.
        if (srid = val&.[](0..3)&.unpack('I'))
          val = val.dup.force_encoding('BINARY')[4..-1].bytes

          # MSSQL spatial bitwise flags, often 0C for a point:
          # xxxx xxx1 = HasZValues
          # xxxx xx1x = HasMValues
          # xxxx x1xx = IsValid
          # xxxx 1xxx = IsSinglePoint
          # xxx1 xxxx = IsSingleLineSegment
          # xx1x xxxx = IsWholeGlobe
          # Convert Microsoft's unique geography binary to standard WKB
          # (MSSQL point usually has two doubles, lng / lat, and can also have Z)
          if is_mssql_geography
            if val[0] == 1 && (val[1] & 8 > 0) && # Single point?
               (val.length - 2) % 8 == 0 && val.length < 27 # And containing up to three 8-byte values?
              val = [0, 0, 0, 0, 1] + val[2..-1].reverse
            else
              val_err = '(Microsoft internal SQL geography type)'
            end
          end
        end
      end
      unless val_err || val.nil?
        val = if ((geometry = RGeo::WKRep::WKBParser.new.parse(val.pack('c*'))).is_a?(RGeo::Cartesian::PointImpl) ||
                  geometry.is_a?(RGeo::Geos::CAPIPointImpl)) &&
                 !(geometry.y == 0.0 && geometry.x == 0.0)
                # Create a POINT link to this style of Google maps URL:  https://www.google.com/maps/place/38.7071296+-121.2810649/@38.7071296,-121.2810649,12z
                "<a href=\"https://www.google.com/maps/place/#{geometry.y}+#{geometry.x}/@#{geometry.y},#{geometry.x},12z\" target=\"blank\">#{geometry.to_s}</a>"
              end
      end
      val_err || val
    else
      '(Add RGeo gem to parse geometry detail)'
    end
  when :binary
    ::Brick::Rails.display_binary(val)
  else
    if col_type
      if lat_lng && !(lat_lng.first.zero? && lat_lng.last.zero?)
        # Create a link to this style of Google maps URL:  https://www.google.com/maps/place/38.7071296+-121.2810649/@38.7071296,-121.2810649,12z
        "<a href=\"https://www.google.com/maps/place/#{lat_lng.first}+#{lat_lng.last}/@#{lat_lng.first},#{lat_lng.last},12z\" target=\"blank\">#{val}</a>"
      elsif val.is_a?(Numeric) && ::ActiveSupport.const_defined?(:NumberHelper)
        ::ActiveSupport::NumberHelper.number_to_delimited(val, delimiter: ',')
      else # Text or HTML based content
        ::Brick::Rails.hide_bcrypt(val, col_type == :xml)
      end
    else # Don't take chances if we can't figure out the data type
      '?'
    end
  end
end

.erd_markup(model, prefix) ⇒ Object

Generate MermaidJS markup to create a partial ERD for this model



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/brick/rails.rb', line 119

def erd_markup(model, prefix)
  model_short_name = model.name.split('::').last
  "<div id=\"mermaidErd\">
  <div id=\"mermaidDiagram\" class=\"mermaid\">
erDiagram
<% shown_classes = {}

   def erd_sidelinks(shown_classes, klass)
 links = []
 # %%% Not yet showing these as they can get just a bit intense!
 # klass.reflect_on_all_associations.select { |a| shown_classes.key?(a.klass) }.each do |assoc|
 #   unless shown_classes[assoc.klass].key?(klass.name)
 #     links << \"    #\{klass.name.split('::').last} #\{assoc.macro == :belongs_to ? '}o--||' : '||--o{'} #\{assoc.klass.name.split('::').last} : \\\"\\\"\"n\"
 #     shown_classes[assoc.klass][klass.name] = nil
 #   end
 # end
 # shown_classes[klass] ||= {}
 links.join
   end

   @_brick_bt_descrip&.each do |bt|
 bt_class = bt[1].first.first
 callbacks[bt_name = bt_class.name.split('::').last] = bt_class
 # Used to have:  &.inverse_of  before  &.macro
 is_has_one = #{model.name}.reflect_on_association(bt.first)&.macro == :has_one ||
              ::Brick.config.has_ones&.fetch('#{model.name}', nil)&.key?(bt.first.to_s)
%>  <%= \"#{model_short_name} #\{is_has_one ? '||--o|' : '}o--||'} #\{bt_name} : \\\"#\{
    bt_underscored = bt[1].first.first.name.underscore.singularize
    bt.first unless bt.first.to_s == bt_underscored.split('/').last # Was:  bt_underscored.tr('/', '_')
    }\\\"\".html_safe %>
<%=  erd_sidelinks(shown_classes, bt_class).html_safe %>
<% end
   last_hm = nil
   @_brick_hm_counts&.each do |hm|
 # Skip showing self-referencing HM links since they would have already been drawn while evaluating the BT side
 next if (hm_class = hm.last&.klass) == #{model.name}

 callbacks[hm_name = hm_class.name.split('::').last] = hm_class
 if (through = hm.last.options[:through]&.to_s) # has_many :through  (HMT)
   through_name = (through_assoc = hm.last.source_reflection).active_record.name.split('::').last
   callbacks[through_name] = through_assoc.active_record
   if last_hm == through # Same HM, so no need to build it again, and for clarity just put in a blank line
%><%=    \"\n\"
%><%   else
%>  <%= \"#{model_short_name} ||--o{ #\{through_name}\".html_safe %> : \"\"
<%=      erd_sidelinks(shown_classes, through_assoc.active_record).html_safe %>
<%       last_hm = through
   end
%>    <%= \"#\{through_name} }o--|| #\{hm_name}\".html_safe %> : \"\"
<%= \"#{model_short_name} }o..o{ #\{hm_name} : \\\"#\{hm.first}\\\"\".html_safe %><%
 else # has_many
%>  <%= \"#{model_short_name} ||--o{ #\{hm_name} : \\\"#\{
        hm.first.to_s unless (last_hm = hm.first.to_s).downcase == hm_class.name.underscore.pluralize.tr('/', '_')
      }\\\"\".html_safe %><%
 end %>
<%=  erd_sidelinks(shown_classes, hm_class).html_safe %>
<% end
   def dt_lookup(dt)
 { 'integer' => 'int', 'character varying' => 'varchar', 'double precision' => 'float',
   'timestamp without time zone' => 'timestamp',
   'timestamp with time zone' => 'timestamp',
   'time without time zone' => 'time',
   'time with time zone' => 'time' }[dt] || dt&.tr(' ', '_') || 'int'
   end
   callbacks.merge({#{model_short_name.inspect} => #{model.name}}).each do |cb_k, cb_class|
 cb_relation = ::Brick.relations[cb_class.table_name]
 pkeys = cb_relation[:pkey]&.first&.last
 fkeys = cb_relation[:fks]&.values&.each_with_object([]) { |fk, s| s << fk[:fk] if fk.fetch(:is_bt, nil) }
 cols = cb_relation[:cols]
 %>  <%= cb_k %> {<%
 pkeys&.each do |pk| %>
<%= \"#\{dt_lookup(cols[pk].first)} #\{pk} \\\"PK#\{' fk' if fkeys&.include?(pk)}\\\"\".html_safe %><%
 end %><%
 fkeys&.each do |fk|
   if fk.is_a?(Array)
     fk.each do |fk_part| %>
<%= \"#\{dt_lookup(cols[fk_part].first)} #\{fk_part} \\\"&nbsp;&nbsp;&nbsp;&nbsp;fk\\\"\".html_safe unless pkeys&.include?(fk_part) %><%
     end
   else # %%% Does not yet accommodate polymorphic BTs
%>
<%= \"#\{dt_lookup(cols[fk]&.first)} #\{fk} \\\"&nbsp;&nbsp;&nbsp;&nbsp;fk\\\"\".html_safe unless pkeys&.include?(fk) %><%
   end
 end %><%
 if (erd_sc = Brick.config.erd_show_columns) == true || erd_sc&.include?(cb_class.name)
   cols&.each do |col|
     next if pkeys.include?(col.first) || fkeys.include?(col.first) %>
<%= \"#\{dt_lookup(col[1]&.first&.to_s)} #\{col.first}\".html_safe %><%
   end
 end %>
  }
<% end
 # callback < %= cb_k % > erdClick
 %>
  </div>#{
 add_column = false # For the moment, disable all schema modification things
 "<%= brick_add_column(#{model.name}, #{prefix.inspect}).html_safe %>" unless add_column == false}
</div>
"
end

.hide_bcrypt(val, is_xml = nil, max_len = 200) ⇒ Object

Render text or HTML without exposing password details



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/brick/rails.rb', line 220

def hide_bcrypt(val, is_xml = nil, max_len = 200)
  if ::Brick::Rails.is_bcrypt?(val)
    '(hidden)'
  else
    if val.is_a?(String)
      return ::Brick::Rails.display_binary(val) unless (val_utf8 = val.dup.force_encoding('UTF-8')).valid_encoding?

      val = val_utf8.strip
      return CGI.escapeHTML(val) if is_xml

      if val.length > max_len
        if val[0] == '<' # Seems to be HTML?
          cur_len = 0
          cur_idx = 0
          # Find which HTML tags we might be inside so we can apply ending tags to balance
          element_name = nil
          in_closing = nil
          elements = []
          val.each_char do |ch|
            case ch
            when '<'
              element_name = +''
            when '/' # First character of tag is '/'?
              in_closing = true if element_name == ''
            when '>'
              if element_name
                if in_closing
                  if (idx = elements.index { |tag| tag.downcase == element_name.downcase })
                    elements.delete_at(idx)
                  end
                elsif (tag_name = element_name.split.first).present?
                  elements.unshift(tag_name)
                end
                element_name = nil
                in_closing = nil
              end
            else
              element_name << ch if element_name
            end
            cur_idx += 1
            # Unless it's inside wickets then this is real text content, and see if we're at the limit
            break if element_name.nil? && ((cur_len += 1) > max_len)
          end
          val = val[0..cur_idx]
          # Somehow still in the middle of an opening tag right at the end? (Should never happen)
          if !in_closing && (tag_name = element_name&.split&.first)&.present?
            elements.unshift(tag_name)
            val << '>'
          end
          elements.each do |closing_tag|
            val << "</#{closing_tag}>"
          end
        else # Not HTML, just cut it at the length
          val = val[0...max_len]
        end
        val = "#{val}..."
      end
      val
    else
      val.to_s
    end
  end
end

.is_bcrypt?(val) ⇒ Boolean

Password type data?

Returns:

  • (Boolean)


285
286
287
# File 'lib/brick/rails.rb', line 285

def is_bcrypt?(val)
  val.is_a?(String) && val.length == 60 && val.start_with?('$2a$')
end