Class: MarkdownRecord::Base
- Inherits:
-
Object
- Object
- MarkdownRecord::Base
show all
- Includes:
- ActiveAttr::Model, Associations
- Defined in:
- app/models/markdown_record/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#children, #class_siblings, #fragment, #siblings
#base_content_root_name, #base_rendered_path, #base_rendered_root, #clean_path, #erb_locals_from_path, #fragment_attributes_from_path, #full_path_to_parts, #path_to_fragment_id, #remove_prefix, #rendered_path, #scoped_id_to_parts, #to_scoped_id
Class Method Details
.json_klass ⇒ Object
23
24
25
|
# File 'app/models/markdown_record/base.rb', line 23
def self.json_klass
name.underscore
end
|
.new_association(base_filters = {}, search_filters = {}) ⇒ Object
15
16
17
|
# File 'app/models/markdown_record/base.rb', line 15
def self.new_association(base_filters = {}, search_filters = {})
MarkdownRecord::Association.new(base_filters, search_filters)
end
|
Instance Method Details
#fragment_id ⇒ Object
19
20
21
|
# File 'app/models/markdown_record/base.rb', line 19
def fragment_id
Pathname.new(subdirectory).join(filename).to_s
end
|
#model_name ⇒ Object
27
28
29
|
# File 'app/models/markdown_record/base.rb', line 27
def model_name
OpenStruct.new param_key: type
end
|
#to_key ⇒ Object
31
32
33
|
# File 'app/models/markdown_record/base.rb', line 31
def to_key
scope.nil? ? [id] : ["#{scope}::id"]
end
|