Skip to content

Commit 91ea82a

Browse files
committed
inline tag creation
Issue zendesk#113
1 parent dcbb47a commit 91ea82a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/zendesk_api/resources.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Tag < DataResource
3131
include Destroy
3232

3333
alias :name :id
34+
alias :to_param :id
3435

3536
def path(opts = {})
3637
raise "tags must have parent resource" unless association.options.parent
@@ -113,7 +114,7 @@ class Organization < Resource
113114

114115
has_many Ticket
115116
has_many User
116-
has_many Tag, :extend => Tag::Update
117+
has_many Tag, :extend => Tag::Update, :inline => :create
117118
end
118119

119120
class ForumSubscription < Resource
@@ -169,7 +170,7 @@ def attributes_for_save
169170
has_many :comments, :class => TopicComment
170171
has_many :subscriptions, :class => TopicSubscription
171172
has :vote, :class => TopicVote
172-
has_many Tag, :extend => Tag::Update
173+
has_many Tag, :extend => Tag::Update, :inline => :create
173174

174175
def votes(opts = {})
175176
return @votes if @votes && !opts[:reload]
@@ -322,7 +323,7 @@ def save
322323
has :last_comment, :class => Comment, :inline => true
323324
has_many :last_comments, :class => Comment, :inline => true
324325

325-
has_many Tag, :extend => Tag::Update
326+
has_many Tag, :extend => Tag::Update, :inline => :create
326327

327328
has_many :incidents, :class => Ticket
328329

0 commit comments

Comments
 (0)