Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ AllCops:
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
# Layout/SpaceInsideArrayLiteralBrackets:
# Enabled: false

Bundler/OrderedGems:
Enabled: true
26 changes: 14 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ source "https://rubygems.org"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 8.1.3"
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
gem "propshaft"
# Use sqlite3 as the database for Active Record
gem "sqlite3", ">= 2.9.6"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", ">= 5.0"


gem "devise", "~> 5.0"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"

# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
gem "propshaft"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", ">= 5.0"
# Handle Cross-Origin Resource Sharing so the Expo app can call the API [https://github.com/cyu/rack-cors]
gem "rack-cors"
# Use sqlite3 as the database for Active Record
gem "sqlite3", ">= 2.9.6"
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
Expand All @@ -27,9 +29,9 @@ gem "rack-cors"
gem "tzinfo-data", platforms: %i[ windows jruby ]

# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
gem "solid_cable"
gem "solid_cache"
gem "solid_queue"
gem "solid_cable"

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
Expand Down
19 changes: 19 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ GEM
public_suffix (>= 2.0.2, < 8.0)
ast (2.4.3)
base64 (0.3.0)
bcrypt (3.1.22)
bcrypt_pbkdf (1.1.2)
bigdecimal (4.1.2)
bindex (0.8.1)
Expand Down Expand Up @@ -106,6 +107,12 @@ GEM
debug (1.11.1)
irb (~> 1.10)
reline (>= 0.3.8)
devise (5.0.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 7.0)
responders
warden (~> 1.2.3)
dotenv (3.2.0)
drb (2.2.3)
ed25519 (1.4.0)
Expand Down Expand Up @@ -201,6 +208,7 @@ GEM
racc (~> 1.4)
nokogiri (1.19.4-x86_64-linux-musl)
racc (~> 1.4)
orm_adapter (0.5.0)
ostruct (0.6.3)
parallel (2.1.0)
parser (3.3.11.1)
Expand Down Expand Up @@ -274,6 +282,9 @@ GEM
regexp_parser (2.12.0)
reline (0.6.3)
io-console (~> 0.5)
responders (3.2.1)
actionpack (>= 7.0)
railties (>= 7.0)
rexml (3.4.4)
rubocop (1.88.1)
json (~> 2.3)
Expand Down Expand Up @@ -364,6 +375,8 @@ GEM
unicode-emoji (4.2.0)
uri (1.1.1)
useragent (0.16.11)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.3.0)
actionview (>= 8.0.0)
bindex (>= 0.4.0)
Expand Down Expand Up @@ -395,6 +408,7 @@ DEPENDENCIES
bundler-audit
capybara
debug
devise (~> 5.0)
image_processing (~> 2.0)
importmap-rails
jbuilder
Expand Down Expand Up @@ -432,6 +446,7 @@ CHECKSUMS
addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
bcrypt (3.1.22) sha256=1f0072e88c2d705d94aff7f2c5cb02eb3f1ec4b8368671e19112527489f29032
bcrypt_pbkdf (1.1.2) sha256=c2414c23ce66869b3eb9f643d6a3374d8322dfb5078125c82792304c10b94cf6
bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
bindex (0.8.1) sha256=7b1ecc9dc539ed8bccfc8cb4d2732046227b09d6f37582ff12e50a5047ceb17e
Expand All @@ -445,6 +460,7 @@ CHECKSUMS
crass (1.0.7) sha256=94868719948664c89ddcaf0a37c65048413dfcb1c869470a5f7a7ceb5390b295
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
devise (5.0.4) sha256=d605f2b85854e74e56ee789e2d398702bc2d06e6bcd894717a670a3199c74cc1
dotenv (3.2.0) sha256=e375b83121ea7ca4ce20f214740076129ab8514cd81378161f11c03853fe619d
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
ed25519 (1.4.0) sha256=16e97f5198689a154247169f3453ef4cfd3f7a47481fde0ae33206cdfdcac506
Expand Down Expand Up @@ -493,6 +509,7 @@ CHECKSUMS
nokogiri (1.19.4-arm64-darwin) sha256=a46db9853286e6597b36ebc6953817d15acf3a299583eb3f89fdc6f91dd63527
nokogiri (1.19.4-x86_64-linux-gnu) sha256=379fae440b28915e3f19d752ce2dcf8465ed2b2fbefd2a7ca0dd497bc981a06a
nokogiri (1.19.4-x86_64-linux-musl) sha256=17dfb7c1fa194ae02fbf7c51a7afc8d278045ab3fdacfd86f91d02d7b274470b
orm_adapter (0.5.0) sha256=aa5d0be5d540cbb46d3a93e88061f4ece6a25f6e97d6a47122beb84fe595e9b9
ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356
parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54
Expand All @@ -519,6 +536,7 @@ CHECKSUMS
rdoc (8.0.0) sha256=03bf8c08a9639658855a0cfd77c0abca8325c227693f7f33f82957811348c469
regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
responders (3.2.1) sha256=c2772970cbda654c0e772d852e5a851e82cd8e96f5fa958650861ba75b8ffa84
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
rubocop (1.88.1) sha256=726af773d6bc169ed3ff852f3ca020b7c58d39c34e7a8d879a8e0147cc994f26
rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
Expand Down Expand Up @@ -555,6 +573,7 @@ CHECKSUMS
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844
warden (1.2.9) sha256=46684f885d35a69dbb883deabf85a222c8e427a957804719e143005df7a1efd0
web-console (4.3.0) sha256=e13b71301cdfc2093f155b5aa3a622db80b4672d1f2f713119cc7ec7ac6a6da4
websocket (1.2.11) sha256=b7e7a74e2410b5e85c25858b26b3322f29161e300935f70a0e0d3c35e0462737
websocket-driver (0.8.2) sha256=97c556b019bf3410b4961002ac501621e9322d3f8a7bc02161a09301cc4c4146
Expand Down
Binary file added app/assets/images/horse.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class HomeController < ApplicationController
def index
end

