snf_core 0.2.8 → 0.2.92
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/MIT-LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/app/controllers/concerns/common.rb +0 -0
- data/app/controllers/concerns/pagination.rb +0 -0
- data/app/controllers/snf_core/application_controller.rb +33 -0
- data/app/controllers/snf_core/auth_controller.rb +70 -0
- data/app/jobs/snf_core/application_job.rb +0 -0
- data/app/mailers/snf_core/application_mailer.rb +0 -0
- data/app/mailers/snf_core/auth_mailer.rb +13 -0
- data/app/models/snf_core/address.rb +0 -0
- data/app/models/snf_core/application_record.rb +0 -0
- data/app/models/snf_core/business.rb +0 -0
- data/app/models/snf_core/business_document.rb +15 -15
- data/app/models/snf_core/category.rb +0 -0
- data/app/models/snf_core/customer_group.rb +0 -0
- data/app/models/snf_core/delivery_order.rb +42 -0
- data/app/models/snf_core/group.rb +0 -0
- data/app/models/snf_core/order.rb +68 -0
- data/app/models/snf_core/order_item.rb +30 -0
- data/app/models/snf_core/product.rb +0 -0
- data/app/models/snf_core/role.rb +8 -0
- data/app/models/snf_core/store.rb +0 -0
- data/app/models/snf_core/store_inventory.rb +0 -0
- data/app/models/snf_core/user.rb +18 -18
- data/app/models/snf_core/user_role.rb +6 -0
- data/app/models/snf_core/wallet.rb +0 -0
- data/app/services/snf_core/token_service.rb +16 -0
- data/app/views/layouts/snf_core/mailer.html.erb +64 -0
- data/app/views/layouts/snf_core/mailer.text.erb +1 -0
- data/app/views/snf_core/auth_mailer/reset_password.html.erb +10 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20250226042622_create_snf_core_users.rb +13 -14
- data/db/migrate/20250226064444_create_snf_core_categories.rb +0 -0
- data/db/migrate/20250226080323_create_snf_core_businesses.rb +0 -0
- data/db/migrate/20250226102931_create_snf_core_business_documents.rb +0 -0
- data/db/migrate/20250226110217_create_snf_core_addresses.rb +0 -0
- data/db/migrate/20250226115215_create_snf_core_stores.rb +0 -0
- data/db/migrate/20250226181007_create_snf_core_products.rb +0 -0
- data/db/migrate/20250226190000_create_snf_core_store_inventories.rb +0 -0
- data/db/migrate/20250226192104_create_snf_core_groups.rb +0 -0
- data/db/migrate/20250226193938_create_snf_core_customer_groups.rb +0 -0
- data/db/migrate/20250227075048_create_snf_core_wallets.rb +0 -0
- data/db/migrate/20250227102833_modify_store_inventories.rb +0 -0
- data/db/migrate/20250305165926_create_snf_core_orders.rb +12 -0
- data/db/migrate/20250305170248_create_snf_core_order_items.rb +13 -0
- data/db/migrate/20250305201008_create_snf_core_delivery_orders.rb +15 -0
- data/db/migrate/20250305232529_create_snf_core_roles.rb +9 -0
- data/db/migrate/20250305232530_create_snf_core_user_roles.rb +10 -0
- data/db/migrate/20250306074713_add_password_fields_to_snf_core_users.rb +7 -0
- data/lib/snf_core/engine.rb +0 -0
- data/lib/snf_core/version.rb +1 -1
- data/lib/snf_core.rb +0 -0
- data/lib/tasks/snf_core_tasks.rake +0 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +7 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/dev +2 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +34 -0
- data/spec/dummy/config/application.rb +43 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +20 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +86 -0
- data/spec/dummy/config/environments/production.rb +86 -0
- data/spec/dummy/config/environments/test.rb +53 -0
- data/spec/dummy/config/initializers/cors.rb +16 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +8 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/locales/en.yml +31 -0
- data/spec/dummy/config/puma.rb +38 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/storage.yml +38 -0
- data/spec/dummy/config.ru +6 -0
- data/spec/dummy/db/migrate/20250226123213_create_active_storage_tables.active_storage.rb +57 -0
- data/spec/dummy/db/schema.rb +242 -0
- data/spec/dummy/log/development.log +3026 -0
- data/spec/dummy/log/test.log +133760 -0
- data/spec/dummy/spec/fixtures/files/sample.pdf +0 -0
- data/spec/dummy/tmp/letter_opener/1741263210_267596_73bfefe/rich.html +142 -0
- data/spec/dummy/tmp/letter_opener/1741263645_7876108_3edd95c/rich.html +132 -0
- data/spec/dummy/tmp/letter_opener/1741263812_8855171_0bf8e2b/rich.html +132 -0
- data/spec/dummy/tmp/local_secret.txt +1 -0
- data/spec/dummy/tmp/pids/server.pid +1 -0
- data/spec/dummy/tmp/restart.txt +0 -0
- data/spec/dummy/tmp/storage/05/zb/05zbh3dr63t1ktnsxkwk2ugbglbu +0 -0
- data/spec/dummy/tmp/storage/0u/er/0uerkm5uy46p3lvg18c7ond00lih +0 -0
- data/spec/dummy/tmp/storage/13/1y/131yod70wqijazn3ix829yvuuvge +0 -0
- data/spec/dummy/tmp/storage/16/na/16na9nc1z98jt6fyn3axj3bhudes +0 -0
- data/spec/dummy/tmp/storage/17/wb/17wbd1yhh3pyg3j1sko570vsjnpq +0 -0
- data/spec/dummy/tmp/storage/1e/s9/1es9g1a309tf4bs04mr0i70usjz1 +0 -0
- data/spec/dummy/tmp/storage/1j/tj/1jtjythzzcpbajktrsn08af3x66m +0 -0
- data/spec/dummy/tmp/storage/1t/oy/1toyz0i6f9u5xexr4cpwttr04ood +0 -0
- data/spec/dummy/tmp/storage/1v/u3/1vu3btk2ukaxgp84qfmk5izonqmi +0 -0
- data/spec/dummy/tmp/storage/1x/i3/1xi33eqr5ipoaz0upakb8yy7qc4o +0 -0
- data/spec/dummy/tmp/storage/22/xs/22xscg5bqqtdykdaxrbr388lxkmf +0 -0
- data/spec/dummy/tmp/storage/24/69/2469t9kpepg4fd8ki960h025li0b +0 -0
- data/spec/dummy/tmp/storage/2a/0u/2a0uyihfk1wn5c1fuz09unocwy2m +0 -0
- data/spec/dummy/tmp/storage/2e/f9/2ef9j9go5h1v9ain8zq8m9zpjsf3 +0 -0
- data/spec/dummy/tmp/storage/2i/e3/2ie3ve4rajer9sx5zf6r45b3r9ar +0 -0
- data/spec/dummy/tmp/storage/2n/56/2n569vuf39piqdtbtbxsztn3r6kl +0 -0
- data/spec/dummy/tmp/storage/2o/te/2ote6co29576cnoptsem3lhupuxy +0 -0
- data/spec/dummy/tmp/storage/32/ur/32ur9eb5d0h01m2oe9kc5avpm31u +0 -0
- data/spec/dummy/tmp/storage/35/ov/35ovg8m7ij4fjqy3v4bh28e5hld2 +0 -0
- data/spec/dummy/tmp/storage/37/x2/37x2up33wqtrua85c089e6ltr49p +0 -0
- data/spec/dummy/tmp/storage/3i/8d/3i8dbcb1dk9ri0kumm3th8wo61gc +0 -0
- data/spec/dummy/tmp/storage/3u/jh/3ujhd5drl4t2nfbqw7ij2jzijxn1 +0 -0
- data/spec/dummy/tmp/storage/41/ud/41udni7kfampfsa6dwynr7273y3v +0 -0
- data/spec/dummy/tmp/storage/44/ww/44wwsc9by5wv1u70y9suhuq92bwi +0 -0
- data/spec/dummy/tmp/storage/4b/qe/4bqe6i8rtzlu196bvama05xnumrb +0 -0
- data/spec/dummy/tmp/storage/4n/9p/4n9pgwj5byodmx46ffhpvlydbrmh +0 -0
- data/spec/dummy/tmp/storage/4t/86/4t862kv9wcz0p7wgdvpmtmczdadt +0 -0
- data/spec/dummy/tmp/storage/4t/ke/4tkejzaafw2hopionhrbemj6jrij +0 -0
- data/spec/dummy/tmp/storage/4u/gx/4ugxo9x3cqbwg3d58u13xmtgc6f6 +0 -0
- data/spec/dummy/tmp/storage/57/kn/57kn4d3oyb3uqr0y0hwq4wl4d80i +0 -0
- data/spec/dummy/tmp/storage/5j/ls/5jlsuxajthpnn769oy836amrsavi +0 -0
- data/spec/dummy/tmp/storage/5n/ys/5nyszrcfj6fl2spwxjn1yea42ax0 +0 -0
- data/spec/dummy/tmp/storage/5s/zb/5szbksq6mg3768g9vtk788gc49gw +0 -0
- data/spec/dummy/tmp/storage/5y/zf/5yzft7e8r6cz5pcu78z6jj8dhmbz +0 -0
- data/spec/dummy/tmp/storage/62/jx/62jxz09uvpyv1okycwh7mv6z0gz5 +0 -0
- data/spec/dummy/tmp/storage/66/ed/66edq851b58dvses2okkafxtn827 +0 -0
- data/spec/dummy/tmp/storage/6a/8k/6a8k0jyqprv0z2q3a0p9bwiyy8av +0 -0
- data/spec/dummy/tmp/storage/6d/4e/6d4eiwu6oegnp12mwt27bwhkxe8v +0 -0
- data/spec/dummy/tmp/storage/6g/dc/6gdc40iivivwbln1zs4dqedt5ni7 +0 -0
- data/spec/dummy/tmp/storage/6m/ry/6mrynv03esjb64ohdo4q4xd0wr6t +0 -0
- data/spec/dummy/tmp/storage/6o/7a/6o7ax3ihg25bswxp4d601mqo7tl3 +0 -0
- data/spec/dummy/tmp/storage/6w/uj/6wujip3kahx619bqpcc4myv7tz5n +0 -0
- data/spec/dummy/tmp/storage/6z/86/6z862zpc67sikzl0otbf418t2clj +0 -0
- data/spec/dummy/tmp/storage/70/pb/70pbs8mjus3udsitby6gasexg4qz +0 -0
- data/spec/dummy/tmp/storage/71/rq/71rqssbyrwzhseipt1ojj2aucm2f +0 -0
- data/spec/dummy/tmp/storage/74/nt/74ntaj9azigfadsry359nl8jwbva +0 -0
- data/spec/dummy/tmp/storage/76/qk/76qkxksbv7v7meswa7mcnshr777l +0 -0
- data/spec/dummy/tmp/storage/7g/z0/7gz0olv00p0i3xqdy3f4fa6e73u2 +0 -0
- data/spec/dummy/tmp/storage/82/zv/82zvnds6te3el62i8vxv8rzkc4ms +0 -0
- data/spec/dummy/tmp/storage/83/b1/83b1ejivo3bxawg0kv4f1jufwarp +0 -0
- data/spec/dummy/tmp/storage/84/xr/84xr5dqonkroxjj0nkf3cznat5qt +0 -0
- data/spec/dummy/tmp/storage/8q/oh/8qohqcrf9fh6oc374ewp0lxid5lf +0 -0
- data/spec/dummy/tmp/storage/8v/yv/8vyvd9q13xzmav17gvu5tr1mvlws +0 -0
- data/spec/dummy/tmp/storage/91/35/9135ona6a51xpv669i6wz75kz8pr +0 -0
- data/spec/dummy/tmp/storage/92/hw/92hw9u9j6728qgwpcn7oqphe9tzj +0 -0
- data/spec/dummy/tmp/storage/9a/3q/9a3qd5qc7j6dzzmg16wcpvwoowmp +0 -0
- data/spec/dummy/tmp/storage/9b/2w/9b2w9oc0quy4lsa7y4zvvq8pfnh5 +0 -0
- data/spec/dummy/tmp/storage/9p/cd/9pcdjfvbqndd5dxue0ttlfeew1ht +0 -0
- data/spec/dummy/tmp/storage/al/8s/al8szf81ccm4ckpvxh3bv6vlgp0y +0 -0
- data/spec/dummy/tmp/storage/ao/tx/aotxomcc2m5ojywmr335fc27br55 +0 -0
- data/spec/dummy/tmp/storage/as/3k/as3k29j61efclm810sdnopepmgl2 +0 -0
- data/spec/dummy/tmp/storage/b0/wa/b0wa1zer7y7x8udydx3puofxd3fd +0 -0
- data/spec/dummy/tmp/storage/b8/8l/b88ln7wuq13v4akgwgc0dgac8887 +0 -0
- data/spec/dummy/tmp/storage/bb/iy/bbiyfh0r4f3szj4bmfwp7ptcst6k +0 -0
- data/spec/dummy/tmp/storage/bg/h0/bgh0cuyn7744wfbm8zuob9lugpxu +0 -0
- data/spec/dummy/tmp/storage/bi/6q/bi6qcv9yadwuy9au0q4vojvtqibp +0 -0
- data/spec/dummy/tmp/storage/bm/s6/bms684574m329zo33bmdzw4y05q8 +0 -0
- data/spec/dummy/tmp/storage/bn/8g/bn8gi5i69ysnnedgg57lg6r48hc0 +0 -0
- data/spec/dummy/tmp/storage/bp/0h/bp0hrk5xcf4q8q4b4ypo17ngqy93 +0 -0
- data/spec/dummy/tmp/storage/bs/y9/bsy9t4961ra8hwlq06wjtgrrcflp +0 -0
- data/spec/dummy/tmp/storage/ca/u3/cau32ihv1n1onmqmxf9pbpvwwp42 +0 -0
- data/spec/dummy/tmp/storage/ck/1p/ck1pqdlwjggav333jasfbrtptqs8 +0 -0
- data/spec/dummy/tmp/storage/ck/nb/cknbno5x3oh0nzvrry51ai2c2ce9 +0 -0
- data/spec/dummy/tmp/storage/cp/xd/cpxd4pz21lel4kv0463co0i34dyo +0 -0
- data/spec/dummy/tmp/storage/cq/25/cq25o59ipbdrfn01mtjvi5dwc8v0 +0 -0
- data/spec/dummy/tmp/storage/cq/os/cqosgu11l61u6gdz0c54mr4hasry +0 -0
- data/spec/dummy/tmp/storage/cs/x9/csx9mv26ab1lm82a7itryfq4v6rq +0 -0
- data/spec/dummy/tmp/storage/d5/aa/d5aag1rh6b9stocz1m1pg5c8mnfw +0 -0
- data/spec/dummy/tmp/storage/dm/c1/dmc1zx12pfl41f9br9f1l86953ew +0 -0
- data/spec/dummy/tmp/storage/dp/0f/dp0fx9ji1bqvx1najwjgns6n7fhf +0 -0
- data/spec/dummy/tmp/storage/dq/04/dq04jlw82vqiecdsxyrspe3y8zhd +0 -0
- data/spec/dummy/tmp/storage/dq/p8/dqp8o7eqfob92n81thzhj4mmviwf +0 -0
- data/spec/dummy/tmp/storage/dr/1z/dr1z3xxvya5ywessdrhmk05b2apz +0 -0
- data/spec/dummy/tmp/storage/dr/6z/dr6z0vwwsxqzw0kfkwl598uciyft +0 -0
- data/spec/dummy/tmp/storage/dx/iu/dxiu87gi66esp528s27d805z6b1v +0 -0
- data/spec/dummy/tmp/storage/e2/uo/e2uoyhzlaj5538p6rjs37pbl0z9g +0 -0
- data/spec/dummy/tmp/storage/ef/ih/efihy3gyspz150a8mpmhvj01xr07 +0 -0
- data/spec/dummy/tmp/storage/ej/20/ej20a2w7j929ut3zwo0kk5zyzp96 +0 -0
- data/spec/dummy/tmp/storage/ek/3j/ek3jzmz9919dhom6hbmhglq7e64b +0 -0
- data/spec/dummy/tmp/storage/em/kc/emkc4tc71k65mfcurv6k8z1ylswl +0 -0
- data/spec/dummy/tmp/storage/em/vx/emvx0c15o74mr0nlcvdc7m88j2gi +0 -0
- data/spec/dummy/tmp/storage/ew/n0/ewn0vyho1jbc7i76nat14codqc38 +0 -0
- data/spec/dummy/tmp/storage/f8/hf/f8hf7vk5c1h8s3upvdsgqbrdkokl +0 -0
- data/spec/dummy/tmp/storage/fo/9s/fo9s4w4egoj3qjbwknubsr4m3hca +0 -0
- data/spec/dummy/tmp/storage/fq/m7/fqm72ukjmyc0t6mgh73ehovlhm7i +0 -0
- data/spec/dummy/tmp/storage/ga/7e/ga7eiyyv0llme2i4xby0kdp4a4h8 +0 -0
- data/spec/dummy/tmp/storage/gc/bb/gcbbnsf6rq5xftpvxt4vfo39v2tx +0 -0
- data/spec/dummy/tmp/storage/gc/nn/gcnnb8yfz775d91vymz929zy2b7l +0 -0
- data/spec/dummy/tmp/storage/gv/kd/gvkd1h6f6qqh334ybfn71lwi6xk0 +0 -0
- data/spec/dummy/tmp/storage/gy/t2/gyt2tfjun5ezlgnl6u2ozz2s5wt9 +0 -0
- data/spec/dummy/tmp/storage/h0/i7/h0i7pyghnhpzsss74tk1k9k69yo4 +0 -0
- data/spec/dummy/tmp/storage/h4/86/h486d2xris442m90oylhhdlj1pjg +0 -0
- data/spec/dummy/tmp/storage/h4/vg/h4vgoatz21dhjrztrrbg2hdhkwjb +0 -0
- data/spec/dummy/tmp/storage/h5/13/h513cys269xn45jdhxhfyjlq5b3q +0 -0
- data/spec/dummy/tmp/storage/hb/yf/hbyf2wemy2azh7k1qhn3to9cpbj1 +0 -0
- data/spec/dummy/tmp/storage/hi/9h/hi9ho77symoy2j0ye28fxgnxw3kt +0 -0
- data/spec/dummy/tmp/storage/hl/yy/hlyyu150rt2yos1sa9ed1qw49y26 +0 -0
- data/spec/dummy/tmp/storage/hm/la/hmlataprq9fsh3126h6zmi19u2u1 +0 -0
- data/spec/dummy/tmp/storage/hp/6k/hp6kbroei8cm1chsl2bxhrpbkh1s +0 -0
- data/spec/dummy/tmp/storage/hr/mb/hrmb0w1dnyo6750fj1866f5np7sm +0 -0
- data/spec/dummy/tmp/storage/i9/6r/i96r6te3tutbwgxgl0maf3tgud51 +0 -0
- data/spec/dummy/tmp/storage/ih/xa/ihxalwtv9q6k97ryw0x3di5or5xw +0 -0
- data/spec/dummy/tmp/storage/in/jg/injgf3gi3v8yhpjwy4h8s96k0w8x +0 -0
- data/spec/dummy/tmp/storage/ir/zq/irzqn6i8886usqy6bcnsghmr01kg +0 -0
- data/spec/dummy/tmp/storage/iw/19/iw191t6h61ig4a68n3rk73vjvldc +0 -0
- data/spec/dummy/tmp/storage/j0/jz/j0jz8g89xbvv61ou1cj7dztym5k3 +0 -0
- data/spec/dummy/tmp/storage/j6/ym/j6ymkvvvhcdf7snmc6cardtsy9nd +0 -0
- data/spec/dummy/tmp/storage/j7/6x/j76x0oirv7i4t6p3blseuaknp7pw +0 -0
- data/spec/dummy/tmp/storage/jq/95/jq95rqhv5usgucn2d2mmkhjufapu +0 -0
- data/spec/dummy/tmp/storage/jr/uw/jruwp015m0chh50nxgkklum2ta3u +0 -0
- data/spec/dummy/tmp/storage/jz/ku/jzku30iopsxhh5quij3dov92vpyd +0 -0
- data/spec/dummy/tmp/storage/k0/wi/k0wijnkceisaxvkmc3hbr4croete +0 -0
- data/spec/dummy/tmp/storage/kk/76/kk76rr3nfbi1r4cmw9rcxuorpv4y +0 -0
- data/spec/dummy/tmp/storage/kn/z4/knz4o9yqqnipvbbo2fum9sz2528v +0 -0
- data/spec/dummy/tmp/storage/ky/1y/ky1ys68lmat11bxs2395dqugiyig +0 -0
- data/spec/dummy/tmp/storage/kz/4h/kz4hr1f97wfp44jkt5i3tvheo2hm +0 -0
- data/spec/dummy/tmp/storage/l4/ge/l4gelxdup4epl7lv9x5qyhatk2l6 +0 -0
- data/spec/dummy/tmp/storage/l5/3j/l53jq75i2ywyslq3wl999vl2jmyz +0 -0
- data/spec/dummy/tmp/storage/la/a6/laa6ye8vmuyl7m1gjpkcx19cdpzq +0 -0
- data/spec/dummy/tmp/storage/li/di/lidigrxrlew69ebcfx5ubeb203ck +0 -0
- data/spec/dummy/tmp/storage/ln/0f/ln0fz4opsdycu80q7urfez9ar7kn +0 -0
- data/spec/dummy/tmp/storage/lr/6l/lr6lqlqemfz0aorfbyot2lo9ck4o +0 -0
- data/spec/dummy/tmp/storage/lu/no/lunox74fm54ctc4qbfo2lj9l56sv +0 -0
- data/spec/dummy/tmp/storage/lv/o6/lvo6jno7mebvf0hssv20pgwfyum6 +0 -0
- data/spec/dummy/tmp/storage/m0/tm/m0tml6mrt7hiab73wgr0m9kaizn6 +0 -0
- data/spec/dummy/tmp/storage/mg/z6/mgz6nnkcl4j37w3ev6yolkfxe95o +0 -0
- data/spec/dummy/tmp/storage/mk/4w/mk4w528bsn47ewri0odui9s40f87 +0 -0
- data/spec/dummy/tmp/storage/ms/l9/msl9xauqjm3xnmfpxuiccmznlvnr +0 -0
- data/spec/dummy/tmp/storage/mu/ln/muln4ptnkbcff0s2p54j36goygbx +0 -0
- data/spec/dummy/tmp/storage/na/6r/na6rrohinrnjofsq27u95up5rp8k +0 -0
- data/spec/dummy/tmp/storage/nd/9y/nd9yeusukf9brbkzbm7af1yygidd +0 -0
- data/spec/dummy/tmp/storage/nf/sp/nfspv0s1uw5xo4qtxd8vsvvqy9v7 +0 -0
- data/spec/dummy/tmp/storage/nr/f9/nrf9wi6n0guazfp9gluc36do0dx1 +0 -0
- data/spec/dummy/tmp/storage/nw/le/nwle0hzkvkdl27fqqtm4nmpgzcvp +0 -0
- data/spec/dummy/tmp/storage/nx/64/nx64klyyxu3u3qz5lov4zf23fgco +0 -0
- data/spec/dummy/tmp/storage/nz/kd/nzkd3xlsbohxa2dgfyrz26iqb723 +0 -0
- data/spec/dummy/tmp/storage/o6/xf/o6xfczmxpom0laekvp59gute2p5d +0 -0
- data/spec/dummy/tmp/storage/oc/f8/ocf8zs18lm9fnkpqj6wpshdpyf43 +0 -0
- data/spec/dummy/tmp/storage/oc/xk/ocxkae9a9kkycvpfw71sdhnpqn85 +0 -0
- data/spec/dummy/tmp/storage/oe/bq/oebq593a6bpwkbxpx6segtwyy0jy +0 -0
- data/spec/dummy/tmp/storage/p5/4w/p54wycc6tln36b54yfsz2zk7hcdt +0 -0
- data/spec/dummy/tmp/storage/p9/hd/p9hddsr7pgksgl6vuqgtkp1ad7x2 +0 -0
- data/spec/dummy/tmp/storage/ph/va/phvajdvl6g28vluah7d38rpaj2el +0 -0
- data/spec/dummy/tmp/storage/pi/4i/pi4izeatwyrz6e8zdwvri4f4h4tl +0 -0
- data/spec/dummy/tmp/storage/pu/rl/purlhr67132j7c4k548memz2w2q1 +0 -0
- data/spec/dummy/tmp/storage/pv/bo/pvboa7wami2p1zjkuytzj9epmj14 +0 -0
- data/spec/dummy/tmp/storage/q5/i8/q5i8dg12fdmm5jura53gaw3zj6u4 +0 -0
- data/spec/dummy/tmp/storage/qn/1h/qn1hgmvsrnd8dkn4nvcyvqy3q2sb +0 -0
- data/spec/dummy/tmp/storage/qp/hi/qphia48836lod6l2ao5ca6ocd8ws +0 -0
- data/spec/dummy/tmp/storage/qs/jk/qsjkqiiarr85uobud0qsnnmpraol +0 -0
- data/spec/dummy/tmp/storage/qw/7z/qw7zsf91njf7ga6454nrjpvddjn5 +0 -0
- data/spec/dummy/tmp/storage/r6/6f/r66f8sxtwvlk8c1ava46bgua5hn0 +0 -0
- data/spec/dummy/tmp/storage/ra/6b/ra6b797wpupx6nqkgne3d63j6lh2 +0 -0
- data/spec/dummy/tmp/storage/ra/s0/ras0iwcg9lufnjah5yxyola73jsk +0 -0
- data/spec/dummy/tmp/storage/rd/e4/rde4tqu10zhrceb4uvvorhse4itt +0 -0
- data/spec/dummy/tmp/storage/rh/0h/rh0h80b8er9vp1u8dcocy1u58obf +0 -0
- data/spec/dummy/tmp/storage/ro/wb/rowb68g2iif1e8hsbjdjsmxj94h7 +0 -0
- data/spec/dummy/tmp/storage/s1/22/s122jwsnbcabv9fxp54nhoaaf34u +0 -0
- data/spec/dummy/tmp/storage/s6/on/s6onn1pu2bxcdkeebeu9qaht8i4d +0 -0
- data/spec/dummy/tmp/storage/s8/o0/s8o0enbem94835cqjla6onwncqpz +0 -0
- data/spec/dummy/tmp/storage/s9/lw/s9lwslyf5co34pvbt3n9ay06ui2w +0 -0
- data/spec/dummy/tmp/storage/sb/bo/sbboin8iacxsa7ywl1xp401f7tmj +0 -0
- data/spec/dummy/tmp/storage/sd/he/sdhe8pgaioyf7kdmdok21dy8enr3 +0 -0
- data/spec/dummy/tmp/storage/si/24/si24loctkg3h900v6vaoxwnruih7 +0 -0
- data/spec/dummy/tmp/storage/st/hv/sthv2tx2r8zv6tyn9yxi5am0pgzh +0 -0
- data/spec/dummy/tmp/storage/su/ng/sungqllfkjesc0p9c8hz3y2ior41 +0 -0
- data/spec/dummy/tmp/storage/sy/wq/sywqphj8vgv0imntn38s286yjjc3 +0 -0
- data/spec/dummy/tmp/storage/ta/s3/tas35nm4h81nhaecpeybk8kxzt62 +0 -0
- data/spec/dummy/tmp/storage/tc/gu/tcgurel05x9fk9ksm4hxwfla3hg3 +0 -0
- data/spec/dummy/tmp/storage/tk/rt/tkrtpgn5p68rqy679q15ab3j7twz +0 -0
- data/spec/dummy/tmp/storage/tm/ce/tmce54998rdnz191k02fzowpebvw +0 -0
- data/spec/dummy/tmp/storage/tt/pu/ttpumlt7wi54pohcc7ktsl5le777 +0 -0
- data/spec/dummy/tmp/storage/u1/vf/u1vfyawqqy7wpkthgardxs358car +0 -0
- data/spec/dummy/tmp/storage/u2/xa/u2xaxpjz4fdxtxxinaxq2r7biovv +0 -0
- data/spec/dummy/tmp/storage/uf/67/uf67aznvgtom02vj8q4jl60hycfm +0 -0
- data/spec/dummy/tmp/storage/ui/xi/uixi7xtks88zuqr4gwi6cjbk4m47 +0 -0
- data/spec/dummy/tmp/storage/uq/jk/uqjkltli1s6vz51g6yu551ze48c1 +0 -0
- data/spec/dummy/tmp/storage/ux/te/uxtezp2rqztn4cernmn7477gukxe +0 -0
- data/spec/dummy/tmp/storage/v4/yi/v4yieu5kcx0jz3ephiptzr46djev +0 -0
- data/spec/dummy/tmp/storage/va/sc/vascc4h0c7dv7uwwcn2wdvx6qyhy +0 -0
- data/spec/dummy/tmp/storage/vp/ub/vpub3n9dk3ts14cvq9tvkez7crqq +0 -0
- data/spec/dummy/tmp/storage/w2/3f/w23f3igzkn7bddqxry5x4wsu2ths +0 -0
- data/spec/dummy/tmp/storage/w4/1j/w41judbhn1j3quwhs36myqwnypkz +0 -0
- data/spec/dummy/tmp/storage/w4/d3/w4d3qfnguynfuw4oxo5hek8q5w66 +0 -0
- data/spec/dummy/tmp/storage/w9/na/w9na14949rr42w928n9srevxecbl +0 -0
- data/spec/dummy/tmp/storage/wo/81/wo813rsnwvoa55h0vq0fr79iajuw +0 -0
- data/spec/dummy/tmp/storage/wp/zs/wpzs5finp3t36za2bykcoxueu5b6 +0 -0
- data/spec/dummy/tmp/storage/wv/9t/wv9t3gxm6dqah7kdq74pimjdb156 +0 -0
- data/spec/dummy/tmp/storage/ww/40/ww40d8rykhlpxwfh0ggfs7mrh0jl +0 -0
- data/spec/dummy/tmp/storage/wy/14/wy14megn3o5zqplv9xg6u32uwkr6 +0 -0
- data/spec/dummy/tmp/storage/xd/4h/xd4h96rdmw5t9pujgz831cnfgj8o +0 -0
- data/spec/dummy/tmp/storage/xi/en/xiensi0706n8m0x5lxp0fbwg8ipk +0 -0
- data/spec/dummy/tmp/storage/xj/yy/xjyygdd3znvvpt9ufz1vv4lfsx3w +0 -0
- data/spec/dummy/tmp/storage/xs/x1/xsx109k9pb83qze3raurxo22dnms +0 -0
- data/spec/dummy/tmp/storage/xv/gf/xvgf6x0othqxlxcbgwz4sg7th3p9 +0 -0
- data/spec/dummy/tmp/storage/y5/3g/y53gv7ysx4j1y0k71pszym8sdu6b +0 -0
- data/spec/dummy/tmp/storage/ya/yf/yayfpxlrbtz0578nl9tlourrwe27 +0 -0
- data/spec/dummy/tmp/storage/yd/x8/ydx8jm52rnl3b7mpvmmxlilenllw +0 -0
- data/spec/dummy/tmp/storage/ye/bu/yebu3imdihqdatzktkubhkto82xo +0 -0
- data/spec/dummy/tmp/storage/yf/49/yf49a4ydheqf3cqs0u49sanbl4ms +0 -0
- data/spec/dummy/tmp/storage/yh/q1/yhq1muao2dpuykmj12bxhd0x4ntk +0 -0
- data/spec/dummy/tmp/storage/ym/5n/ym5ndg2m03vfnoeryvb9tex8xj72 +0 -0
- data/spec/dummy/tmp/storage/yx/jp/yxjpumjyo1jysjpg20qaxgsqg4fw +0 -0
- data/spec/dummy/tmp/storage/z1/gr/z1grp34d5vw7mi4g8vw8yfu91ny2 +0 -0
- data/spec/dummy/tmp/storage/z5/qs/z5qs5fq00igr3xv5izgcyhhsdw7y +0 -0
- data/spec/dummy/tmp/storage/z5/sg/z5sgd1au9gcfkqb3kq82f3yry6a6 +0 -0
- data/spec/dummy/tmp/storage/z7/8n/z78nuzozxx53c7cpp3e4kt3nghaa +0 -0
- data/spec/dummy/tmp/storage/zk/3v/zk3vlz1al2rba9wlkzoa6p8wpli0 +0 -0
- data/spec/dummy/tmp/storage/zk/xs/zkxsr1zywhaydz0cep4eh8mmos46 +0 -0
- data/spec/dummy/tmp/storage/zx/ur/zxuraz59df480azmknqbfeb37ktm +0 -0
- data/spec/examples.txt +126 -0
- data/spec/factories/snf_core/addresses.rb +10 -0
- data/spec/factories/snf_core/business_documents.rb +18 -0
- data/spec/factories/snf_core/businesses.rb +10 -0
- data/spec/factories/snf_core/categories.rb +7 -0
- data/spec/factories/snf_core/customer_groups.rb +9 -0
- data/spec/factories/snf_core/delivery_orders.rb +36 -0
- data/spec/factories/snf_core/groups.rb +6 -0
- data/spec/factories/snf_core/order_items.rb +9 -0
- data/spec/factories/snf_core/orders.rb +33 -0
- data/spec/factories/snf_core/products.rb +9 -0
- data/spec/factories/snf_core/roles.rb +5 -0
- data/spec/factories/snf_core/store_inventories.rb +8 -0
- data/spec/factories/snf_core/stores.rb +9 -0
- data/spec/factories/snf_core/user_roles.rb +6 -0
- data/spec/factories/snf_core/users.rb +12 -0
- data/spec/factories/snf_core/wallets.rb +7 -0
- data/spec/mailers/previews/snf_core/auth_mailer_preview.rb +6 -0
- data/spec/mailers/snf_core/auth_mailer_spec.rb +7 -0
- data/spec/models/snf_core/address_spec.rb +15 -0
- data/spec/models/snf_core/business_document_spec.rb +20 -0
- data/spec/models/snf_core/business_spec.rb +14 -0
- data/spec/models/snf_core/category_spec.rb +12 -0
- data/spec/models/snf_core/customer_group_spec.rb +11 -0
- data/spec/models/snf_core/delivery_order_spec.rb +70 -0
- data/spec/models/snf_core/group_spec.rb +11 -0
- data/spec/models/snf_core/order_item_spec.rb +64 -0
- data/spec/models/snf_core/order_spec.rb +81 -0
- data/spec/models/snf_core/product_spec.rb +17 -0
- data/spec/models/snf_core/role_spec.rb +12 -0
- data/spec/models/snf_core/store_inventory_spec.rb +24 -0
- data/spec/models/snf_core/store_spec.rb +13 -0
- data/spec/models/snf_core/user_role_spec.rb +11 -0
- data/spec/models/snf_core/user_spec.rb +22 -0
- data/spec/models/snf_core/wallet_spec.rb +28 -0
- data/spec/rails_helper.rb +46 -0
- data/spec/requests/snf_core/auth_spec.rb +139 -0
- data/spec/sample_spec.rb +5 -0
- data/spec/spec_helper.rb +36 -0
- data/spec/support/models/shared_examples.rb +49 -0
- data/spec/support/requests/shared_requests.rb +130 -0
- metadata +320 -3
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class ApplicationJob < ActiveJob::Base
|
2
|
+
# Automatically retry jobs that encountered a deadlock
|
3
|
+
# retry_on ActiveRecord::Deadlocked
|
4
|
+
|
5
|
+
# Most jobs are safe to ignore if the underlying records are no longer available
|
6
|
+
# discard_on ActiveJob::DeserializationError
|
7
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
data/spec/dummy/bin/dev
ADDED
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "fileutils"
|
3
|
+
|
4
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
5
|
+
|
6
|
+
def system!(*args)
|
7
|
+
system(*args, exception: true)
|
8
|
+
end
|
9
|
+
|
10
|
+
FileUtils.chdir APP_ROOT do
|
11
|
+
# This script is a way to set up or update your development environment automatically.
|
12
|
+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
13
|
+
# Add necessary setup steps to this file.
|
14
|
+
|
15
|
+
puts "== Installing dependencies =="
|
16
|
+
system("bundle check") || system!("bundle install")
|
17
|
+
|
18
|
+
# puts "\n== Copying sample files =="
|
19
|
+
# unless File.exist?("config/database.yml")
|
20
|
+
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
|
21
|
+
# end
|
22
|
+
|
23
|
+
puts "\n== Preparing database =="
|
24
|
+
system! "bin/rails db:prepare"
|
25
|
+
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
27
|
+
system! "bin/rails log:clear tmp:clear"
|
28
|
+
|
29
|
+
unless ARGV.include?("--skip-server")
|
30
|
+
puts "\n== Starting development server =="
|
31
|
+
STDOUT.flush # flush the output before exec(2) so that it displays
|
32
|
+
exec "bin/dev"
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require_relative "boot"
|
2
|
+
|
3
|
+
require "rails"
|
4
|
+
# Pick the frameworks you want:
|
5
|
+
require "active_model/railtie"
|
6
|
+
require "active_job/railtie"
|
7
|
+
require "active_record/railtie"
|
8
|
+
require "active_storage/engine"
|
9
|
+
require "action_controller/railtie"
|
10
|
+
require "action_mailer/railtie"
|
11
|
+
require "action_mailbox/engine"
|
12
|
+
require "action_text/engine"
|
13
|
+
require "action_view/railtie"
|
14
|
+
require "action_cable/engine"
|
15
|
+
# require "rails/test_unit/railtie"
|
16
|
+
|
17
|
+
# Require the gems listed in Gemfile, including any gems
|
18
|
+
# you've limited to :test, :development, or :production.
|
19
|
+
Bundler.require(*Rails.groups)
|
20
|
+
|
21
|
+
module Dummy
|
22
|
+
class Application < Rails::Application
|
23
|
+
config.load_defaults Rails::VERSION::STRING.to_f
|
24
|
+
|
25
|
+
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
26
|
+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
27
|
+
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
28
|
+
config.autoload_lib(ignore: %w[assets tasks])
|
29
|
+
|
30
|
+
# Configuration for the application, engines, and railties goes here.
|
31
|
+
#
|
32
|
+
# These settings can be overridden in specific environments using the files
|
33
|
+
# in config/environments, which are processed later.
|
34
|
+
#
|
35
|
+
# config.time_zone = "Central Time (US & Canada)"
|
36
|
+
# config.eager_load_paths << Rails.root.join("extras")
|
37
|
+
|
38
|
+
# Only loads a smaller set of middleware suitable for API only apps.
|
39
|
+
# Middleware like session, flash, cookies can be added back manually.
|
40
|
+
# Skip views, helpers and assets when generating a new resource.
|
41
|
+
config.api_only = true
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
default: &default
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: unicode
|
4
|
+
pool: 5
|
5
|
+
username: postgres
|
6
|
+
password: password
|
7
|
+
host: localhost
|
8
|
+
port: 5432
|
9
|
+
|
10
|
+
development:
|
11
|
+
<<: *default
|
12
|
+
database: snf_dev
|
13
|
+
|
14
|
+
test:
|
15
|
+
<<: *default
|
16
|
+
database: snf_test
|
17
|
+
|
18
|
+
production:
|
19
|
+
<<: *default
|
20
|
+
database: snf_prod
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# Make code changes take effect immediately without server restart.
|
7
|
+
config.enable_reloading = true
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
|
15
|
+
# Enable server timing.
|
16
|
+
config.server_timing = true
|
17
|
+
|
18
|
+
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
|
19
|
+
# Run rails dev:cache to toggle Action Controller caching.
|
20
|
+
if Rails.root.join("tmp/caching-dev.txt").exist?
|
21
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
|
22
|
+
else
|
23
|
+
config.action_controller.perform_caching = false
|
24
|
+
end
|
25
|
+
|
26
|
+
# Change to :null_store to avoid any caching.
|
27
|
+
config.cache_store = :memory_store
|
28
|
+
|
29
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
30
|
+
config.active_storage.service = :local
|
31
|
+
|
32
|
+
# Don't care if the mailer can't send.
|
33
|
+
config.action_mailer.raise_delivery_errors = false
|
34
|
+
|
35
|
+
# Make template changes take effect immediately.
|
36
|
+
config.action_mailer.perform_caching = false
|
37
|
+
|
38
|
+
# Set localhost to be used by links generated in mailer templates.
|
39
|
+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
|
40
|
+
|
41
|
+
# Print deprecation notices to the Rails logger.
|
42
|
+
config.active_support.deprecation = :log
|
43
|
+
|
44
|
+
# Raise an error on page load if there are pending migrations.
|
45
|
+
config.active_record.migration_error = :page_load
|
46
|
+
|
47
|
+
# Highlight code that triggered database queries in logs.
|
48
|
+
config.active_record.verbose_query_logs = true
|
49
|
+
|
50
|
+
# Append comments with runtime information tags to SQL queries in logs.
|
51
|
+
config.active_record.query_log_tags_enabled = true
|
52
|
+
|
53
|
+
# Highlight code that enqueued background job in logs.
|
54
|
+
config.active_job.verbose_enqueue_logs = true
|
55
|
+
|
56
|
+
# Raises error for missing translations.
|
57
|
+
# config.i18n.raise_on_missing_translations = true
|
58
|
+
|
59
|
+
# Annotate rendered view with file names.
|
60
|
+
config.action_view.annotate_rendered_view_with_filenames = true
|
61
|
+
|
62
|
+
# Uncomment if you wish to allow Action Cable access from any origin.
|
63
|
+
# config.action_cable.disable_request_forgery_protection = true
|
64
|
+
|
65
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
66
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
67
|
+
|
68
|
+
config.action_mailer.delivery_method = :smtp
|
69
|
+
host = 'localhost:3000'
|
70
|
+
config.action_mailer.default_url_options = { :host => 'localhost:3000', protocol: 'http' }
|
71
|
+
|
72
|
+
config.action_mailer.smtp_settings = {
|
73
|
+
:address => "smtp.gmail.com",
|
74
|
+
:port => 587,
|
75
|
+
:domain => 'gmail.com',
|
76
|
+
:user_name => "bunnabankauthmail@gmail.com",
|
77
|
+
:password => "ietldojndspeakov",
|
78
|
+
:authentication => "plain",
|
79
|
+
:enable_starttls_auto => true
|
80
|
+
}
|
81
|
+
|
82
|
+
config.action_mailer.delivery_method = :letter_opener
|
83
|
+
config.action_mailer.perform_deliveries = true
|
84
|
+
|
85
|
+
|
86
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# Code is not reloaded between requests.
|
7
|
+
config.enable_reloading = false
|
8
|
+
|
9
|
+
# Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
|
10
|
+
config.eager_load = true
|
11
|
+
|
12
|
+
# Full error reports are disabled.
|
13
|
+
config.consider_all_requests_local = false
|
14
|
+
|
15
|
+
# Cache assets for far-future expiry since they are all digest stamped.
|
16
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
|
17
|
+
|
18
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
19
|
+
# config.asset_host = "http://assets.example.com"
|
20
|
+
|
21
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
22
|
+
config.active_storage.service = :local
|
23
|
+
|
24
|
+
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
25
|
+
config.assume_ssl = true
|
26
|
+
|
27
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
28
|
+
config.force_ssl = true
|
29
|
+
|
30
|
+
# Skip http-to-https redirect for the default health check endpoint.
|
31
|
+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
32
|
+
|
33
|
+
# Log to STDOUT with the current request id as a default log tag.
|
34
|
+
config.log_tags = [ :request_id ]
|
35
|
+
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
|
36
|
+
|
37
|
+
# Change to "debug" to log everything (including potentially personally-identifiable information!)
|
38
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
39
|
+
|
40
|
+
# Prevent health checks from clogging up the logs.
|
41
|
+
config.silence_healthcheck_path = "/up"
|
42
|
+
|
43
|
+
# Don't log any deprecations.
|
44
|
+
config.active_support.report_deprecations = false
|
45
|
+
|
46
|
+
# Replace the default in-process memory cache store with a durable alternative.
|
47
|
+
# config.cache_store = :mem_cache_store
|
48
|
+
|
49
|
+
# Replace the default in-process and non-durable queuing backend for Active Job.
|
50
|
+
# config.active_job.queue_adapter = :resque
|
51
|
+
|
52
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
53
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
54
|
+
# config.action_mailer.raise_delivery_errors = false
|
55
|
+
|
56
|
+
# Set host to be used by links generated in mailer templates.
|
57
|
+
config.action_mailer.default_url_options = { host: "example.com" }
|
58
|
+
|
59
|
+
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
|
60
|
+
# config.action_mailer.smtp_settings = {
|
61
|
+
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
|
62
|
+
# password: Rails.application.credentials.dig(:smtp, :password),
|
63
|
+
# address: "smtp.example.com",
|
64
|
+
# port: 587,
|
65
|
+
# authentication: :plain
|
66
|
+
# }
|
67
|
+
|
68
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
69
|
+
# the I18n.default_locale when a translation cannot be found).
|
70
|
+
config.i18n.fallbacks = true
|
71
|
+
|
72
|
+
# Do not dump schema after migrations.
|
73
|
+
config.active_record.dump_schema_after_migration = false
|
74
|
+
|
75
|
+
# Only use :id for inspections in production.
|
76
|
+
config.active_record.attributes_for_inspect = [ :id ]
|
77
|
+
|
78
|
+
# Enable DNS rebinding protection and other `Host` header attacks.
|
79
|
+
# config.hosts = [
|
80
|
+
# "example.com", # Allow requests from example.com
|
81
|
+
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
82
|
+
# ]
|
83
|
+
#
|
84
|
+
# Skip DNS rebinding protection for the default health check endpoint.
|
85
|
+
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
86
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# The test environment is used exclusively to run your application's
|
2
|
+
# test suite. You never need to work with it otherwise. Remember that
|
3
|
+
# your test database is "scratch space" for the test suite and is wiped
|
4
|
+
# and recreated between test runs. Don't rely on the data there!
|
5
|
+
|
6
|
+
Rails.application.configure do
|
7
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
8
|
+
|
9
|
+
# While tests run files are not watched, reloading is not necessary.
|
10
|
+
config.enable_reloading = false
|
11
|
+
|
12
|
+
# Eager loading loads your entire application. When running a single test locally,
|
13
|
+
# this is usually not necessary, and can slow down your test suite. However, it's
|
14
|
+
# recommended that you enable it in continuous integration systems to ensure eager
|
15
|
+
# loading is working properly before deploying your code.
|
16
|
+
config.eager_load = ENV["CI"].present?
|
17
|
+
|
18
|
+
# Configure public file server for tests with cache-control for performance.
|
19
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
|
20
|
+
|
21
|
+
# Show full error reports.
|
22
|
+
config.consider_all_requests_local = true
|
23
|
+
config.cache_store = :null_store
|
24
|
+
|
25
|
+
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
26
|
+
config.action_dispatch.show_exceptions = :rescuable
|
27
|
+
|
28
|
+
# Disable request forgery protection in test environment.
|
29
|
+
config.action_controller.allow_forgery_protection = false
|
30
|
+
|
31
|
+
# Store uploaded files on the local file system in a temporary directory.
|
32
|
+
config.active_storage.service = :test
|
33
|
+
|
34
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
35
|
+
# The :test delivery method accumulates sent emails in the
|
36
|
+
# ActionMailer::Base.deliveries array.
|
37
|
+
config.action_mailer.delivery_method = :test
|
38
|
+
|
39
|
+
# Set host to be used by links generated in mailer templates.
|
40
|
+
config.action_mailer.default_url_options = { host: "example.com" }
|
41
|
+
|
42
|
+
# Print deprecation notices to the stderr.
|
43
|
+
config.active_support.deprecation = :stderr
|
44
|
+
|
45
|
+
# Raises error for missing translations.
|
46
|
+
# config.i18n.raise_on_missing_translations = true
|
47
|
+
|
48
|
+
# Annotate rendered view with file names.
|
49
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
50
|
+
|
51
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
52
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
53
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Avoid CORS issues when API is called from the frontend app.
|
4
|
+
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin Ajax requests.
|
5
|
+
|
6
|
+
# Read more: https://github.com/cyu/rack-cors
|
7
|
+
|
8
|
+
# Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
9
|
+
# allow do
|
10
|
+
# origins "example.com"
|
11
|
+
#
|
12
|
+
# resource "*",
|
13
|
+
# headers: :any,
|
14
|
+
# methods: [:get, :post, :put, :patch, :delete, :options, :head]
|
15
|
+
# end
|
16
|
+
# end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
|
4
|
+
# Use this to limit dissemination of sensitive information.
|
5
|
+
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
6
|
+
Rails.application.config.filter_parameters += [
|
7
|
+
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
|
8
|
+
]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, "\\1en"
|
8
|
+
# inflect.singular /^(ox)en/i, "\\1"
|
9
|
+
# inflect.irregular "person", "people"
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym "RESTful"
|
16
|
+
# end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization and
|
2
|
+
# are automatically loaded by Rails. If you want to use locales other than
|
3
|
+
# English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t "hello"
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t("hello") %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more about the API, please read the Rails Internationalization guide
|
20
|
+
# at https://guides.rubyonrails.org/i18n.html.
|
21
|
+
#
|
22
|
+
# Be aware that YAML interprets the following case-insensitive strings as
|
23
|
+
# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
|
24
|
+
# must be quoted to be interpreted as strings. For example:
|
25
|
+
#
|
26
|
+
# en:
|
27
|
+
# "yes": yup
|
28
|
+
# enabled: "ON"
|
29
|
+
|
30
|
+
en:
|
31
|
+
hello: "Hello world"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This configuration file will be evaluated by Puma. The top-level methods that
|
2
|
+
# are invoked here are part of Puma's configuration DSL. For more information
|
3
|
+
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
|
4
|
+
#
|
5
|
+
# Puma starts a configurable number of processes (workers) and each process
|
6
|
+
# serves each request in a thread from an internal thread pool.
|
7
|
+
#
|
8
|
+
# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
|
9
|
+
# should only set this value when you want to run 2 or more workers. The
|
10
|
+
# default is already 1.
|
11
|
+
#
|
12
|
+
# The ideal number of threads per worker depends both on how much time the
|
13
|
+
# application spends waiting for IO operations and on how much you wish to
|
14
|
+
# prioritize throughput over latency.
|
15
|
+
#
|
16
|
+
# As a rule of thumb, increasing the number of threads will increase how much
|
17
|
+
# traffic a given process can handle (throughput), but due to CRuby's
|
18
|
+
# Global VM Lock (GVL) it has diminishing returns and will degrade the
|
19
|
+
# response time (latency) of the application.
|
20
|
+
#
|
21
|
+
# The default is set to 3 threads as it's deemed a decent compromise between
|
22
|
+
# throughput and latency for the average Rails application.
|
23
|
+
#
|
24
|
+
# Any libraries that use a connection pool or another resource pool should
|
25
|
+
# be configured to provide at least as many connections as the number of
|
26
|
+
# threads. This includes Active Record's `pool` parameter in `database.yml`.
|
27
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
|
28
|
+
threads threads_count, threads_count
|
29
|
+
|
30
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
31
|
+
port ENV.fetch("PORT", 3000)
|
32
|
+
|
33
|
+
# Allow puma to be restarted by `bin/rails restart` command.
|
34
|
+
plugin :tmp_restart
|
35
|
+
|
36
|
+
# Specify the PID file. Defaults to tmp/pids/server.pid in development.
|
37
|
+
# In other environments, only set the PID file if requested.
|
38
|
+
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
|
@@ -0,0 +1,38 @@
|
|
1
|
+
test:
|
2
|
+
service: Disk
|
3
|
+
root: <%= Rails.root.join("tmp/storage") %>
|
4
|
+
|
5
|
+
local:
|
6
|
+
service: S3
|
7
|
+
endpoint: http://127.0.0.1:9000
|
8
|
+
access_key_id: <%= Rails.application.credentials.dig(:minio, :access_key_id) %>
|
9
|
+
secret_access_key: <%= Rails.application.credentials.dig(:minio, :secret_access_key) %>
|
10
|
+
region: eu-central-1
|
11
|
+
bucket: snf-core-<%= Rails.env %>
|
12
|
+
force_path_style: true
|
13
|
+
# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
14
|
+
# amazon:
|
15
|
+
# service: S3
|
16
|
+
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
17
|
+
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
18
|
+
# region: us-east-1
|
19
|
+
# bucket: your_own_bucket-<%= Rails.env %>
|
20
|
+
|
21
|
+
# Remember not to checkin your GCS keyfile to a repository
|
22
|
+
# google:
|
23
|
+
# service: GCS
|
24
|
+
# project: your_project
|
25
|
+
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
26
|
+
# bucket: your_own_bucket-<%= Rails.env %>
|
27
|
+
|
28
|
+
# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
29
|
+
# microsoft:
|
30
|
+
# service: AzureStorage
|
31
|
+
# storage_account_name: your_account_name
|
32
|
+
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
33
|
+
# container: your_container_name-<%= Rails.env %>
|
34
|
+
|
35
|
+
# mirror:
|
36
|
+
# service: Mirror
|
37
|
+
# primary: local
|
38
|
+
# mirrors: [ amazon, google, microsoft ]
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# This migration comes from active_storage (originally 20170806125915)
|
2
|
+
class CreateActiveStorageTables < ActiveRecord::Migration[7.0]
|
3
|
+
def change
|
4
|
+
# Use Active Record's configured type for primary and foreign keys
|
5
|
+
primary_key_type, foreign_key_type = primary_and_foreign_key_types
|
6
|
+
|
7
|
+
create_table :active_storage_blobs, id: primary_key_type do |t|
|
8
|
+
t.string :key, null: false
|
9
|
+
t.string :filename, null: false
|
10
|
+
t.string :content_type
|
11
|
+
t.text :metadata
|
12
|
+
t.string :service_name, null: false
|
13
|
+
t.bigint :byte_size, null: false
|
14
|
+
t.string :checksum
|
15
|
+
|
16
|
+
if connection.supports_datetime_with_precision?
|
17
|
+
t.datetime :created_at, precision: 6, null: false
|
18
|
+
else
|
19
|
+
t.datetime :created_at, null: false
|
20
|
+
end
|
21
|
+
|
22
|
+
t.index [ :key ], unique: true
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table :active_storage_attachments, id: primary_key_type do |t|
|
26
|
+
t.string :name, null: false
|
27
|
+
t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
|
28
|
+
t.references :blob, null: false, type: foreign_key_type
|
29
|
+
|
30
|
+
if connection.supports_datetime_with_precision?
|
31
|
+
t.datetime :created_at, precision: 6, null: false
|
32
|
+
else
|
33
|
+
t.datetime :created_at, null: false
|
34
|
+
end
|
35
|
+
|
36
|
+
t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true
|
37
|
+
t.foreign_key :active_storage_blobs, column: :blob_id
|
38
|
+
end
|
39
|
+
|
40
|
+
create_table :active_storage_variant_records, id: primary_key_type do |t|
|
41
|
+
t.belongs_to :blob, null: false, index: false, type: foreign_key_type
|
42
|
+
t.string :variation_digest, null: false
|
43
|
+
|
44
|
+
t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true
|
45
|
+
t.foreign_key :active_storage_blobs, column: :blob_id
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
def primary_and_foreign_key_types
|
51
|
+
config = Rails.configuration.generators
|
52
|
+
setting = config.options[config.orm][:primary_key_type]
|
53
|
+
primary_key_type = setting || :primary_key
|
54
|
+
foreign_key_type = setting || :bigint
|
55
|
+
[ primary_key_type, foreign_key_type ]
|
56
|
+
end
|
57
|
+
end
|