Sha256: 0cbb8e32123a7b70bd7cbc76de7891242dd874f792ec60331cd44c0bacb53462

Contents?: true

Size: 333 Bytes

Versions: 13

Compression:

Stored size: 333 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

13 entries across 13 versions & 2 rubygems

Version Path
test_fish0-0.2.0 lib/fish0/concerns/view_model.rb
fish0-0.2.0 lib/fish0/concerns/view_model.rb
fish0-0.1.2 lib/fish0/concerns/view_model.rb
fish0-0.1.1 lib/fish0/concerns/view_model.rb
fish0-0.1.0 lib/fish0/concerns/view_model.rb
fish0-0.0.18 lib/fish0/concerns/view_model.rb
fish0-0.0.17 lib/fish0/concerns/view_model.rb
fish0-0.0.16 lib/fish0/concerns/view_model.rb
fish0-0.0.15 lib/fish0/concerns/view_model.rb
fish0-0.0.14 lib/fish0/concerns/view_model.rb
fish0-0.0.13 lib/fish0/concerns/view_model.rb
fish0-0.0.12 lib/fish0/concerns/view_model.rb
fish0-0.0.11 lib/fish0/concerns/view_model.rb