Permalink
Browse files

update Ticket methods

  • Loading branch information...
1 parent 4f4b596 commit e1ec8810c848cde0bb5742caf8ad1cbc5701556b @ana-ci ana-ci committed Jan 9, 2011
Showing with 6 additions and 13 deletions.
  1. +5 −1 lib/provider/project.rb
  2. +1 −12 lib/provider/ticket.rb
View
@@ -23,6 +23,10 @@ def id
self[:slug]
end
+ def identifier
+ self[:identifier]
+ end
+
def name
self[:title]
end
@@ -41,7 +45,7 @@ def ticket!(*options)
def tickets(*options)
begin
if options.first.is_a? Hash
- options[0].merge!(:params => {:slug => id})
+ options[0].merge!(:params => {:slug => slug})
super(*options)
elsif options.empty?
tickets = CodasetAPI::Ticket.find(:all, :params => {:slug => slug}).collect { |ticket| TicketMaster::Provider::Codaset::Ticket.new ticket }
View
@@ -25,9 +25,7 @@ def initialize(*object)
end
def self.create(*options)
- puts 'create'
issue = API.new(options.first.merge!(:state => 'new'))
- puts issue
ticket = self.new issue
issue.save
ticket
@@ -37,11 +35,6 @@ def self.find_by_id(project_id, ticket_id)
self.new API.find(ticket_id)
end
- def self.find_by_attributes(project_id, attributes = {})
- tickets = API.find(:all, build_attributes(project_id, attributes))
- tickets.collect { |issue| self.new issue }
- end
-
def created_at
@created_at ||= self[:created_at] ? Time.parse(self[:created_at]) : nil
end
@@ -50,12 +43,8 @@ def updated_at
@updated_at ||= self[:updated_at] ? Time.parse(self[:updated_at]) : nil
end
- def slug
- self.prefix_options[:slug]
- end
-
def id
- id
+ self[:id].to_i
end
#TODO?

0 comments on commit e1ec881

Please sign in to comment.