I don't think there's going to be a "better" way that the dup
, type=
approach. You could create a class method on Project that you can then use whenever you need to create a project:
class Project < BaseProject
def new_from_template(template)
project = template.dup
project.type = 'Project'
project
end
end
Then you would just need to use this:
project = Project.new_from_template(ProjectTemplate.first)