update documentation

This commit is contained in:
Lee Lawlor
2014-02-28 13:57:58 -05:00
parent b8f2410d5f
commit 4b83bfc3cf
84 changed files with 2037 additions and 85 deletions

View File

@ -81,6 +81,11 @@ class Channel < ActiveRecord::Base
cattr_reader :per_page
@@per_page = 15
# write key for a channel
def write_api_key
self.api_keys.where(:write_flag => true).first.api_key
end
# select options
def select_options
only = [:name, :created_at, :updated_at, :id, :last_entry_id]

View File

@ -33,6 +33,13 @@ class Feed < ActiveRecord::Base
attr_readonly :created_at
# for to_xml, return only the public attributes
def self.public_options
{
:except => [:id, :updated_at]
}
end
# only output these fields for feed
def self.select_options(channel, params)
only = [:created_at]
@ -96,7 +103,7 @@ class Feed < ActiveRecord::Base
# custom json output
def as_json(options = {})
super(options.merge(:except => [:updated_at, :id]))
super(Feed.public_options)
end
# check if a field value is a number