+ terms = characterization_terms
Sufia.config.fits_to_desc_mapping.each_pair do |k, v|
- if terms.has_key?(k)
- # coerce to array to remove a conditional
- terms[k] = [terms[k]] unless terms[k].is_a? Array
- terms[k].each do |term_value|
- proxy_term = self.send(v)
- if proxy_term.kind_of?(Array)
- proxy_term << term_value unless proxy_term.include?(term_value)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make a new rails application and drop this file in. | |
# | |
# Run from the command line with just plain ruby: | |
# bundle exec ruby doit.rb | |
# | |
# Run from the command line with rails: | |
# bundle exec rails runner "eval(File.read 'doit.rb')" | |
require 'active_fedora/noid' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'delegator' | |
require 'stringio' | |
Class IoDelegator < SimpleDelegator | |
attr :mime_type, :original_name | |
end | |
a = StringIO.new | |
b = IoDelegator.new(b) |
def help_icon
- content_tag 'i', '', :'aria-hidden' => true, class: 'help-icon'
+ content_tag 'i', '', 'aria-hidden' => true, class: 'help-icon'
end
Can this be aria-hidden: true
?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `ingress` ( | |
`ing_index` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
`mrn` varchar(9) DEFAULT NULL, | |
`originalvial` int(10) unsigned DEFAULT NULL, | |
PRIMARY KEY (`ing_index`) | |
) ENGINE=InnoDB AUTO_INCREMENT=187434 DEFAULT CHARSET=utf8; | |
CREATE TABLE `norminv` ( | |
`pni_index` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
`mrn` varchar(9) DEFAULT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started POST "/works" for 127.0.0.1 at 2015-06-19 13:43:50 -0400 | |
Processing by CurationConcern::GenericWorksController#create as HTML | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"qL/V+XGs8GE8s0pwc5i30BZbuJP6xqVCMxp6YeRrnkKaZaTZrDW1+kKMx7mzd0zKggTy32dind3QeDxr7ExTNw==", "generic_work"=>{"resource_type"=>["", "Other"], "title"=>["EmptyWork"], "creator"=>["Colin A. Gross"], "contributor"=>[""], "description"=>[""], "tag"=>["blue"], "rights"=>["", "http://creativecommons.org/licenses/by/3.0/us/"], "publisher"=>[""], "date_created"=>[""], "subject"=>[""], "language"=>[""], "identifier"=>[""], "based_near"=>[""], "related_url"=>[""]}, "visibility"=>"open", "new_user_name_skel"=>"", "new_user_permission_skel"=>"none", "new_group_name_skel"=>"Select a group", "new_group_permission_skel"=>"none", "save_without_files"=>"Save without Files"} | |
User Load (4.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 2]] | |
(3.9ms) SELECT DISTINCT COUNT(DISTINCT "mailboxe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started POST "/files" for 127.0.0.1 at 2015-06-19 13:33:25 -0400 | |
Processing by GenericFilesController#create as JSON | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"n9jfvt5RMoUnka3usBxfJJzPtUh09+OK5tjR5f/FxX+tAq6eA8h3HlmuICdw86Q+CJD/BOlT2xUFupfv9+IICg==", "total_upload_size"=>"3458", "relative_path"=>"", "batch_id"=>"rj430457n", "work_id"=>"", "file_coming_from"=>"local", "terms_of_service"=>"1", "files"=>[#<ActionDispatch::Http::UploadedFile:0x007f36f3997718 @tempfile=#<Tempfile:/tmp/RackMultipart20150619-14610-1cuzuj7.txt>, @original_filename="teach_data_concepts.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"files[]\"; filename=\"teach_data_concepts.txt\"\r\nContent-Type: text/plain\r\n">]} | |
User Load (4.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 2]] | |
(3.6ms) SELECT DISTINCT COUNT(DISTINCT "mailboxer_conversations"."id") FROM "mailboxer_conversations" INNER JOIN "mailboxer_notifications" ON "mailboxer_no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ldp::HttpError in CurationConcern::GenericWorksController#create | |
STATUS: 500 ... | |
Extracted source (around line #108): | |
106 | |
107 | |
108 | |
109 | |
110 | |
111 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failures: | |
1) CurationConcern::GenericWorkActor#create valid attributes with a file authenticated visibility should stamp each file with the access rights | |
Failure/Error: expect(subject.create).to be true | |
ActiveFedora::UnknownAttributeError: | |
GenericFile does not have an attribute `generic_work_id' | |
# /home/grosscol/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/active-fedora-9.1.1/lib/active_fedora/attributes.rb:103:in `array_setter' | |
# /home/grosscol/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/active-fedora-9.1.1/lib/active_fedora/attributes.rb:66:in `[]=' | |
# /home/grosscol/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/active-fedora-9.1.1/lib/active_fedora/associations/has_many_association.rb:51:in `set_owner_attributes' | |
# /home/grosscol/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/active-fedora-9.1.1/lib/active_fedora/associations/has_many_association.rb:57:in `insert_record' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In feature branch to get GenericWork to top level class in Sufia, and | |
Sufia::Works::Work and Sufia::Works::Generic work as Concern in branch: | |
https://github.com/grosscol/sufia/tree/pcdm_1086 | |
rspec Failures: | |
1) CurationConcern::GenericWorkActor#create valid attributes with a file authenticated visibility should stamp each file with the access rights | |
Failure/Error: expect(subject.create).to be true | |
ActiveFedora::UnknownAttributeError: | |
GenericFile does not have an attribute `generic_work_id' |