Sha256: 971f90bccc700af16ddc09d92458313b74b6f6399fef4df92f3fe3e0ffa18621

Contents?: true

Size: 334 Bytes

Versions: 9

Compression:

Stored size: 334 Bytes

Contents

module Fish0
  module Concerns
    module ViewModel
      extend ActiveSupport::Concern

      included do
        include Virtus::Model
        attribute :type, String

        def type
          (super || '').demodulize.underscore
        end

        def to_partial_path
          type.to_s
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fish0-0.0.10 lib/fish0/concerns/view_model.rb
fish0-0.0.9 lib/fish0/concerns/view_model.rb
fish0-0.0.8 lib/fish0/concerns/view_model.rb
fish0-0.0.7 lib/fish0/concerns/view_model.rb
fish0-0.0.6 lib/fish0/concerns/view_model.rb
fish0-0.0.5 lib/fish0/concerns/view_model.rb
fish0-0.0.4 lib/fish0/concerns/view_model.rb
fish0-0.0.3 lib/fish0/concerns/view_model.rb
fish0-0.0.2 lib/fish0/concerns/view_model.rb