Skip to content
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

Merged
merged 8 commits into from
Sep 30, 2019
Merged

Conversation

agwozdowski
Copy link
Contributor

@agwozdowski agwozdowski commented Sep 28, 2019

  • 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

@agwozdowski agwozdowski changed the title Feature/instrument type Feature/instrument type and instrument Sep 29, 2019
@@ -41,4 +41,15 @@ def document_links
title: document.external? ? document.url : nil
end
end

def instrument_links
return [] if model.instruments.empty?
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@tsubik tsubik left a 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
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D thanks @tsubik !

Copy link
Contributor

@tsubik tsubik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@agwozdowski agwozdowski merged commit 0e9abe0 into develop Sep 30, 2019
@agwozdowski agwozdowski deleted the feature/instrument_type branch September 30, 2019 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants