12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/trello/comment.rb', line 12
class Comment < BasicData
register_attributes :action_id, :text, :date, :member_creator_id,
readonly: [ :action_id, :text, :date, :member_creator_id ]
validates_presence_of :action_id, :text, :date, :member_creator_id
validates_length_of :text, in: 1..16384
class << self
def find(action_id)
client.find(:action, action_id, filter: )
end
end
def update_fields(fields)
attributes[:action_id] = fields['id']
attributes[:text] = fields['data']['text']
attributes[:date] = Time.iso8601(fields['date'])
attributes[:member_creator_id] = fields['idMemberCreator']
self
end
def board
Board.from_response client.get("/actions/#{action_id}/board")
end
def card
Card.from_response client.get("/actions/#{action_id}/card")
end
def list
List.from_response client.get("/actions/#{action_id}/list")
end
def delete
ruta = "/actions/#{action_id}"
client.delete(ruta)
end
one :member_creator, via: Member, path: :members, using: :member_creator_id
end
|