Class: WebammToRails::Sources::Models::AttachmentDefinition::Presenter
- Inherits:
-
Object
- Object
- WebammToRails::Sources::Models::AttachmentDefinition::Presenter
- Defined in:
- lib/webamm_to_rails/sources/models/attachment_definition/presenter.rb
Instance Method Summary collapse
-
#initialize(column:) ⇒ Presenter
constructor
A new instance of Presenter.
- #render ⇒ Object
Constructor Details
#initialize(column:) ⇒ Presenter
Returns a new instance of Presenter.
6 7 8 |
# File 'lib/webamm_to_rails/sources/models/attachment_definition/presenter.rb', line 6 def initialize(column:) @column = column end |
Instance Method Details
#render ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/webamm_to_rails/sources/models/attachment_definition/presenter.rb', line 10 def render if @column.name == @column.name.pluralize "has_many_attached :#{@column.name}" else "has_one_attached :#{@column.name}" end end |