Skip to content
Merged
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
69 changes: 69 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"expertise": {
"frameworks": ["Ruby on Rails", "MySQL", "PostgreSQL", "sqlite3", "Hotwire", "Tailwind CSS", "Yarn"],
"components": ["Turbo", "Stimulus"]
},
"codeStyle": {
"general": [
"Write concise, idiomatic Ruby code",
"Follow Rails conventions and best practices",
"Use object-oriented and functional programming patterns",
"Prefer iteration and modularization over duplication"
],
"naming": {
"files": "snake_case",
"methods": "snake_case",
"variables": "snake_case",
"classes": "CamelCase",
"modules": "CamelCase"
}
},
"conventions": {
"ruby": {
"version": "3.x",
"styleGuide": "https://rubystyle.guide/",
"preferences": [
"Use expressive syntax (unless, ||=, &.)",
"Prefer single quotes unless interpolation needed",
"documentation": "https://www.ruby-lang.org/en/documentation/"
]
},
"rails": {
"structure": "MVC with concerns and helpers",
"routing": "RESTful",
"activeRecord": "Use effectively for database operations",
"documentation": "https://guides.rubyonrails.org/"
},
"javascript": {
"preferred": "Hotwire",
"documentation": "https://hotwired.dev/",
"preferences": [
"Use Hotwire (Turbo + Stimulus) instead of complex JavaScript libraries/frameworks",
"Implement JavaScript functionality through Stimulus controllers when possible",
"Use Turbo Drive, Frames and Streams for page updates without full reloads"
]
},
"tailwind": {
"css": "Use Tailwind CSS for styling",
"documentation": "https://tailwindcss.com/docs"
},
"yarn": {
"css": "Use Tailwind CSS for styling",
"documentation": "https://classic.yarnpkg.com/lang/en/docs/"
}
},
"testing": {
"framework": "RSpec",
"approach": "TDD/BDD",
"tools": ["FactoryBot", "Jest"],
"preferences": [
"Use standard RSpec syntax exclusively",
"Avoid shoulda matchers in favor of explicit RSpec expectations",
"Write clear, descriptive test cases that follow RSpec best practices"
]
},
"preferences": {
"architecture": "domain modeling first",
"learning": "visual with analogies"
}
}
37 changes: 0 additions & 37 deletions .dockerignore

This file was deleted.

75 changes: 0 additions & 75 deletions Dockerfile

This file was deleted.

5 changes: 3 additions & 2 deletions app/admin/workshops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# Uncomment all parameters which should be permitted for assignment
#
permit_params :instructor, :last_name, :first_name
permit_params :instructor, :last_name, :first_name, :active
#
# or
#
Expand All @@ -16,11 +16,12 @@
# end

filter :last_name, as: :select

filter :active
index do
selectable_column
actions
id_column
column :active
column :instructor
column :last_name
column :first_name
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def payments_open?
helper_method :payments_open?

def get_workshops
@workshops_available = Workshop.all.order_by_lastname
@workshops_available = Workshop.active.order_by_lastname
end

helper_method :get_workshops
Expand Down
4 changes: 3 additions & 1 deletion app/models/workshop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ class Workshop < ApplicationRecord
validates :first_name, presence: true
validates :last_name, presence: true

scope :active, -> { where(active: true) }

def self.ransackable_associations(auth_object = nil)
[]
end

def self.ransackable_attributes(auth_object = nil)
["created_at", "first_name", "id", "id_value", "instructor", "last_name", "updated_at"]
["created_at", "first_name", "id", "active", "id_value", "instructor", "last_name", "updated_at"]
end

