There was a minor copy-paste issue with publisher_public and publisher_explain methods. Fix it and do a little refactoring of the publisher's code.
19 lines
460 B
Ruby
19 lines
460 B
Ruby
class Publisher
|
|
attr_accessor :user, :open, :prefill, :public, :explain
|
|
|
|
def initialize(user, opts={})
|
|
self.user = user
|
|
self.open = opts[:open]
|
|
self.prefill = opts[:prefill]
|
|
self.public = opts[:public]
|
|
self.explain = opts[:explain]
|
|
end
|
|
|
|
def text
|
|
return unless prefill.present?
|
|
Diaspora::MessageRenderer.new(
|
|
prefill,
|
|
mentioned_people: Diaspora::Mentionable.people_from_string(prefill)
|
|
).plain_text
|
|
end
|
|
end
|