Class ImageNote
In: app/models/image_note.rb
Parent: ActiveRecord::Base

Image Notes exist to link the Image class with a variety of classes which are featured as subjects of Image files. For consistency this class should be called ImageSubject. (Or AudioSubject, VideoSubject and ImageNote could be given a new convention according to the terminology chosen for labelling).

Image Notes differ from other labels in that they encapsulate the area of the image which matches a particular subject using a coordinate system.

schema.rb snippet:

  create_table "image_notes", :force => true do |t|
    t.column "image_id",     :integer, :null => false
    t.column "subject_id",   :integer, :null => false
    t.column "subject_type", :string,  :null => false
    t.column "left",         :float
    t.column "top",          :float
    t.column "width",        :float
    t.column "height",       :float
  end

Methods

<=>  

Included Modules

Comparable

Public Instance methods

Notes are currently sorted left to right. Notes which have no co-ordinates come after those with them (in no particular order).

[Source]

    # File app/models/image_note.rb, line 26
26:   def <=>(other)
27:     (self.left.nil? ? 101 : self.left) <=> (other.left.nil? ? 101 : other.left)
28:   end

[Validate]