coding style

pull/6827/head
Gregor Schmidt 13 years ago
parent 45cd21870d
commit 1fa8cab288
  1. 20
      app/models/story.rb

@ -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
if result and params[:prev]
reload
move_after(params[:prev])
journalized_update_attributes(attribs).tap do |result|
if result and params[:prev]
reload
move_after(params[:prev])
end
end
result
end
def rank=(r)

Loading…
Cancel
Save