class Humpyard::Element

Humpyard::Element is a model of an element to display on a Humpyard::Page.



Elements can be shared on other pages. this adds unshared?, shared_on_siblings?, shared_on_children? getters plus to_unshared, to_shared_on_siblings, to_shared_on_children “setters”

Public Instance Methods

last_modified() click to toggle source

Return the logical modification time for the element.

   # File app/models/humpyard/element.rb
48 def last_modified
49   rails_root_mtime ="#{Rails.root}").mtime)
50   timestamps = [rails_root_mtime, self.updated_at]
51   timestamps.sort.last
52 end
stamp_page_modified_now() click to toggle source
   # File app/models/humpyard/element.rb
22 def stamp_page_modified_now
23   # Set page's modified_at to now without changing it's last_updated_at column
24   Page.update_all ['modified_at = ?',], ['id = ?',]
26   # TODO: set other pages' modified_at if element is shared
27 end