1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/application_record.rb
2019-08-18 06:19:45 +05:00

21 lines
506 B
Ruby

# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
def self.has_many(*args)
options = args.extract_options!
options[:dependent] ||= :restrict_with_exception
super(*args, options)
end
def self.has_one(*args)
options = args.extract_options!
options[:dependent] ||= :restrict_with_exception
super(*args, options)
end
def self.pg_enum(name, values)
enum name => values.map { |s| [s.to_sym, s.to_s] }.to_h
end
end