Sha256: 15be5dd8815aaff4b625a5c853449561980ae322b1845d7a9b69e0d796c79185

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

class Developer < ActiveRecord::Base
  has_and_belongs_to_many :projects
  has_and_belongs_to_many :special_projects, :join_table => 'developers_projects', :association_foreign_key => 'project_id'

  validates_inclusion_of :salary, :in => 50000..200000
  validates_length_of    :name, :within => 3..20
end

DeveloperSalary = Struct.new(:amount)
class DeveloperWithAggregate < ActiveRecord::Base
  self.table_name = 'developers'
  composed_of :salary, :class_name => 'DeveloperSalary', :mapping => [%w(salary amount)]
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-1.12.2 test/fixtures/developer.rb
activerecord-1.12.1 test/fixtures/developer.rb