Sha256: e9f16bf2e11edccb976167c23d10ddc7ca8b8e7e6d60030fe497fcbcc0224586

Contents?: true

Size: 1.45 KB

Versions: 5

Compression:

Stored size: 1.45 KB

Contents

require 'activefacts/api'

module ::SchoolActivities

  class ActivityName < String
    value_type :length => 32
    one_to_one :activity                        # See Activity.activity_name
  end

  class SchoolName < String
    value_type 
    one_to_one :school                          # See School.school_name
  end

  class StudentName < String
    value_type 
    one_to_one :student                         # See Student.student_name
  end

  class Activity
    identified_by :activity_name
    one_to_one :activity_name, :mandatory => true  # See ActivityName.activity
  end

  class School
    identified_by :school_name
    one_to_one :school_name, :mandatory => true  # See SchoolName.school
  end

  class SchoolActivity
    identified_by :school, :activity
    has_one :activity, :mandatory => true       # See Activity.all_school_activity
    has_one :school, :mandatory => true         # See School.all_school_activity
  end

  class Student
    identified_by :student_name
    has_one :school, :mandatory => true         # See School.all_student
    one_to_one :student_name, :mandatory => true  # See StudentName.student
  end

  class StudentParticipation
    identified_by :student, :activity
    has_one :activity, :mandatory => true       # See Activity.all_student_participation
    has_one :school, :mandatory => true         # See School.all_student_participation
    has_one :student, :mandatory => true        # See Student.all_student_participation
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activefacts-examples-1.9.9 ruby/SchoolActivities.rb
activefacts-examples-1.9.8 ruby/SchoolActivities.rb
activefacts-examples-1.8.0 ruby/SchoolActivities.rb
activefacts-examples-1.7.2 ruby/SchoolActivities.rb
activefacts-examples-1.7.1 ruby/SchoolActivities.rb