Module: ActiveRecord::Acts::MuckBlog::InstanceMethods

Defined in:
lib/active_record/acts/muck_blog.rb

Overview

All the methods available to a record that has had acts_as_muck_blog specified.

Instance Method Summary collapse

Instance Method Details

#can_add_content?(user) ⇒ Boolean

Determines whether or not the given user has the right to add content to the blog Override this method to change permissions. Currently this method looks to the parent object and calls ‘can_edit?’ to determine whether or not the user can edit the content

Returns:

  • (Boolean)


60
61
62
# File 'lib/active_record/acts/muck_blog.rb', line 60

def can_add_content?(user)
  blogable.can_edit?(user)
end

#get_blog_scopeObject

Setup the scope for this content object



45
46
47
48
49
50
51
52
53
54
# File 'lib/active_record/acts/muck_blog.rb', line 45

def get_blog_scope
  if self.blogable_id > 0 && !self.blogable_type.blank?
    self.class.blogable_to_scope(self.blogable)
  else
    ''
  end
rescue
  debugger
  t = 0
end