Module: CulHydraModels::Common
- Extended by:
- ActiveSupport::Concern
- Included in:
- Collection, Concept, ContentAggregator, GenericResource
- Defined in:
- app/models/concerns/cul_hydra_models/common.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#label=(new_label) ⇒ Object
A Fedora object label can only contain a string value of up to 255 characters.
Instance Method Details
#label=(new_label) ⇒ Object
A Fedora object label can only contain a string value of up to 255 characters. If we try to set a longer value, it causes errors upon object save. Truncate labels to 255 characters. Note: this method maps to a method_missing hanlder that converts input into a String, so we use the super method first, and then post-process the output of that super method call.
18 19 20 21 |
# File 'app/models/concerns/cul_hydra_models/common.rb', line 18 def label=(new_label) super(new_label) super(self.label[0, 255]) end |