uchi 0.1.0 → 0.1.3
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/.github/dependabot.yml +17 -0
- data/.github/workflows/build.yml +23 -0
- data/.github/workflows/lint.yml +30 -0
- data/CHANGELOG.md +29 -0
- data/docs/fields.md +82 -0
- data/docs/repositories.md +63 -0
- data/package.json +31 -0
- data/test/components/uchi/field/belongs_to_test.rb +134 -0
- data/test/components/uchi/field/blank_test.rb +119 -0
- data/test/components/uchi/field/boolean_test.rb +163 -0
- data/test/components/uchi/field/date_test.rb +163 -0
- data/test/components/uchi/field/date_time_test.rb +152 -0
- data/test/components/uchi/field/has_and_belongs_to_many_test.rb +144 -0
- data/test/components/uchi/field/has_many_test.rb +138 -0
- data/test/components/uchi/field/id_test.rb +113 -0
- data/test/components/uchi/field/number_test.rb +163 -0
- data/test/components/uchi/field/string_test.rb +159 -0
- data/test/components/uchi/field/text_test.rb +160 -0
- data/test/components/uchi/ui/form/input/collection_checkboxes_test.rb +171 -0
- data/test/controllers/uchi/authors_controller_test.rb +120 -0
- data/test/controllers/uchi/repository_controller_test.rb +93 -0
- data/test/controllers/uchi/scoped_repository_controller_test.rb +73 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +4 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/uchi/authors_controller.rb +7 -0
- data/test/dummy/app/controllers/uchi/books_controller.rb +7 -0
- data/test/dummy/app/controllers/uchi/titles_controller.rb +7 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +7 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/application_record.rb +3 -0
- data/test/dummy/app/models/author.rb +5 -0
- data/test/dummy/app/models/book.rb +4 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/models/title.rb +3 -0
- data/test/dummy/app/uchi/repositories/author.rb +20 -0
- data/test/dummy/app/uchi/repositories/book.rb +16 -0
- data/test/dummy/app/uchi/repositories/title.rb +17 -0
- data/test/dummy/app/views/layouts/application.html.erb +27 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/app/views/pwa/manifest.json.erb +22 -0
- data/test/dummy/app/views/pwa/service-worker.js +26 -0
- data/test/dummy/bin/dev +2 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +34 -0
- data/test/dummy/config/application.rb +29 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/database.yml +32 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +69 -0
- data/test/dummy/config/environments/production.rb +89 -0
- data/test/dummy/config/environments/test.rb +53 -0
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +8 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/locales/da.yml +52 -0
- data/test/dummy/config/locales/en.yml +31 -0
- data/test/dummy/config/puma.rb +38 -0
- data/test/dummy/config/routes.rb +9 -0
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/config.ru +6 -0
- data/test/dummy/db/migrate/20251002183635_create_authors.rb +11 -0
- data/test/dummy/db/migrate/20251005131726_create_books.rb +9 -0
- data/test/dummy/db/migrate/20251005131811_create_titles.rb +11 -0
- data/test/dummy/db/migrate/20251031140958_add_author_books_join_table.rb +9 -0
- data/test/dummy/db/schema.rb +44 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/400.html +114 -0
- data/test/dummy/public/404.html +114 -0
- data/test/dummy/public/406-unsupported-browser.html +114 -0
- data/test/dummy/public/422.html +114 -0
- data/test/dummy/public/500.html +114 -0
- data/test/dummy/public/icon.png +0 -0
- data/test/dummy/public/icon.svg +3 -0
- data/test/dummy/storage/.keep +0 -0
- data/test/dummy/test/fixtures/authors.yml +11 -0
- data/test/dummy/test/models/author_test.rb +7 -0
- data/test/dummy/tmp/.keep +0 -0
- data/test/dummy/tmp/pids/.keep +0 -0
- data/test/dummy/tmp/storage/.keep +0 -0
- data/test/test_helper.rb +15 -0
- data/test/uchi/field_test.rb +77 -0
- data/test/uchi/i18n_test.rb +18 -0
- data/test/uchi/repository/routes_test.rb +49 -0
- data/test/uchi/repository/translate_test.rb +272 -0
- data/test/uchi/repository_test.rb +137 -0
- data/test/uchi/sort_order_test.rb +47 -0
- data/test/uchi_test.rb +7 -0
- metadata +147 -10
- data/README.md +0 -35
- data/Rakefile +0 -6
- data/lib/uchi/version.rb +0 -5
- data/lib/uchi.rb +0 -8
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
|
|
7
|
+
<title>The change you wanted was rejected (422 Unprocessable Entity)</title>
|
|
8
|
+
|
|
9
|
+
<meta charset="utf-8">
|
|
10
|
+
<meta name="viewport" content="initial-scale=1, width=device-width">
|
|
11
|
+
<meta name="robots" content="noindex, nofollow">
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
|
|
15
|
+
*, *::before, *::after {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
* {
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
html {
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
background: #FFF;
|
|
29
|
+
color: #261B23;
|
|
30
|
+
display: grid;
|
|
31
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
32
|
+
font-size: clamp(1rem, 2.5vw, 2rem);
|
|
33
|
+
-webkit-font-smoothing: antialiased;
|
|
34
|
+
font-style: normal;
|
|
35
|
+
font-weight: 400;
|
|
36
|
+
letter-spacing: -0.0025em;
|
|
37
|
+
line-height: 1.4;
|
|
38
|
+
min-height: 100vh;
|
|
39
|
+
place-items: center;
|
|
40
|
+
text-rendering: optimizeLegibility;
|
|
41
|
+
-webkit-text-size-adjust: 100%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
a {
|
|
45
|
+
color: inherit;
|
|
46
|
+
font-weight: 700;
|
|
47
|
+
text-decoration: underline;
|
|
48
|
+
text-underline-offset: 0.0925em;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
b, strong {
|
|
52
|
+
font-weight: 700;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
i, em {
|
|
56
|
+
font-style: italic;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
main {
|
|
60
|
+
display: grid;
|
|
61
|
+
gap: 1em;
|
|
62
|
+
padding: 2em;
|
|
63
|
+
place-items: center;
|
|
64
|
+
text-align: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
main header {
|
|
68
|
+
width: min(100%, 12em);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
main header svg {
|
|
72
|
+
height: auto;
|
|
73
|
+
max-width: 100%;
|
|
74
|
+
width: 100%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
main article {
|
|
78
|
+
width: min(100%, 30em);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
main article p {
|
|
82
|
+
font-size: 75%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
main article br {
|
|
86
|
+
|
|
87
|
+
display: none;
|
|
88
|
+
|
|
89
|
+
@media(min-width: 48em) {
|
|
90
|
+
display: inline;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
</style>
|
|
96
|
+
|
|
97
|
+
</head>
|
|
98
|
+
|
|
99
|
+
<body>
|
|
100
|
+
|
|
101
|
+
<!-- This file lives in public/422.html -->
|
|
102
|
+
|
|
103
|
+
<main>
|
|
104
|
+
<header>
|
|
105
|
+
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm130.453 51.63681c0-8.9215-6.218-15.4099-15.681-15.4099-10.273 0-15.95 7.5698-16.491 16.4913h-44.608c3.244-30.8199 25.683-55.421707 61.099-55.421707 36.498 0 59.477 20.816907 59.477 51.636807 0 21.3577-14.869 36.7676-31.901 52.7186l-27.305 27.035h59.747v37.308h-120.306v-27.846l57.044-56.7736c11.084-11.8954 18.925-20.0059 18.925-29.7385zm140.455 0c0-8.9215-6.218-15.4099-15.68-15.4099-10.274 0-15.951 7.5698-16.492 16.4913h-44.608c3.245-30.8199 25.684-55.421707 61.1-55.421707 36.497 0 59.477 20.816907 59.477 51.636807 0 21.3577-14.87 36.7676-31.902 52.7186l-27.305 27.035h59.747v37.308h-120.305v-27.846l57.043-56.7736c11.085-11.8954 18.925-20.0059 18.925-29.7385z" fill="#f0eff0"/><path d="m19.3936 103.554c-8.9715 0-14.84183-5.0952-14.84183-14.4544v-20.1029h8.86083v19.3276c0 4.8181 2.2706 7.3102 5.981 7.3102 3.6551 0 5.9257-2.4921 5.9257-7.3102v-19.3276h8.8608v20.1583c0 9.3038-5.8149 14.399-14.7865 14.399zm18.734-.554v-24.921h8.6947v2.1598c1.3845-1.5506 3.8212-2.7136 6.701-2.7136 5.538 0 8.8054 3.5997 8.8054 9.1377v16.3371h-8.6393v-14.2327c0-2.049-1.0522-3.5443-3.2674-3.5443-1.7168 0-3.1567.9969-3.5997 2.7136v15.0634zm36.8584-1.994v10.799h-8.6946v-33.726h8.6946v1.9937c1.163-1.3291 3.5997-2.5475 6.1472-2.5475 7.1994 0 11.1314 5.8703 11.1314 13.0143 0 7.0886-3.932 13.0145-11.1314 13.0145-2.5475 0-4.9842-1.219-6.1472-2.548zm0-13.7893v6.5902c.6646 1.3845 2.1599 2.326 3.8213 2.326 2.9905 0 4.7626-2.3814 4.7626-5.5934s-1.7721-5.6488-4.7626-5.6488c-1.7168 0-3.1567.9969-3.8213 2.326zm36.789-9.2485v8.3624c-1.052-.5538-2.215-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.6949v-24.921h8.6949v2.2152c1.218-1.6614 3.156-2.769 5.648-2.769 1.108 0 1.994.2215 2.382.443zm26.769 12.5713c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.528 0c0-3.4336-1.496-5.8703-4.209-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.209-2.3813 4.209-5.8149zm10.352 0c0-7.6978 5.095-13.0143 12.571-13.0143 6.701 0 10.855 3.9874 11.574 9.8023h-8.417c-.222-1.4953-1.385-2.6029-3.157-2.6029-2.437 0-3.987 2.2706-3.987 5.8149s1.55 5.7595 3.987 5.7595c1.772 0 2.935-1.0522 3.157-2.5475h8.417c-.719 5.7596-4.873 9.8025-11.574 9.8025-7.476 0-12.571-5.3167-12.571-13.0145zm42.013 3.7658h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.516-13.0143 7.642 0 11.962 5.095 11.962 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.434 1.2737-3.988 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.544-3.5997zm13.428 11.0206h8.473c.387 1.3845 1.606 2.1598 3.156 2.1598 1.44 0 2.548-.5538 2.548-1.7168 0-.9414-.72-1.2737-1.938-1.5506l-4.874-.9969c-4.153-.886-6.867-2.8797-6.867-7.2547 0-5.3165 4.763-8.4178 10.633-8.4178 6.812 0 10.522 3.1567 11.297 8.0855h-8.03c-.277-1.0522-1.052-1.9937-3.046-1.9937-1.273 0-2.326.5538-2.326 1.6614 0 .7753.554 1.163 1.717 1.3845l4.929 1.163c4.541 1.0522 6.978 3.4335 6.978 7.4763 0 5.3168-4.818 8.2518-10.91 8.2518-6.369 0-10.965-2.88-11.74-8.2518zm24.269 0h8.474c.387 1.3845 1.606 2.1598 3.156 2.1598 1.44 0 2.548-.5538 2.548-1.7168 0-.9414-.72-1.2737-1.939-1.5506l-4.873-.9969c-4.154-.886-6.867-2.8797-6.867-7.2547 0-5.3165 4.763-8.4178 10.633-8.4178 6.812 0 10.522 3.1567 11.297 8.0855h-8.03c-.277-1.0522-1.052-1.9937-3.046-1.9937-1.273 0-2.326.5538-2.326 1.6614 0 .7753.554 1.163 1.717 1.3845l4.929 1.163c4.541 1.0522 6.978 3.4335 6.978 7.4763 0 5.3168-4.818 8.2518-10.91 8.2518-6.369 0-10.965-2.88-11.741-8.2518zm47.918 7.6978h-8.363v-1.274c-.831.831-3.323 1.717-5.981 1.717-4.929 0-9.082-2.769-9.082-8.0301 0-4.818 4.153-7.9193 9.581-7.9193 2.049 0 4.485.6646 5.482 1.3845v-1.606c0-1.606-.941-2.9905-3.046-2.9905-1.606 0-2.547.7199-2.935 1.8275h-8.196c.72-4.8181 4.984-8.6393 11.408-8.6393 7.089 0 11.132 3.7659 11.132 10.2453zm-8.363-6.9779v-1.4399c-.554-1.0522-2.049-1.7167-3.655-1.7167-1.717 0-3.434.7199-3.434 2.3813 0 1.7168 1.717 2.4367 3.434 2.4367 1.606 0 3.101-.6645 3.655-1.6614zm20.742 4.9839v1.994h-8.695v-35.997h8.695v13.0697c1.163-1.3291 3.6-2.5475 6.147-2.5475 7.2 0 11.132 5.8149 11.132 13.0143s-3.932 13.0145-11.132 13.0145c-2.547 0-4.984-1.219-6.147-2.548zm0-13.7893v6.5902c.665 1.3845 2.105 2.326 3.821 2.326 2.991 0 4.763-2.3814 4.763-5.5934s-1.772-5.6488-4.763-5.6488c-1.661 0-3.156.9969-3.821 2.326zm28.759-20.2137v35.997h-8.695v-35.997zm19.172 27.3023h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm25.461-15.2849h24.311v7.6424h-15.561v5.3165h14.232v7.4763h-14.232v5.8703h15.561v7.6978h-24.311zm27.942 34.0033v-24.921h8.694v2.1598c1.385-1.5506 3.822-2.7136 6.701-2.7136 5.538 0 8.806 3.5997 8.806 9.1377v16.3371h-8.639v-14.2327c0-2.049-1.053-3.5443-3.268-3.5443-1.717 0-3.157.9969-3.6 2.7136v15.0634zm29.991-8.5839v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.206v6.7564h-5.206v8.307c0 1.9383.941 2.769 2.658 2.769.942 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm26.161-16.3371v24.921h-8.694v-24.921zm.61-6.7564c0 2.8244-2.271 4.652-4.929 4.652s-4.929-1.8276-4.929-4.652c0-2.8797 2.271-4.7073 4.929-4.7073s4.929 1.8276 4.929 4.7073zm5.382 23.0935v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.206v6.7564h-5.206v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm29.22 17.3889h-8.584l3.655-9.414-9.303-24.312h9.026l4.763 14.1773 4.652-14.1773h8.639z" fill="#d30001"/></svg>
|
|
106
|
+
</header>
|
|
107
|
+
<article>
|
|
108
|
+
<p><strong>The change you wanted was rejected.</strong> Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.</p>
|
|
109
|
+
</article>
|
|
110
|
+
</main>
|
|
111
|
+
|
|
112
|
+
</body>
|
|
113
|
+
|
|
114
|
+
</html>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
|
|
7
|
+
<title>We’re sorry, but something went wrong (500 Internal Server Error)</title>
|
|
8
|
+
|
|
9
|
+
<meta charset="utf-8">
|
|
10
|
+
<meta name="viewport" content="initial-scale=1, width=device-width">
|
|
11
|
+
<meta name="robots" content="noindex, nofollow">
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
|
|
15
|
+
*, *::before, *::after {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
* {
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
html {
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
background: #FFF;
|
|
29
|
+
color: #261B23;
|
|
30
|
+
display: grid;
|
|
31
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
32
|
+
font-size: clamp(1rem, 2.5vw, 2rem);
|
|
33
|
+
-webkit-font-smoothing: antialiased;
|
|
34
|
+
font-style: normal;
|
|
35
|
+
font-weight: 400;
|
|
36
|
+
letter-spacing: -0.0025em;
|
|
37
|
+
line-height: 1.4;
|
|
38
|
+
min-height: 100vh;
|
|
39
|
+
place-items: center;
|
|
40
|
+
text-rendering: optimizeLegibility;
|
|
41
|
+
-webkit-text-size-adjust: 100%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
a {
|
|
45
|
+
color: inherit;
|
|
46
|
+
font-weight: 700;
|
|
47
|
+
text-decoration: underline;
|
|
48
|
+
text-underline-offset: 0.0925em;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
b, strong {
|
|
52
|
+
font-weight: 700;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
i, em {
|
|
56
|
+
font-style: italic;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
main {
|
|
60
|
+
display: grid;
|
|
61
|
+
gap: 1em;
|
|
62
|
+
padding: 2em;
|
|
63
|
+
place-items: center;
|
|
64
|
+
text-align: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
main header {
|
|
68
|
+
width: min(100%, 12em);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
main header svg {
|
|
72
|
+
height: auto;
|
|
73
|
+
max-width: 100%;
|
|
74
|
+
width: 100%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
main article {
|
|
78
|
+
width: min(100%, 30em);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
main article p {
|
|
82
|
+
font-size: 75%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
main article br {
|
|
86
|
+
|
|
87
|
+
display: none;
|
|
88
|
+
|
|
89
|
+
@media(min-width: 48em) {
|
|
90
|
+
display: inline;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
</style>
|
|
96
|
+
|
|
97
|
+
</head>
|
|
98
|
+
|
|
99
|
+
<body>
|
|
100
|
+
|
|
101
|
+
<!-- This file lives in public/500.html -->
|
|
102
|
+
|
|
103
|
+
<main>
|
|
104
|
+
<header>
|
|
105
|
+
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m101.23 93.8427c-8.1103 0-15.4098 3.7849-19.7354 8.3813h-36.2269v-99.21891h103.8143v37.03791h-68.3984v24.8722c5.1366-2.7035 15.1396-5.9477 24.6014-5.9477 35.146 0 56.233 22.7094 56.233 55.4215 0 34.605-23.791 57.315-60.558 57.315-37.8492 0-61.64-22.169-63.8028-55.963h42.9857c1.0814 10.814 9.1919 19.195 21.6281 19.195 11.355 0 19.465-8.381 19.465-20.547 0-11.625-7.299-20.5463-20.006-20.5463zm138.833 77.8613c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm140.456 133.2831c-40.823 0-64.884-35.146-64.884-85.7015 0-50.5554 24.061-85.700907 64.884-85.700907 40.822 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.062 85.7015-64.884 85.7015zm0-133.2831c-17.573 0-22.71 21.8984-22.71 47.5816 0 25.6835 5.137 47.5815 22.71 47.5815 17.302 0 22.709-21.898 22.709-47.5815 0-25.6832-5.407-47.5816-22.709-47.5816z" fill="#f0eff0"/><path d="m23.1377 68.9967v34.0033h-8.9162v-34.0033zm4.3157 34.0033v-24.921h8.6947v2.1598c1.3845-1.5506 3.8212-2.7136 6.701-2.7136 5.538 0 8.8054 3.5997 8.8054 9.1377v16.3371h-8.6393v-14.2327c0-2.049-1.0522-3.5443-3.2674-3.5443-1.7168 0-3.1567.9969-3.5997 2.7136v15.0634zm29.9913-8.5839v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.5839v6.8671h5.2058v6.7564h-5.2058v8.307c0 1.9383.9415 2.769 2.6583 2.769.9414 0 1.9937-.2216 2.769-.5538v7.3654c-.9969.443-2.8798.775-4.8181.775-5.8703 0-9.1931-2.769-9.1931-9.0819zm32.3666-.1108h8.0301c-.8861 5.7597-5.2057 9.2487-11.6852 9.2487-7.6424 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.3165-13.0143 12.5159-13.0143 7.6424 0 11.9621 5.095 11.9621 12.5159v2.1598h-16.1156c.2769 2.9905 1.8275 4.5965 4.3196 4.5965 1.7722 0 3.1567-.7753 3.6551-2.4921zm-3.8212-10.0237c-2.0491 0-3.4336 1.2737-3.9874 3.5997h7.5317c-.1107-2.0491-1.3845-3.5997-3.5443-3.5997zm31.4299-6.3134v8.3624c-1.052-.5538-2.215-.7753-3.599-.7753-2.382 0-3.988 1.0522-4.431 2.8244v14.6203h-8.694v-24.921h8.694v2.2152c1.219-1.6614 3.157-2.769 5.649-2.769 1.108 0 1.994.2215 2.381.443zm2.949 25.0318v-24.921h8.694v2.1598c1.385-1.5506 3.821-2.7136 6.701-2.7136 5.538 0 8.806 3.5997 8.806 9.1377v16.3371h-8.64v-14.2327c0-2.049-1.052-3.5443-3.267-3.5443-1.717 0-3.157.9969-3.6 2.7136v15.0634zm50.371 0h-8.363v-1.274c-.83.831-3.323 1.717-5.981 1.717-4.929 0-9.082-2.769-9.082-8.0301 0-4.818 4.153-7.9193 9.581-7.9193 2.049 0 4.485.6646 5.482 1.3845v-1.606c0-1.606-.941-2.9905-3.046-2.9905-1.606 0-2.547.7199-2.935 1.8275h-8.196c.72-4.8181 4.984-8.6393 11.408-8.6393 7.089 0 11.132 3.7659 11.132 10.2453zm-8.363-6.9779v-1.4399c-.554-1.0522-2.049-1.7167-3.655-1.7167-1.717 0-3.433.7199-3.433 2.3813 0 1.7168 1.716 2.4367 3.433 2.4367 1.606 0 3.101-.6645 3.655-1.6614zm20.742-29.0191v35.997h-8.694v-35.997zm13.036 25.9178h9.248c.72 2.326 2.714 3.489 5.483 3.489 2.713 0 4.596-1.163 4.596-3.2674 0-1.6061-1.052-2.326-3.212-2.8244l-6.534-1.3845c-4.985-1.1076-8.751-3.7105-8.751-9.47 0-6.6456 5.538-11.0206 13.07-11.0206 8.307 0 13.014 4.5411 13.956 10.4114h-8.695c-.72-1.8829-2.27-3.3228-5.205-3.3228-2.548 0-4.265 1.1076-4.265 2.9905 0 1.4953 1.052 2.326 2.825 2.7137l6.645 1.5506c5.815 1.3845 9.027 4.5412 9.027 9.8023 0 6.9778-5.87 10.9654-13.291 10.9654-8.141 0-13.679-3.9322-14.897-10.6332zm46.509 1.3845h8.031c-.887 5.7597-5.206 9.2487-11.686 9.2487-7.642 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.317-13.0143 12.516-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.319 4.5965 1.773 0 3.157-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm31.431-6.3134v8.3624c-1.053-.5538-2.216-.7753-3.6-.7753-2.381 0-3.988 1.0522-4.431 2.8244v14.6203h-8.694v-24.921h8.694v2.2152c1.219-1.6614 3.157-2.769 5.649-2.769 1.108 0 1.994.2215 2.382.443zm18.288 25.0318h-7.809l-9.47-24.921h8.861l4.763 14.288 4.652-14.288h8.528zm25.614-8.6947h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.642 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.516-13.0143 7.642 0 11.962 5.095 11.962 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.157-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.434 1.2737-3.988 3.5997h7.532c-.111-2.0491-1.384-3.5997-3.544-3.5997zm31.43-6.3134v8.3624c-1.052-.5538-2.215-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.695v-24.921h8.695v2.2152c1.218-1.6614 3.157-2.769 5.649-2.769 1.107 0 1.993.2215 2.381.443zm13.703-8.9715h24.312v7.6424h-15.562v5.3165h14.232v7.4763h-14.232v5.8703h15.562v7.6978h-24.312zm44.667 8.9715v8.3624c-1.052-.5538-2.215-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.695v-24.921h8.695v2.2152c1.218-1.6614 3.156-2.769 5.648-2.769 1.108 0 1.994.2215 2.382.443zm19.673 0v8.3624c-1.053-.5538-2.216-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.695v-24.921h8.695v2.2152c1.218-1.6614 3.156-2.769 5.648-2.769 1.108 0 1.994.2215 2.382.443zm26.769 12.5713c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.529 0c0-3.4336-1.495-5.8703-4.208-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.208-2.3813 4.208-5.8149zm28.082-12.5713v8.3624c-1.052-.5538-2.215-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.695v-24.921h8.695v2.2152c1.218-1.6614 3.157-2.769 5.649-2.769 1.107 0 1.993.2215 2.381.443z" fill="#d30001"/></svg>
|
|
106
|
+
</header>
|
|
107
|
+
<article>
|
|
108
|
+
<p><strong>We’re sorry, but something went wrong.</strong><br> If you’re the application owner check the logs for more information.</p>
|
|
109
|
+
</article>
|
|
110
|
+
</main>
|
|
111
|
+
|
|
112
|
+
</body>
|
|
113
|
+
|
|
114
|
+
</html>
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/test/test_helper.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Configure Rails Environment
|
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
|
3
|
+
|
|
4
|
+
require_relative "../test/dummy/config/environment"
|
|
5
|
+
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
|
|
6
|
+
ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__)
|
|
7
|
+
require "rails/test_help"
|
|
8
|
+
|
|
9
|
+
# Load fixtures from the engine
|
|
10
|
+
if ActiveSupport::TestCase.respond_to?(:fixture_paths=)
|
|
11
|
+
ActiveSupport::TestCase.fixture_paths = [File.expand_path("fixtures", __dir__)]
|
|
12
|
+
ActionDispatch::IntegrationTest.fixture_paths = ActiveSupport::TestCase.fixture_paths
|
|
13
|
+
ActiveSupport::TestCase.file_fixture_path = File.expand_path("fixtures", __dir__) + "/files"
|
|
14
|
+
ActiveSupport::TestCase.fixtures :all
|
|
15
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
require "test_helper"
|
|
2
|
+
require "ostruct"
|
|
3
|
+
|
|
4
|
+
class UchiFieldTest < ActiveSupport::TestCase
|
|
5
|
+
def setup
|
|
6
|
+
@field = Uchi::Field.new(:name)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
test "initializes with name" do
|
|
10
|
+
field = Uchi::Field.new(:title)
|
|
11
|
+
assert_equal :title, field.name
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "converts string name to symbol" do
|
|
15
|
+
field = Uchi::Field.new("title")
|
|
16
|
+
assert_equal :title, field.name
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
test "has default options" do
|
|
20
|
+
assert_equal [:edit, :index, :show], @field.on
|
|
21
|
+
assert_equal true, @field.sortable
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
test "#column_name returns humanized name" do
|
|
25
|
+
field = Uchi::Field.new(:first_name)
|
|
26
|
+
assert_equal "First name", field.column_name
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
test "#param_key returns name as symbol" do
|
|
30
|
+
assert_equal :name, @field.param_key
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
test "#permitted_param returns name as symbol" do
|
|
34
|
+
assert_equal :name, @field.permitted_param
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "#searchable? returns false by default" do
|
|
38
|
+
assert_not @field.searchable?
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
test "#searchable? returns true when explicitly set" do
|
|
42
|
+
field = Uchi::Field.new(:name).searchable(true)
|
|
43
|
+
assert field.searchable?
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
test "#searchable? returns default (false) when explicitly set to nil" do
|
|
47
|
+
field = Uchi::Field.new(:name).searchable(nil)
|
|
48
|
+
assert_not field.searchable?
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
test "#sortable? returns true by default" do
|
|
52
|
+
assert @field.sortable?
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
test "#sortable? returns false when explicitly set" do
|
|
56
|
+
field = Uchi::Field.new(:name).sortable(false)
|
|
57
|
+
assert_not field.sortable?
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
test "#sortable? returns default (true) when explicitly set to nil" do
|
|
61
|
+
field = Uchi::Field.new(:name).sortable(nil)
|
|
62
|
+
assert field.sortable?
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
test "#value uses reader to get value from record" do
|
|
66
|
+
record = OpenStruct.new(name: "Test Name")
|
|
67
|
+
assert_equal "Test Name", @field.value(record)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
test "#value uses custom reader when provided" do
|
|
71
|
+
custom_reader = ->(record, field_name) { "Custom: #{record.public_send(field_name)}" }
|
|
72
|
+
field = Uchi::Field.new(:name).reader(custom_reader)
|
|
73
|
+
record = OpenStruct.new(name: "Test")
|
|
74
|
+
|
|
75
|
+
assert_equal "Custom: Test", field.value(record)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require "test_helper"
|
|
2
|
+
|
|
3
|
+
class UchiI18nTest < ActiveSupport::TestCase
|
|
4
|
+
test "translate method delegates to I18n with uchi scope" do
|
|
5
|
+
# This should not raise an error
|
|
6
|
+
result = Uchi::I18n.translate("test_key", default: "fallback")
|
|
7
|
+
assert_equal "fallback", result
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
test "translate method accepts custom scope" do
|
|
11
|
+
result = Uchi::I18n.translate("test_key", scope: "custom", default: "fallback")
|
|
12
|
+
assert_equal "fallback", result
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
test "module responds to translate" do
|
|
16
|
+
assert Uchi::I18n.respond_to?(:translate)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require "test_helper"
|
|
2
|
+
require_relative "../../dummy/app/uchi/repositories/author"
|
|
3
|
+
|
|
4
|
+
class UchiRepositoryRoutesTest < ActiveSupport::TestCase
|
|
5
|
+
def setup
|
|
6
|
+
@repository = Uchi::Repositories::Author.new
|
|
7
|
+
@routes = @repository.routes
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
test "initializes with repository" do
|
|
11
|
+
assert_equal @repository, @routes.repository
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "#singular returns the singular route name" do
|
|
15
|
+
assert_equal "author", @routes.singular
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
test "#plural returns the plural route name" do
|
|
19
|
+
assert_equal "authors", @routes.plural
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
test "#path_for returns path to create action" do
|
|
23
|
+
assert_equal "/uchi/authors", @routes.path_for(:create)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
test "#path_for returns path to destroy action" do
|
|
27
|
+
assert_equal "/uchi/authors/1", @routes.path_for(:destroy, id: 1)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
test "#path_for returns path to edit action" do
|
|
31
|
+
assert_equal "/uchi/authors/1/edit", @routes.path_for(:edit, id: 1)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
test "#path_for returns path to index action" do
|
|
35
|
+
assert_equal "/uchi/authors", @routes.path_for(:index)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
test "#path_for returns path to new action" do
|
|
39
|
+
assert_equal "/uchi/authors/new", @routes.path_for(:new)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "#path_for returns path to show action" do
|
|
43
|
+
assert_equal "/uchi/authors/1", @routes.path_for(:show, id: 1)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
test "#path_for returns path to update action" do
|
|
47
|
+
assert_equal "/uchi/authors/1", @routes.path_for(:update, id: 1)
|
|
48
|
+
end
|
|
49
|
+
end
|