-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/instrument type and instrument #74
Conversation
agwozdowski
commented
Sep 28, 2019
•
edited
Loading
edited
- Added InstrumentType to "Laws" menu. Implemented also soft-delete for it.
- Instrument model, migration, resource, form, soft-delete
- Added instruments to Legislation model and views
@@ -41,4 +41,15 @@ def document_links | |||
title: document.external? ? document.url : nil | |||
end | |||
end | |||
|
|||
def instrument_links | |||
return [] if model.instruments.empty? |
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.
I think you want to check model.instruments.nil?
here or remove this check completely because instruments.map
will handle empty array.
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.
Removed this if. Take a look please
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.
Not sure if we want all our models to be soft-deletable? cc @simaob
describe 'DELETE destroy' do | ||
let!(:instrument) { create(:instrument, discarded_at: nil) } | ||
|
||
context 'with valid pspec/factories/instrument_types.rb:16arams' 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.
some accidental ctrl-v here
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.
🕵️♂️
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.
:D thanks @tsubik !
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.
👍