Class: Note

Inherits:
Node
  • Object
show all
Defined in:
app/models/note.rb

Overview

A note is a ‘dated’ element. It is typically used for blog entries or/and calendar events.

dates

On top of the Node’s dates (created_at, updated_at, publish_from), a note uses the following:

log_at

used to sort/display blog entries

event_at

used in calendars

These two dates enable you to announce an event in the blog list a couple of days before it actually occurs (event_at). All dates are stored internally as ‘utc’ and are converted to/from the visitor’s current timezone.

Default links for Notes are:

calendars

make this note appear in the given calendar (there is one calendar per project). By default the note is not included in its project’s calendar.

projects

make this note appear in the blog of the given project. A note always appear in its project.

subclasses

subclasses to implement before 1.0

Task

manage things to be done (parent = Note = Todo). The parent provides the ‘due date’.

Letter

like the name says…

Request

subclass of Todo. Manage user/client requests.

Bug

(the class we most need!). subclass of Request.

Milestone

special event used when choosing a Request/Bug’s parent.

Constant Summary

Constants inherited from Node

Node::VERSION_ATTRIBUTES

Constants included from Zena::Use::Workflow

Zena::Use::Workflow::WORKFLOW_ATTRIBUTES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#all_relations, allowed_change_to_classes, #archive, #asset_path, #author, author_proc, auto_create_discussion, #can_auto_create_discussion?, #can_comment?, change_to_classes_for_form, class_for_relation, classes_for_form, #comments, #comments_count, #content_lang, create_node, create_nodes_from_folder, create_or_update_node, #data, #discussion, #dyn_attribute_keys, #empty?, #export_to_folder, extract_archive, find_by_parent_title_and_kpath, find_by_title, find_by_zip, find_node_by_pseudo, #find_node_by_pseudo, get_attributes_from_yaml, get_class, #get_discussion_id, #get_project_id, get_role, #get_section_id, inherited, inspect, #klass, #klass=, #klass_changed?, #kpath_match?, kpath_match?, kpaths_for_form, load_unhandled_children, #m_author, #m_author=, #m_text, #m_text=, #m_title, #m_title=, make_schema, #merge_multi_errors, native_classes, native_classes_by_name, new, #new_child, new_node, #o_skin, #o_user, #parent, #parent_zip, #parent_zip=, #parse_assets, #parse_keys, plural_relation?, #project, #project_zip, #real_project, #real_section, #reload, #replace_attributes_in_values, #safe_method_type, #safe_send, #section, #section_zip, #skin, #skin_zip, #skin_zip=, #sweep_cache, #to_yaml, transform_attributes, translate_pseudo_id, #unparse_assets, #update_attributes_with_transformation, #user, #user_zip, #v_number, #vclass, #versions_with_secure, #virtual_class, #virtual_class=, #vkind_of?, zafu_attribute, #zafu_versions

Methods included from Zena::Use::Search::NodeClassMethods

#match_query, #search_index, #search_records, #search_text

Methods included from Zena::Acts::Secure

#secure_scope, #secure_write_scope, #visitor=

Methods included from Zena::Acts::Secure::SecureResult

#construct_id_map, #secure_result

Methods included from Zena::Acts::SecureNode

#acts_as_secure_node

Methods included from Zena::Use::QueryNode::ModelMethods

#db_attr, #find, included, #safe_first, #start_node_zip

Methods included from Zena::Use::ScopeIndex::ModelMethods

included, #rebuild_index_with_scope_index!, #rebuild_scope_index!, #scope_index, scope_index_proc

Methods included from Zena::Use::Relations::ModelMethods

#add_link, #all_relations, included, #l_comment, #l_comment=, #l_date, #l_date=, #l_status, #l_status=, #link_id, #link_id=, #linked_node, #linked_node=, #rel, #rel=, #rel_attributes=, #relation_alias, #relation_links, #relation_proxy, #relation_proxy_from_link, #relations_for_form, #remove_link

Methods included from Zena::Use::Fulltext::ModelMethods

included, #rebuild_index_for_version_with_fulltext

Methods included from Zena::Use::PropEval::ModelMethods

included, #merge_prop_eval, #need_set__id, #rebuild_index_for_version_with_prop_eval, #set__id

Methods included from Zena::Use::VersionHash::ModelMethods

#rebuild_vhash, #version, #version_id, #vhash, #visible_versions

Methods included from Zena::Acts::Serializable::ModelMethods

#all_link_ids, #default_serialization_options, #export_ids, #export_properties, included, #to_xml

Methods included from Zena::Use::Ancestry::ModelMethods

#ancestors, #basepath, #fullpath_as_title, included, #is_ancestor?, #pseudo_id, #short_path, #z_ancestors

Methods included from Zena::Use::Workflow

#after_all, #apply, #apply_with_callbacks, #can_apply?, #can_destroy_version?, #can_edit?, #can_propose?, #can_publish?, #can_refuse?, #can_remove?, #can_unpublish?, #can_update?, #destroy_version, #edit_content!, #get_publish_from, included, #propose, #publish, #redit, #refuse, #remove, #set_current_transition, #traductions, #transition_allowed?, #transition_for, #unpublish, #update_attributes, #would_change_original?

Methods included from Zena::Use::NestedAttributesAlias::ModelMethods

#attributes_with_nested_alias=, included, #nested_model_names_for_alias, #resolve_attributes_alias

Methods included from Zena::Acts::Enrollable::ModelMethods

#assigned_roles, #has_role?, included, #zafu_possible_roles

Methods included from Zena::Use::FieldIndex::ModelMethods

included, #property_field_index

Methods included from Zena::Use::MLIndex::ModelMethods

included, #index_reader, #rebuild_index_for_version, #rebuild_index_with_multi_lingual!

Methods included from Zena::Use::Kpath::InstanceMethods

included

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zena::Use::Relations::ModelMethods

Class Method Details

.select_classesObject



33
34
35
36
37
38
39
40
# File 'app/models/note.rb', line 33

def select_classes
  list = subclasses.inject([]) do |list, k|
    next if k.to_s == 'Post'
    list << k.to_s
    list
  end.sort
  list.unshift 'Post'
end

Instance Method Details

#export_keysObject



43
44
45
46
47
# File 'app/models/note.rb', line 43

def export_keys
  h = super
  h[:dates].merge!('log_at' => log_at, 'event_at' => event_at)
  h
end