Sha256: 0c7889b0e5e30b2c014699acac22ef2e6bdc71533bb8faaa12988d8bac91b1a8

Contents?: true

Size: 251 Bytes

Versions: 3

Compression:

Stored size: 251 Bytes

Contents

class League
  include Mongoid::Document

  field :name, :type => String
  include Mongoid::Timestamps

  has_many :divisions, :foreign_key => 'custom_league_id'

  validates_presence_of(:name)

  def custom_name
    "League '#{self.name}'"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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