Class: CamaleonCms::PostComment

Inherits:
CamaleonRecord show all
Extended by:
NormalizeAttrs
Includes:
CommonRelationships, Metas
Defined in:
app/models/camaleon_cms/post_comment.rb

Constant Summary

Constants inherited from CamaleonRecord

CamaleonRecord::TRANSLATION_TAG_HIDE_MAP, CamaleonRecord::TRANSLATION_TAG_HIDE_REGEX, CamaleonRecord::TRANSLATION_TAG_HIDE_SENTINELS, CamaleonRecord::TRANSLATION_TAG_RESTORE_MAP, CamaleonRecord::TRANSLATION_TAG_RESTORE_REGEX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from NormalizeAttrs

normalize_attrs

Methods included from Metas

#delete_meta, #delete_option, #fix_save_metas_options_no_changed, #get_meta, #get_option, #options, #save_metas_options, #save_metas_options_skip, #set_meta, #set_metas, #set_option, #set_options

Methods inherited from CamaleonRecord

#ability, #cama_build_cache_key, #cama_fetch_cache, #cama_get_cache, #cama_remove_cache, cama_sanitize_translatable, #cama_set_cache, #can?, #current_site, #current_user, polymorphic_class_for, polymorphic_name, #reset_ability

Instance Attribute Details

#is_anonymousObject

attr_accessible :user_id, :post_id, :content, :author, :author_email, :author_url, :author_IP, :approved, :agent, :agent, :typee, :comment_parent, :is_anonymous



11
12
13
# File 'app/models/camaleon_cms/post_comment.rb', line 11

def is_anonymous
  @is_anonymous
end

Instance Method Details

#comment_userObject

return the owner of this comment



38
39
40
# File 'app/models/camaleon_cms/post_comment.rb', line 38

def comment_user
  user
end

#is_approved?Boolean

check if this comments is already approved

Returns:

  • (Boolean)


43
44
45
# File 'app/models/camaleon_cms/post_comment.rb', line 43

def is_approved?
  approved == 'approved'
end