-
Notifications
You must be signed in to change notification settings - Fork 265
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
Speed up entry creation (#400) #491
Speed up entry creation (#400) #491
Conversation
…of new record and add model test for scope added
@@ -46,6 +46,16 @@ | |||
end | |||
end | |||
|
|||
describe "#by_last_updated_at" do | |||
it "orders the entries by updated_at" do |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -46,6 +46,16 @@ | |||
end | |||
end | |||
|
|||
describe "#by_last_updated_at" do |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -90,6 +90,16 @@ | |||
end | |||
end | |||
|
|||
describe "#by_last_updated_at" do | |||
it "orders the entries by updated_at" do |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -90,6 +90,16 @@ | |||
end | |||
end | |||
|
|||
describe "#by_last_updated_at" do |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
= f.association :project, required: true, collection: Project.unarchived.by_name, label: false, placeholder: t("entries.index.project") | ||
= f.input :value, required: true, as: :integer, label:false, placeholder: t("entries.index.mileages") | ||
= f.association :project, required: true, collection: Project.unarchived.by_name, label: false, placeholder: t("entries.index.project"), selected: @last_mileage_logged&.project_id || @mileages_entry&.project_id | ||
= f.input :value, required: true, as: :integer, label:false, placeholder: t("entries.index.mileages"), input_html: { value: @last_mileage_logged&.value || @mileages_entry&.value } |
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.
Avoid using instance variables in partials views
Line is too long. [181/80]
= f.input :value, required: true, label: false, placeholder: t("entries.index.hours") | ||
= f.association :project, required: true, collection: Project.unarchived.by_name, label: false, placeholder: t("entries.index.project"), selected: @last_hour_logged&.project_id || @hours_entry&.project_id | ||
= f.association :category, required: true, collection: Category.by_name, label: false, placeholder: t("entries.index.category"), selected: @last_hour_logged&.category_id || @hours_entry&.category_id | ||
= f.input :value, required: true, label: false, placeholder: t("entries.index.hours"), input_html: { value: @last_hour_logged&.value || @hours_entry&.value } |
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.
Avoid using instance variables in partials views
Line is too long. [159/80]
= f.association :category, required: true, collection: Category.by_name, label: false, placeholder: t("entries.index.category") | ||
= f.input :value, required: true, label: false, placeholder: t("entries.index.hours") | ||
= f.association :project, required: true, collection: Project.unarchived.by_name, label: false, placeholder: t("entries.index.project"), selected: @last_hour_logged&.project_id || @hours_entry&.project_id | ||
= f.association :category, required: true, collection: Category.by_name, label: false, placeholder: t("entries.index.category"), selected: @last_hour_logged&.category_id || @hours_entry&.category_id |
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.
Avoid using instance variables in partials views
Line is too long. [200/80]
= f.association :project, required: true, collection: Project.unarchived.by_name, label: false, placeholder: t("entries.index.project") | ||
= f.association :category, required: true, collection: Category.by_name, label: false, placeholder: t("entries.index.category") | ||
= f.input :value, required: true, label: false, placeholder: t("entries.index.hours") | ||
= f.association :project, required: true, collection: Project.unarchived.by_name, label: false, placeholder: t("entries.index.project"), selected: @last_hour_logged&.project_id || @hours_entry&.project_id |
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.
Avoid using instance variables in partials views
Line is too long. [206/80]
@@ -14,6 +14,7 @@ | |||
|
|||
class Mileage < Entry | |||
scope :by_last_created_at, -> { order("created_at DESC") } | |||
scope :by_last_updated_at, -> { order("updated_at DESC") } |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -27,6 +27,7 @@ class Hour < Entry | |||
accepts_nested_attributes_for :taggings | |||
|
|||
scope :by_last_created_at, -> { order("created_at DESC") } | |||
scope :by_last_updated_at, -> { order("updated_at DESC") } |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
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.
Looks good to me
We've decided to freeze feature development as none of the maintainers currently have time to properly steward contributions from the community. |
What does this PR do?
Description of Task to be completed?
How should this be manually tested?
hours
andkilometers
creation forms are prefilled with last created or updatedhour
orkilometer
respectively.hour
orkilometer
entry, the selected entry is properly updatedAny background context you want to provide?
What are the relevant issues?
Screenshots (if appropriate)
Questions: