Sha256: 646a4e7c1bd9347e68bdc03d33f08562669ec9da06431a245cea45cbdb9cacdb
Contents?: true
Size: 1.04 KB
Versions: 2
Compression:
Stored size: 1.04 KB
Contents
class User < ActiveRecord::Base has_many :tasks has_many :categories end class Category < ActiveRecord::Base belongs_to :user has_many :tasks end class Task < ActiveRecord::Base belongs_to :user belongs_to :category end class Buyer < ActiveRecord::Base self.table_name = :users end class Person < ActiveRecord::Base self.table_name = :users end class UserWithTLD include ActiveModel::Validations attr_accessor :url validates_url_format_of :url, tld: true def self.name "User" end def initialize(url) @url = url end end class ServerWithoutTLD include ActiveModel::Validations attr_accessor :host validates_hostname :host def initialize(host) @host = host end end class ServerWithTLD include ActiveModel::Validations attr_accessor :host validates_hostname :host, tld: true def initialize(host) @host = host end end class EmailWithTLD include ActiveModel::Validations attr_accessor :email validates_email :email, tld: true def initialize(email) @email = email end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
validators-2.8.1 | test/support/models.rb |
validators-2.8.0 | test/support/models.rb |