Sha256: c764422a08c0751bc87fa50d5e337652e7394b42e916a39046aedca09571a115
Contents?: true
Size: 757 Bytes
Versions: 1
Compression:
Stored size: 757 Bytes
Contents
module ActsAsComment module InstanceMethods # Before saving, store the comment label as as reply of the commentable label. This especially useful # when representing context origin (i.e. a syndicated comment feed). def auto_label # Set up defaults and custom options (if any). options = self.class.acts_as_comment_options || {} options.reverse_merge! :commentable_label => "label", :comment_label => "label" # Default the comment label to the commentable label. if self.instance_eval("self.#{options[:comment_label]}").blank? && commentable && commentable.respond_to?(options[:commentable_label]) instance_eval("self.#{options[:comment_label]} = "RE: " + commentable.#{options[:commentable_label]}") end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aeonscope-acts_as_commentable-1.0.0 | lib/instance_methods.rb |