From 96d49bf04ce77c975fe500f4d961e4a1ffed4c26 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 30 Dec 2012 14:43:00 +0200 Subject: Use sdoc to generate application code documentation --- doc/code/classes/Notes/CreateContext.html | 136 ++++++++++++++++++++++++++ doc/code/classes/Notes/LoadContext.html | 157 ++++++++++++++++++++++++++++++ 2 files changed, 293 insertions(+) create mode 100644 doc/code/classes/Notes/CreateContext.html create mode 100644 doc/code/classes/Notes/LoadContext.html (limited to 'doc/code/classes/Notes') diff --git a/doc/code/classes/Notes/CreateContext.html b/doc/code/classes/Notes/CreateContext.html new file mode 100644 index 00000000000..adb3a46fab5 --- /dev/null +++ b/doc/code/classes/Notes/CreateContext.html @@ -0,0 +1,136 @@ + + + + + Notes::CreateContext + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
Methods
+
+ +
E
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Instance Public methods
+ +
+
+ + execute() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/contexts/notes/create_context.rb, line 3
+def execute
+  note = project.notes.new(params[:note])
+  note.author = current_user
+  note.notify = true if params[:notify] == '1'
+  note.notify_author = true if params[:notify_author] == '1'
+  note.save
+  note
+end
+
+
+ +
+
+ +
+ + \ No newline at end of file diff --git a/doc/code/classes/Notes/LoadContext.html b/doc/code/classes/Notes/LoadContext.html new file mode 100644 index 00000000000..24731bc4e7d --- /dev/null +++ b/doc/code/classes/Notes/LoadContext.html @@ -0,0 +1,157 @@ + + + + + Notes::LoadContext + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
Methods
+
+ +
E
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Instance Public methods
+ +
+
+ + execute() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/contexts/notes/load_context.rb, line 3
+def execute
+  target_type = params[:target_type]
+  target_id   = params[:target_id]
+  after_id    = params[:after_id]
+  before_id   = params[:before_id]
+
+
+  @notes = case target_type
+           when "commit"
+             project.commit_notes(project.commit(target_id)).fresh.limit(20)
+           when "issue"
+             project.issues.find(target_id).notes.inc_author.fresh.limit(20)
+           when "merge_request"
+             project.merge_requests.find(target_id).mr_and_commit_notes.inc_author.fresh.limit(20)
+           when "snippet"
+             project.snippets.find(target_id).notes.fresh
+           when "wall"
+             # this is the only case, where the order is DESC
+             project.common_notes.order("created_at DESC, id DESC").limit(50)
+           end
+
+  @notes = if after_id
+             @notes.where("id > ?", after_id)
+           elsif before_id
+             @notes.where("id < ?", before_id)
+           else
+             @notes
+           end
+end
+
+
+ +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.1