-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix all standardrb errors and warnings #168
Changes from all commits
ca7d268
6e625e3
b9c26e2
ae23e4f
8ce6c8d
dfed987
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,23 +8,25 @@ def index | |
end | ||
|
||
# GET /schools/1 or /schools/1.json | ||
def show; end | ||
def show | ||
end | ||
Comment on lines
-11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the single lines aesthetically, but I'm not going to fight the standardrb defaults over it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :D Now you're feeling that "unconfigurable configuration" vibe. |
||
|
||
# GET /schools/new | ||
def new | ||
@school = School.new | ||
end | ||
|
||
# GET /schools/1/edit | ||
def edit; end | ||
def edit | ||
end | ||
|
||
# POST /schools or /schools.json | ||
def create | ||
@school = School.new(school_params) | ||
|
||
respond_to do |format| | ||
if @school.save | ||
format.html { redirect_to school_url(@school), notice: 'School was successfully created.' } | ||
format.html { redirect_to school_url(@school), notice: "School was successfully created." } | ||
format.json { render :show, status: :created, location: @school } | ||
else | ||
format.html { render :new, status: :unprocessable_entity } | ||
|
@@ -37,7 +39,7 @@ def create | |
def update | ||
respond_to do |format| | ||
if @school.update(school_params) | ||
format.html { redirect_to school_url(@school), notice: 'School was successfully updated.' } | ||
format.html { redirect_to school_url(@school), notice: "School was successfully updated." } | ||
format.json { render :show, status: :ok, location: @school } | ||
else | ||
format.html { render :edit, status: :unprocessable_entity } | ||
|
@@ -51,7 +53,7 @@ def destroy | |
@school.destroy! | ||
|
||
respond_to do |format| | ||
format.html { redirect_to schools_url, notice: 'School was successfully destroyed.' } | ||
format.html { redirect_to schools_url, notice: "School was successfully destroyed." } | ||
format.json { head :no_content } | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class Classroom < ApplicationRecord | ||
belongs_to :year | ||
belongs_to :school | ||
has_many :users | ||
has_many :users, dependent: :nullify | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought through the alternative arguments to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also suspect we may end up with a join model here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 Yeah, I can see that |
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ class PortfolioStock < ApplicationRecord | |
def calculate_earnings | ||
# based on purchase price | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class School < ApplicationRecord | ||
has_many :school_years | ||
has_many :school_years, dependent: :destroy | ||
has_many :years, through: :school_years | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
class Teacher < User | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, useful