- # Custom JSON output routine for notes
- def to_json(options = {})
- super options.reverse_merge(
- :methods => [ :lat, :lon ],
- :only => [ :id, :status, :created_at ],
- :include => {
- :comments => {
- :only => [ :event, :author_name, :created_at, :body ]
- }
- }
- )
+private
+
+ # Fill in default values for new notes
+ def set_defaults
+ self.status = "open" unless self.attribute_present?(:status)