Sha256: 2d11a2c2e7d28d9b83c97bfe30baa65a3215d5b762db9426bc0b5c5aee1d6817

Contents?: true

Size: 468 Bytes

Versions: 14

Compression:

Stored size: 468 Bytes

Contents

require "typus/orm/mongo/class_methods"

class Hit

  extend Typus::Orm::Mongo::ClassMethods

  if defined?(Mongoid)
    include Mongoid::Document

    field :name
    field :description

    validates_presence_of :name
    validates_uniqueness_of :name
  else
    extend ActiveModel::Naming
  end

  def self.typus_fields_for(*args)
    [[:name, :string], [:description, :text]]
  end

  def self.model_fields
    [[:name, :string], [:description, :text]]
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
typus-3.0.11.rc5 test/fixtures/rails_app/app/models/hit.rb
typus-3.0.11.rc4 test/fixtures/rails_app/app/models/hit.rb
typus-3.0.11.rc3 test/fixtures/rails_app/app/models/hit.rb
typus-3.1.0.rc7 test/fixtures/rails_app/app/models/hit.rb
typus-3.1.0.rc6 test/fixtures/rails_app/app/models/hit.rb
typus-3.1.0.rc5 test/fixtures/rails_app/app/models/hit.rb
typus-3.1.0.rc4 test/fixtures/rails_app/app/models/hit.rb
typus-3.1.0.rc3 test/fixtures/rails_app/app/models/hit.rb
typus-3.1.0.rc2 test/fixtures/rails_app/app/models/hit.rb
typus-3.0.11.rc2 test/fixtures/rails_app/app/models/hit.rb
typus-3.0.11.rc1 test/fixtures/rails_app/app/models/hit.rb
typus-3.1.0.rc1 test/fixtures/rails_app/app/models/hit.rb
typus-3.0.10 test/fixtures/rails_app/app/models/hit.rb
typus-3.0.9 test/fixtures/rails_app/app/models/hit.rb