Class: ElVfs::Entry
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ElVfs::Entry
- Defined in:
- app/models/el_vfs/entry.rb
Class Method Summary collapse
Instance Method Summary collapse
- #directories ⇒ Object
- #duplicate ⇒ Object
- #el_hash ⇒ Object
- #files ⇒ Object
- #target ⇒ Object
- #to_s ⇒ Object (also: #inspect)
- #url ⇒ Object
Class Method Details
Instance Method Details
#directories ⇒ Object
13 14 15 |
# File 'app/models/el_vfs/entry.rb', line 13 def directories children.only_directories end |
#duplicate ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'app/models/el_vfs/entry.rb', line 33 def duplicate Entry.transaction do dup.tap do | entry | entry.update_attributes! :entry_name => entry.duplicate_name self.copy_descendants_to(entry) end end end |
#el_hash ⇒ Object
25 26 27 |
# File 'app/models/el_vfs/entry.rb', line 25 def el_hash el_entry.merge() end |
#files ⇒ Object
17 18 19 |
# File 'app/models/el_vfs/entry.rb', line 17 def files children.only_files end |
#target ⇒ Object
29 30 31 |
# File 'app/models/el_vfs/entry.rb', line 29 def target entry_path_hash end |
#to_s ⇒ Object Also known as: inspect
46 47 48 |
# File 'app/models/el_vfs/entry.rb', line 46 def to_s entry_path end |
#url ⇒ Object
42 43 44 |
# File 'app/models/el_vfs/entry.rb', line 42 def url ::Rails.application.routes.url_helpers.entry_url(self, ::Rails.application.config.action_mailer[:default_url_options]) end |