Sha256: b3bcda762a5a2ddce10b9873a3a2d3d1e73862879aad0d7767f5c4129effa980

Contents?: true

Size: 232 Bytes

Versions: 2

Compression:

Stored size: 232 Bytes

Contents

class Ball
  include Mongoid::Document
  include Mongoid::Timestamps

  field :color, :type => String

  validates_presence_of :color, :on => :create

  def to_param
    color.present? ? color.downcase.gsub(" ", "-") : id
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_admin-0.6.0 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.5.0 spec/dummy_app/app/mongoid/ball.rb