lib/temping.rb in temping-3.8.0 vs lib/temping.rb in temping-3.9.0
- old
+ new
@@ -45,19 +45,19 @@
end
private
def build
- Class.new(model_parent_class).tap do |klass|
+ Class.new(@options.fetch(:parent_class, default_parent_class)).tap do |klass|
Object.const_set(@model_name, klass)
klass.primary_key = @options[:primary_key] || :id
create_table(@options)
add_methods
end
end
- def model_parent_class
+ def default_parent_class
if ActiveRecord::VERSION::MAJOR > 4 && defined?(ApplicationRecord)
ApplicationRecord
else
ActiveRecord::Base
end