Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 90dce9c8b7
Fetching contributors…

Cannot retrieve contributors at this time

13 lines (9 sloc) 0.422 kb
class Employee < ActiveRecord::Base
scope :boss, :conditions => "position = 'Boss'"
scope :country, lambda { |country| { :conditions => ["country = ?", country] } }
end
20.times do |n|
position = (n == 0) ? "Boss" : "Worker"
salary = (n == 0) ? 100000 : (((n+1) % 5) * 10000)
Employee.create(:name => "Employee #{n}", :country => "Country #{(n % 10) + 1}", :position => position, :salary => salary)
end
Jump to Line
Something went wrong with that request. Please try again.