File: thing.rb

package info (click to toggle)
ruby-client-side-validations 3.2.6%2Bgh-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 676 kB
  • sloc: javascript: 3,019; ruby: 2,959; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 271 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
things_table = %{CREATE TABLE things (id INTEGER PRIMARY KEY, name text);}
ActiveRecord::Base.connection.execute(things_table)

class AbstractThing < ActiveRecord::Base
    self.abstract_class = true
end

class Thing < AbstractThing
    validates_uniqueness_of :name
end