lib/brief/document.rb in brief-1.5.2 vs lib/brief/document.rb in brief-1.6.0
- old
+ new
@@ -23,18 +23,12 @@
@raw_content = self.path.read
load_frontmatter
elsif options[:contents]
@raw_content = options[:contents]
end
-
- register_model_instance if self.path && self.path.exist?
end
- def register_model_instance
- model_class.try(:models).try(:<<, to_model) unless model_instance_registered?
- end
-
def raw= val
@raw_set = true
@raw_content = val
#document.load_frontmatter
@raw_content
@@ -169,9 +163,11 @@
def model_class
case
when @model_class
@model_class
+ when briefcase
+ briefcase.model_class_for(self)
when data && data.type
Brief::Model.for_type(data.type)
when parent_folder_name.length > 0
Brief::Model.for_folder_name(parent_folder_name)
else