|
|
|
@ -47,9 +47,12 @@ class Story < Issue |
|
|
|
|
def self.create_and_position(params) |
|
|
|
|
attribs = params.select{|k,v| k != 'prev_id' and k != 'id' and Story.column_names.include? k } |
|
|
|
|
attribs = Hash[*attribs.flatten] |
|
|
|
|
s = Story.new(attribs) |
|
|
|
|
s.move_after(params['prev_id']) if s.save |
|
|
|
|
return s |
|
|
|
|
|
|
|
|
|
Story.new(attribs).tap do |s| |
|
|
|
|
if s.save |
|
|
|
|
s.move_after(params['prev_id']) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def self.find_all_updated_since(since, project_id) |
|
|
|
@ -132,12 +135,13 @@ class Story < Issue |
|
|
|
|
def update_and_position!(params) |
|
|
|
|
attribs = params.select{|k,v| k != 'id' and Story.column_names.include? k } |
|
|
|
|
attribs = Hash[*attribs.flatten] |
|
|
|
|
result = journalized_update_attributes attribs |
|
|
|
|
|
|
|
|
|
journalized_update_attributes(attribs).tap do |result| |
|
|
|
|
if result and params[:prev] |
|
|
|
|
reload |
|
|
|
|
move_after(params[:prev]) |
|
|
|
|
end |
|
|
|
|
result |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def rank=(r) |
|
|
|
|