Class: ActiveFolder::Base
Class Method Summary
collapse
Instance Method Summary
collapse
build, create, create!, destroy_all, find_or_create, find_or_initialize
#all, #count, #find, #find!, #first, #last, #to_a, #where
Class Method Details
.model_base_dir ⇒ Object
21
|
# File 'lib/activefolder/base.rb', line 21
def model_base_dir; '/' end
|
.model_class ⇒ Object
20
|
# File 'lib/activefolder/base.rb', line 20
def model_class; self; end
|
.model_name ⇒ Object
15
16
17
18
|
# File 'lib/activefolder/base.rb', line 15
def model_name
model = name.demodulize
model.underscore.pluralize
end
|
Instance Method Details
#attributes ⇒ Object
29
30
31
|
# File 'lib/activefolder/base.rb', line 29
def attributes
self.to_h.except(:name, :base_dir)
end
|
#path ⇒ Object
24
25
26
27
|
# File 'lib/activefolder/base.rb', line 24
def path
required(:name); required(:base_dir)
File.join(base_dir, name)
end
|