diff options
author | Raphael Sofaer <raphael@joindiaspora.com> | 2011-06-14 03:31:40 +0400 |
---|---|---|
committer | Raphael Sofaer <raphael@joindiaspora.com> | 2011-06-14 03:31:40 +0400 |
commit | 7171aa05ed017e173b641b863390c5e71aa8c8ae (patch) | |
tree | a2aa25d628e212208f03052b02e6c1d685185e21 /lib | |
parent | 4815482354988b5c9661a6677e73a9c409a74cf6 (diff) |
Do a little bit more documenting.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/diaspora/guid.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/diaspora/guid.rb b/lib/diaspora/guid.rb index 728752434..7ea870152 100644 --- a/lib/diaspora/guid.rb +++ b/lib/diaspora/guid.rb @@ -1,10 +1,13 @@ module Diaspora::Guid + # Creates a before_create callback which calls #set_guid and makes the guid serialize in to_xml def self.included(model) model.class_eval do before_create :set_guid xml_attr :guid end end + + # @return [String] The model's guid. def set_guid self.guid ||= ActiveSupport::SecureRandom.hex(8) end |