Sha256: da93f18ed6fcdfedb3dd099148d31f47a05e2a6dd97bd5d16029069094096f44
Contents?: true
Size: 611 Bytes
Versions: 89
Compression:
Stored size: 611 Bytes
Contents
# When extending an ActiveRecord::Base model class, you can mix this module # into the extending class to make it behave like it was the original one # in terms of it's model_name identity. # # Note that you have to mix this in directly into the first class inheriting # from your real model class. module RailsOps::ModelMixins::ArExtension extend ActiveSupport::Concern included do class_attribute :extended_record_base_class self.extended_record_base_class = superclass end module ClassMethods def model_name (extended_record_base_class || superclass).model_name end end end
Version data entries
89 entries across 89 versions & 1 rubygems