Skip to content
Browse files

Removed some old code in preparation for upgrade to newest CouchRest.

  • Loading branch information...
1 parent 696f138 commit e460110195dbac72279387d7f3ae78e69eb08b3d @topfunky committed Apr 29, 2009
Showing with 21 additions and 61 deletions.
  1. +21 −61 app/models/note.rb
View
82 app/models/note.rb
@@ -1,24 +1,24 @@
class Note < CouchRest::ExtendedDocument
-# def default_attributes
-# {
-# "title" => nil,
-# "description" => nil,
-# "tags" => [],
-# "visited_on" => Time.now.strftime('%Y/%m/%d')
-# }
-# end
-
- ##
- # Coerce fields into the proper types of objects.
-
- def on_update
- if (tags = @attributes['tags']) && tags.is_a?(String)
- @attributes['tags'] = tags.split(" ")
- end
- end
-
-
+ # def default_attributes
+ # {
+ # "title" => nil,
+ # "description" => nil,
+ # "tags" => [],
+ # "visited_on" => Time.now.strftime('%Y/%m/%d')
+ # }
+ # end
+
+ # ##
+ # # Coerce fields into the proper types of objects.
+
+ # def on_update
+ # if (tags = @attributes['tags']) && tags.is_a?(String)
+ # @attributes['tags'] = tags.split(" ")
+ # end
+ # end
+
+ # unique_id :slug
use_database SERVER.default_database
@@ -37,10 +37,6 @@ def on_update
}
}"
}
- # :reduce =>
- # "function(keys, values, rereduce) {
- # return sum(values);
- # }"
view_by :tag, {
:map =>
@@ -56,7 +52,7 @@ def on_update
return {'tag':key[0][0], 'count':values.length};
}"
}
-
+
view_by :updated_at, {
:map =>
"function(doc) {
@@ -65,7 +61,7 @@ def on_update
}
}"
}
-
+
view_by :visited_on, {
:map =>
"function(doc) {
@@ -74,41 +70,5 @@ def on_update
}
}"
}
-
- ###############
-
-
-# unique_id :slug
-
-# view_by :date, :descending => true
-# view_by :user_id, :date
-
-# view_by :tags, {
-# :map =>
-# "function(doc) {
-# if (doc['couchrest-type'] == 'Article' && doc.tags) {
-# doc.tags.forEach(function(tag){
-# emit(tag, 1);
-# });
-# }
-# }",
-# :reduce =>
-# "function(keys, values, rereduce) {
-# return sum(values);
-# }"
-# }
-
-# property :date
-# property :slug, :read_only => true
-# property :title
-# property :tags
-
-# timestamps!
-
-# save_callback :before, :generate_slug_from_title
-
-# def generate_slug_from_title
-# self['slug'] = title.downcase.gsub(/[^a-z0-9]/,'-').squeeze('-').gsub(/^\-|\-$/,'') if new_document?
-# end
end

0 comments on commit e460110

Please sign in to comment.
Something went wrong with that request. Please try again.