def self.order_by_lastname
Expand Down
13 changes: 11 additions & 2 deletions app/views/applications/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,17 @@
</div>
<div class="form-group row">
<%= f.label :birth_year, 'Year of Birth', class: 'col-sm-3 col-form-label required' %>
<div class="col-sm-9">
<%= f.number_field :birth_year, class: 'form-control' %>
<div class="col-sm-3">
<div class="input-group input-group-sm">
<span class="input-group-text">
<i class="bi bi-calendar"></i>
</span>
<%= f.select :birth_year,
(Time.current.year - 100..Time.current.year).step(1).to_a.reverse,
{ prompt: "Year" },
{ class: 'form-select form-select-sm' } %>
</div>
<small class="form-text text-muted">Select your birth year</small>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
EGdBSHoyjRBr5LIlfWDYynoaQEKA3YnJAPzz+QTgIP15K0a/MGkPKhWaP0isEU9EaogQo/BKkoT2rnarZ7LjnjVK44l/anMKNiqhJp14M7g1KaDtwxfU94tuMHDb7L8xYfxrtXP3vdnobn2ZewePJf89Ky/rP3QpWwcSsw6EQ2XPyHg4MpGMOleLpAZiCKNUGQQNZvftzVRh9Z3MCFuic4mWmnIKBLtWFmOo+CWZJbLpoU9aUWIJ4toTqiWqtPY3mGqsOLNigguTr7sttLMfa9os0Ei/PYLqxpUEapLsTjekiEP7LVRCDRHZIX9gSyQ7JgVkCN3jKPm8d/8pdwcoztowLt49h7EKog+9Q9imHgbO2J8CRXa4r2YAPyo6M5HxWMvTWL/Mv/qRUWhjoA+XTLpP0gLRBIVAVIuitOotlkYvE7qK6fX7LWzuYvOsAuFnoN3wlh1pe855lF/fYb3rsduY2/IrX9i4EA3hk21ifLCwEQHXcqG+9ZXIHoW8btxdqpsx9qYMj8IZXLNkZ9cYncl94TviCk1+poG8rbZ3fXu2pxqPgjq/FDExgU6yhesDiXgS+eZKSQrTBCLNXkJ40da5U+T6zzh73H+Ivlba/mRtPCB6zuWCl5JYopDbVq3AedU+4gEXaEsxELFP8V8V6l67egmx/zKhVbONmKjiCBMXLX0WZjQsIjGtjLIU9dzAamNR70RBFR95XVO+5xqZppD39h6xHwDAxR+L3s9g+h//1zZsBnNOf7jtHFwkGc9oRgyq0jSKSq2O2zES9/2U6tBpyJIM0rTD17uljXVcyLCzFqvZ0l1FPjQb7VA4HNcezbuQgSl8vcKT3h59na4tea0O48CrCUDHBSyOSKcMBMfX2RBu5mauV99V9g==--0ZzcFvheotolNnLx--7/XxooSWkyN37BeKnQmPNQ==
dt7x+sHj4pT6dmwKsRVXdQFRm3Fyon724KTPW96OXnx6GDQ38i9cK9k24gDAi2+Kb37iyhrlyqTR8gghGIMJTs5kx87lVr1I/socltpl4byqi8CecDxKxSDFNXRh+B9U9XRejucIF6FPNc6KzI/5ybpgFPwy82mZEmWO+VH5eDuwe8JEqbtkmZKzLeALsD2EKuQyGbFb32MZnUVTOYmC6S93ThJSYbwevYH5H4FH6NLjmHzD8d1AjYWh/B9pvO7ys1hm1P05yF0A8QC6bDMLblH29ZAIs0eWhKN0a6Ae+bionPqSP98MhUWgRhb2VDAUXdGTtT60ALy6jbpxyVHCEzIn/1yY7SYcVOhSNTROIhKiEN008aonzexFgxFfYjuJoMCFb5JmD4+Kg8oRPoXB3hRnm9JNMDJpBToJvgWPxSZNKUWdv0zywS6TEdWBrDACb1ejow015MpjC5z8iomx/dm3eCXLF3X72QKwc7QQ2y1L6lHzlQj0v4TlmmBaY8kzLVOlR/PPlq3r/UK+P9Wj9Z9cLFXF3TiHaLgLtgtWfD9VeVqu8AHJ+bRZEWPmJA2cQULEcw4bH5sI5MoBvtsGJKMdGGH8+WzslGVZFBTzHSPqdv6gmdmWCoWBjBsbXFbVxqvclE8djrnJXSKMO6zzJDUlJv0hrWiUgjQ5xgcTdD74xF+2K5OJXQN1HdbGS0fafjainXpOdyzMIvzRGlt5iqiKeKb61iJUcCqEFM6d7mcp6xON1dKzH0b0xwCgRb6QamyAeem6iWi2JQB5V2SkjkXJt7V4HZa115Uv87HRq9hNiZRJMnHDd5D6zaO5f8fEjgouJ8foQ6eH14RFx/tcU5G74ywm5U+LB2siQYolqyrrIlJAOYlowZ6nPpJ1E/FEfhi1En2j0IPrKXN1VLSZH06hvtFOEri5n9p6Esr3Lu6eJt47KBLss2mIWsZy9HY=--+btNg5DzqAF8hoIg--GEDJfW0wHUvsu5uUhzeYOg==
5 changes: 5 additions & 0 deletions db/migrate/20250304203447_add_column_to_workshops.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddColumnToWorkshops < ActiveRecord::Migration[7.1]
def change
add_column :workshops, :active, :boolean, default: true
end
end
3 changes: 2 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.