Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/parole.rb
Direct Known Subclasses
Class Method Summary collapse
- .acts_as_comment(*args) ⇒ Object
- .acts_as_commentable(options = {}) ⇒ Object
- .acts_as_commentable? ⇒ Boolean
Instance Method Summary collapse
Class Method Details
.acts_as_comment(*args) ⇒ Object
25 26 27 |
# File 'lib/parole.rb', line 25 def self.acts_as_comment(*args) include Parole::Comment end |
.acts_as_commentable(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/parole.rb', line 10 def self.acts_as_commentable( = {}) Parole.commentable_classes << self class_attribute :commentable_options, :actually_acts_as_commentable self.actually_acts_as_commentable = true self. = .reverse_merge(roles: []) self.[:roles] = [:roles].map(&:to_s) include Parole::Commentable end |
.acts_as_commentable? ⇒ Boolean
21 22 23 |
# File 'lib/parole.rb', line 21 def self.acts_as_commentable? self.respond_to?(:actually_acts_as_commentable) && self.actually_acts_as_commentable end |
Instance Method Details
#commentable? ⇒ Boolean
29 30 31 |
# File 'lib/parole.rb', line 29 def commentable? self.class.acts_as_commentable? end |