Remove embargo date when object is not embargoed
Remove embargo date when object is not embargoed
Merge branch 'feature/HYDRASIR-296' of github.com:projecthydra-labs/curate into feature/HYDRASIR-296
Better fix for moving works from embargo to public

Undo previous changes to app/repository_models/curation_concern/embargoable.rb
and implement a simpler and better fix for users not being able to
move a work from embargoed status to open/public.  The problem is
that the setter method for embargo_release_date= gets called twice
and on the second call it adds the embargo date again to
@embargo_release_date.  So I added a conditional that only sets
@embargo_release_date once (to nil) if the user is trying to take
something out of embargo.

Fixing embargoable.rb caused some of the embargo tests to break even
though the app was performing as it should.  So I tweaked the tests
accordingly.
Merge pull request #475 from projecthydra-labs/feature/HYDRASIR-296

Remove embargo date when object is not embargoed
Representative value of parent should reset when a rep file is deleted

HYDRASIR-530 #close
Merge pull request #529 from projecthydra-labs/feature/530-reset-representative

Representative value of parent should reset when a rep file is deleted
turbolink prevented javascript and hence gave unneccesary error
Updating gemspec to work for hydra-derivatives
Fixing turbolink issue, autocomplete was not working for searching for works on work show page and class name typo

This commit fixes two stories HYDRASIR-539 and HYDRASIR-525.
Merge pull request #530 from ndlib/hotfix-hydra-derivatives

Updating gemspec to work for hydra-derivatives
Merge pull request #531 from projecthydra-labs/feature/525-fix-related-works-error

Feature/525 fix related works error
Tweaking how future date validation works

The attribute for validation was hard-coded. I believe this was an
artifact of copying the validator from another repository.

While doing this, I removed the custom class, instead creating a
dynamic class that can be disposed of at the cleanup's leasure.
Array#wrap of multi-value input collection

Resolves the following:
    NoMethodError: undefined method `each_with_index' for nil:NilClass
      multi_value_input.rb:14:

Removing MultiValueWithElements input
  * This is something that may need to be tackled later, but for now
    it needs to go as it is interfering with specs
Merge pull request #528 from ndlib/fixing-multi-value-collection-input

Array#wrap of multi-value input collection
Merge pull request #533 from ndlib/fix-validation-text-for-future-date

Tweaking how future date validation works
Adding multi-value presence validation

Given that we are allowing multi-value for a given attribute, we
need to better handle the presence of that attribute.

Consider:

    class MyModel
      # Assume this class supports ActiveModel validations
      validate :contributor, presence: true
    end

    my_model = MyModel.new
    my_model.contributor = ['']
    my_model.valid?
    => true

When in fact we likely mean for it not to be true.

Solution:
    class MyModel
      # Assume this class supports ActiveModel validations
      validate :contributor, multi_value_presence: true
    end

    my_model = MyModel.new
    my_model.contributor = ['']
    my_model.valid?
    => false

[skip ci]
This commit was an amended commit to include a better commit message.
The build that verifies the actual code changes can be found at:
https://travis-ci.org/projecthydra-labs/curate/builds/25186700
Merge pull request #532 from ndlib/fix-validation-on-multi-value

Adding multi-value presence validation
Fixing embargo when visibility is set via default

I am pretending to set a default. In the request cycle we instantiate
the object, then set the attributes via parameters. If the object sets
defaults on instantiation, then this fix ensures that you can set the
embargo release date via the parameters.

Example:

```ruby
class MyModel
  attribute :visibility, default: 'private'
  attribute :embargo_release_date
end

class MyModelsController
  def create
    @my_model = MyModel.new

    @my_model.attributes = params[:my_model]
  end
end
```

@NOTE - It is unlikely that a default embargo visibility and release
date will properly play together.
Merge pull request #534 from ndlib/fixing-embargo-for-default-being-set

Fixing embargo when visibility is set via default