lib/zendesk2/help_center/article.rb in zendesk2-1.8.1 vs lib/zendesk2/help_center/article.rb in zendesk2-1.9.0
- old
+ new
@@ -43,25 +43,31 @@
# @return [Integer] The total sum of votes on this article
attribute :vote_sum, type: :integer # ro:yes required:no
assoc_accessor :section, collection: :help_center_sections
+ def translations
+ requires :identity
+
+ cistern.help_center_translations(source_id: self.identity, source_type: "Article")
+ end
+
def save!
response = if new_record?
requires :title, :locale, :section_id
- service.create_help_center_article("article" => self.attributes)
+ cistern.create_help_center_article("article" => self.attributes)
else
requires :identity
- service.update_help_center_article("article" => self.attributes)
+ cistern.update_help_center_article("article" => self.attributes)
end
merge_attributes(response.body["article"])
end
def destroy!
requires :identity
- service.destroy_help_center_article("article" => { "id" => self.identity })
+ cistern.destroy_help_center_article("article" => { "id" => self.identity })
end
end