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
validate
Class Method Details
.model_base_dir ⇒ Object
44
|
# File 'lib/activefolder/base.rb', line 44
def model_base_dir; '/' end
|
.model_class ⇒ Object
43
|
# File 'lib/activefolder/base.rb', line 43
def model_class; self; end
|
.model_name ⇒ Object
38
39
40
41
|
# File 'lib/activefolder/base.rb', line 38
def model_name
model = name.to_s.demodulize
model.underscore.pluralize
end
|
Instance Method Details
#attributes ⇒ Object
33
34
35
|
# File 'lib/activefolder/base.rb', line 33
def attributes
self.to_h.except(:name, :base_dir)
end
|
#path ⇒ Object
29
30
31
|
# File 'lib/activefolder/base.rb', line 29
def path
File.join(base_dir, name)
end
|