Sha256: 50f4b6e3cc9e1b7ff861976922fd79924b04dd20c4642f69fd9c314174f8975e

Contents?: true

Size: 258 Bytes

Versions: 16

Compression:

Stored size: 258 Bytes

Contents

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

  field :color, :type => String

  attr_accessible :color

  validates_presence_of :color, :on => :create

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

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
rails_admin-0.4.9 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.8 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.7 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.6 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.5 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.4 spec/dummy_app/app/mongoid/ball.rb
rails_admin-lbgraham-0.4.2 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.3 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.2 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.1 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.4.0 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.3.0 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.2.0 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.1.2 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.1.1 spec/dummy_app/app/mongoid/ball.rb
rails_admin-0.1.0 spec/dummy_app/app/mongoid/ball.rb