Sha256: 9dfda06ecde031c8d469ef18c55ebab39de5939e2ce9c21a21faceec4b4525ef
Contents?: true
Size: 1.07 KB
Versions: 6
Compression:
Stored size: 1.07 KB
Contents
# frozen_string_literal: true 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
6 entries across 6 versions & 1 rubygems