File: ship.rb

package info (click to toggle)
rails 2.3.5-1.2%2Bsqueeze8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 18,248 kB
  • ctags: 20,944
  • sloc: ruby: 122,413; makefile: 72; sql: 43; sh: 1
file content (10 lines) | stat: -rw-r--r-- 306 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
class Ship < ActiveRecord::Base
  self.record_timestamps = false

  belongs_to :pirate
  has_many :parts, :class_name => 'ShipPart', :autosave => true

  accepts_nested_attributes_for :pirate, :allow_destroy => true, :reject_if => proc { |attributes| attributes.empty? }

  validates_presence_of :name
end