Skip to content

Commit

Permalink
Copyright presentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCarlino committed Sep 29, 2021
1 parent d2cf068 commit f497102
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/mutations/sequences/publish.rb
Expand Up @@ -34,12 +34,13 @@ def validate
def execute
ActiveRecord::Base.transaction do
desc = description || sequence.description
cr = copyright || sequence.copyright
publication.update!(published: true)
sv = SequenceVersion.create!(sequence_publication: publication,
name: sequence.name,
color: sequence.color,
description: desc,
copyright: copyright)
copyright: cr)
celery = Sequences::Show.run!(sequence: sequence)
params = celery.deep_symbolize_keys.slice(:kind, :body, :args).merge(device: device)
flat_ast = Fragments::Preprocessor.run!(**params)
Expand Down
2 changes: 1 addition & 1 deletion app/mutations/sequences/show.rb
Expand Up @@ -67,7 +67,7 @@ def is_forked?
end

def copyright
sequence_version&.copyright || ""
sequence.copyright || sequence_version&.copyright
end

def available_version_ids
Expand Down
1 change: 1 addition & 0 deletions app/mutations/sequences/update.rb
Expand Up @@ -36,6 +36,7 @@ class Update < Mutations::Command
boolean :pinned
boolean :forked
string :description
string :copyright
end

def validate
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20210929220719_add_copyright_to_sequence.rb
@@ -0,0 +1,5 @@
class AddCopyrightToSequence < ActiveRecord::Migration[6.1]
def change
add_column :sequences, :copyright, :string, limit: 1500
end
end
6 changes: 4 additions & 2 deletions db/structure.sql
Expand Up @@ -886,7 +886,8 @@ CREATE TABLE public.sequences (
pinned boolean DEFAULT false,
description text,
forked boolean DEFAULT false,
sequence_version_id bigint
sequence_version_id bigint,
copyright character varying(1500)
);


Expand Down Expand Up @@ -3740,6 +3741,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20210901215214'),
('20210913175949'),
('20210914194342'),
('20210917165755');
('20210917165755'),
('20210929220719');


0 comments on commit f497102

Please sign in to comment.