Sha256: 80c49cd3d49276156a90f16c67ac17451346d7f6198cf41ce81081f4bcd3d89f

Contents?: true

Size: 284 Bytes

Versions: 6

Compression:

Stored size: 284 Bytes

Contents

class Vehicle < ActiveRecord::Base
  attr_accessible :name, :mass unless Rails::VERSION::MAJOR > 3
  cti_base_class
  
  validates :name, :presence => true  
  validate do |vehicle|
    errors.add(:base, "Block validation failed: name can't be blank") if vehicle.name.blank?
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dbview_cti-0.2.3 spec/dummy-rails-3/app/models/vehicle.rb
dbview_cti-0.2.2 spec/dummy-rails-3/app/models/vehicle.rb
dbview_cti-0.2.1 spec/dummy-rails-3/app/models/vehicle.rb
dbview_cti-0.2.0 spec/dummy-rails-3/app/models/vehicle.rb
dbview_cti-0.1.5 spec/dummy-rails-3/app/models/vehicle.rb
dbview_cti-0.1.4 spec/dummy-rails-3/app/models/vehicle.rb