Permalink
Browse files

Set :child_key to avoid DM warnings

  • Loading branch information...
1 parent 5390f5a commit b8b8cb83cf0dd647090a6ca6765aa818817801c0 @sr sr committed Apr 5, 2009
Showing with 11 additions and 6 deletions.
  1. +2 −1 lib/integrity/build.rb
  2. +5 −2 lib/integrity/commit.rb
  3. +4 −3 lib/integrity/notifier.rb
@@ -11,7 +11,8 @@ class Build
property :started_at, DateTime
property :completed_at, DateTime
- belongs_to :commit, :class_name => "Integrity::Commit"
+ belongs_to :commit, :class_name => "Integrity::Commit",
+ :child_key => [:commit_id]
def self.pending
all(:started_at => nil)
@@ -10,8 +10,11 @@ class Commit
property :created_at, DateTime
property :updated_at, DateTime
- has 1, :build, :class_name => "Integrity::Build", :order => [:created_at.desc]
- belongs_to :project, :class_name => "Integrity::Project"
+ has 1, :build, :class_name => "Integrity::Build",
+ :order => [:created_at.desc]
+
+ belongs_to :project, :class_name => "Integrity::Project",
+ :child_key => [:project_id]
def message
attribute_get(:message) || "<Commit message not loaded>"
@@ -6,10 +6,11 @@ class Notifier
property :id, Integer, :serial => true
property :name, String, :nullable => false
- property :enabled, Boolean, :nullable => false, :default => false
- property :config, Yaml, :nullable => false, :lazy => false
+ property :enabled, Boolean, :nullable => false, :default => false
+ property :config, Yaml, :nullable => false, :lazy => false
- belongs_to :project, :class_name => "Integrity::Project"
+ belongs_to :project, :class_name => "Integrity::Project",
+ :child_key => [:project_id]
validates_is_unique :name, :scope => :project_id
validates_present :project_id

0 comments on commit b8b8cb8

Please sign in to comment.