Module: Hydra::Presenter::ClassMethods
- Defined in:
- app/presenters/hydra/presenter.rb
Instance Method Summary collapse
-
#multiple?(field) ⇒ Boolean
deprecated
Deprecated.
Because if we use an instance method, there will be no need to set self.model_class in most instances. Note, there is a class method multiple? on the form.
- #terms ⇒ Object
- #terms=(terms) ⇒ Object
- #unique?(field) ⇒ Boolean
Instance Method Details
#multiple?(field) ⇒ Boolean
Deprecated.
Because if we use an instance method, there will be no need to set self.model_class in most instances. Note, there is a class method multiple? on the form.
50 51 52 53 |
# File 'app/presenters/hydra/presenter.rb', line 50 def multiple?(field) Deprecation.warn(ClassMethods, 'The class method multiple? has been deprecated. Use the instance method instead. This will be removed in version 2.0') HydraEditor::FieldMetadataService.multiple?(model_class, field) end |
#terms ⇒ Object
69 70 71 |
# File 'app/presenters/hydra/presenter.rb', line 69 def terms _terms end |
#terms=(terms) ⇒ Object
64 65 66 67 |
# File 'app/presenters/hydra/presenter.rb', line 64 def terms=(terms) self._terms = terms create_term_accessors(terms) end |
#unique?(field) ⇒ Boolean
55 56 57 58 59 60 61 62 |
# File 'app/presenters/hydra/presenter.rb', line 55 def unique?(field) Deprecation.warn(ClassMethods, "The class method unique? has been deprecated. Use the instance method 'multiple?' instead. This will be removed in version 2.0") if reflection = model_class.reflect_on_association(field) !reflection.collection? else model_class.unique?(field) end end |