mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 19:23:59 -04:00
16 lines
308 B
Ruby
16 lines
308 B
Ruby
class Crop < ActiveRecord::Base
|
|
extend FriendlyId
|
|
friendly_id :system_name, use: :slugged
|
|
attr_accessible :en_wikipedia_url, :system_name
|
|
has_many :scientific_names
|
|
|
|
def Crop.random
|
|
@crop = Crop.offset(rand(Crop.count)).first
|
|
return @crop
|
|
end
|
|
|
|
def to_s
|
|
return system_name
|
|
end
|
|
end
|