def world
end
end
70 changes: 70 additions & 0 deletions app/controllers/medication_types_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class MedicationTypesController < ApplicationController
before_action :set_medication_type, only: %i[ show edit update destroy ]

# GET /medication_types or /medication_types.json
def index
@medication_types = MedicationType.all
end

# GET /medication_types/1 or /medication_types/1.json
def show
end

# GET /medication_types/new
def new
@medication_type = MedicationType.new
end

# GET /medication_types/1/edit
def edit
end

# POST /medication_types or /medication_types.json
def create
@medication_type = MedicationType.new(medication_type_params)

respond_to do |format|
if @medication_type.save
format.html { redirect_to @medication_type, notice: "Medication type was successfully created." }
format.json { render :show, status: :created, location: @medication_type }
else
format.html { render :new, status: :unprocessable_content }
format.json { render json: @medication_type.errors, status: :unprocessable_content }
end
end
end

# PATCH/PUT /medication_types/1 or /medication_types/1.json
def update
respond_to do |format|
if @medication_type.update(medication_type_params)
format.html { redirect_to @medication_type, notice: "Medication type was successfully updated.", status: :see_other }
format.json { render :show, status: :ok, location: @medication_type }
else
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @medication_type.errors, status: :unprocessable_content }
end
end
end

# DELETE /medication_types/1 or /medication_types/1.json
def destroy
@medication_type.destroy!

respond_to do |format|
format.html { redirect_to medication_types_path, notice: "Medication type was successfully destroyed.", status: :see_other }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_medication_type
@medication_type = MedicationType.find(params.expect(:id))
end

# Only allow a list of trusted parameters through.
def medication_type_params
params.expect(medication_type: [ :name ])
end
end
70 changes: 70 additions & 0 deletions app/controllers/medications_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class MedicationsController < ApplicationController
before_action :set_medication, only: %i[ show edit update destroy ]

# GET /medications or /medications.json
def index
@medications = Medication.all
end

# GET /medications/1 or /medications/1.json
def show
end

# GET /medications/new
def new
@medication = Medication.new
end

# GET /medications/1/edit
def edit
end

# POST /medications or /medications.json
def create
@medication = Medication.new(medication_params)

respond_to do |format|
if @medication.save
format.html { redirect_to @medication, notice: "Medication was successfully created." }
format.json { render :show, status: :created, location: @medication }
else
format.html { render :new, status: :unprocessable_content }
format.json { render json: @medication.errors, status: :unprocessable_content }
end
end
end

# PATCH/PUT /medications/1 or /medications/1.json
def update
respond_to do |format|
if @medication.update(medication_params)
format.html { redirect_to @medication, notice: "Medication was successfully updated.", status: :see_other }
format.json { render :show, status: :ok, location: @medication }
else
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @medication.errors, status: :unprocessable_content }
end
end
end

# DELETE /medications/1 or /medications/1.json
def destroy
@medication.destroy!

respond_to do |format|
format.html { redirect_to medications_path, notice: "Medication was successfully destroyed.", status: :see_other }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_medication
@medication = Medication.find(params.expect(:id))
end

# Only allow a list of trusted parameters through.
def medication_params
params.expect(medication: [ :name, :medication_type_id, :current, :dosage, :frequency, :time_of_day, :form, :purpose, :start_date, :stop_date, :refill, :notes ])
end
end
70 changes: 70 additions & 0 deletions app/controllers/people_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class PeopleController < ApplicationController
before_action :set_person, only: %i[ show edit update destroy ]

# GET /people or /people.json
def index
@people = Person.all
end

# GET /people/1 or /people/1.json
def show
end

# GET /people/new
def new
@person = Person.new
end

# GET /people/1/edit
def edit
end

# POST /people or /people.json
def create
@person = Person.new(person_params)

respond_to do |format|
if @person.save
format.html { redirect_to @person, notice: "Person was successfully created." }
format.json { render :show, status: :created, location: @person }
else
format.html { render :new, status: :unprocessable_content }
format.json { render json: @person.errors, status: :unprocessable_content }
end
end
end

# PATCH/PUT /people/1 or /people/1.json
def update
respond_to do |format|
if @person.update(person_params)
format.html { redirect_to @person, notice: "Person was successfully updated.", status: :see_other }
format.json { render :show, status: :ok, location: @person }
else
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @person.errors, status: :unprocessable_content }
end
end
end

# DELETE /people/1 or /people/1.json
def destroy
@person.destroy!

respond_to do |format|
format.html { redirect_to people_path, notice: "Person was successfully destroyed.", status: :see_other }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_person
@person = Person.find(params.expect(:id))
end

# Only allow a list of trusted parameters through.
def person_params
params.expect(person: [ :first_name, :last_name, :date_of_birth, :social_security_number, :email, :relationship_id ])
end
end
2 changes: 2 additions & 0 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module HomeHelper
end
2 changes: 2 additions & 0 deletions app/helpers/medication_types_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module MedicationTypesHelper
end
2 changes: 2 additions & 0 deletions app/helpers/medications_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module MedicationsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/people_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module PeopleHelper
end
3 changes: 3 additions & 0 deletions app/models/medication.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Medication < ApplicationRecord
belongs_to :medication_type
end
2 changes: 2 additions & 0 deletions app/models/medication_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class MedicationType < ApplicationRecord
end
3 changes: 3 additions & 0 deletions app/models/person.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Person < ApplicationRecord
belongs_to :relationship
end
2 changes: 2 additions & 0 deletions app/models/relationship.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Relationship < ApplicationRecord
end
Loading
Loading