Skip to content

Commit

Permalink
Fixed branch settings issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Ownbey committed Oct 27, 2008
1 parent 91f588a commit da0c2fd
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions app/models/code_comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AlreadyExported < ArgumentError; end
belongs_to :owner, :polymorphic => true
belongs_to :user
belongs_to :code_file
has_many :versions, :dependent => :delete_all
has_many :versions, :dependent => :delete_all, :class_name => 'CommentVersion'

before_update :create_version
after_update :add_export_to_queue
Expand Down Expand Up @@ -48,7 +48,7 @@ def exported_body=(comment)
# Before update, creating the previous version
def create_version
if self.body_changed? && !@dont_version
Version.create(
CommentVersion.create(
:user_id => (self.user_id_changed? ? self.user_id_was : self.user_id),
:body => self.body_was,
:exported => self.exported?,
Expand Down Expand Up @@ -99,13 +99,6 @@ def export! version_number
puts version.body
begin
commit = export(pre_version, version)
rescue
Error.create({
:pre_version => pre_version,
:version => version,
:type => $!.class,
:message => $!.message
})
else
self.without_versioning do
version.exported = true
Expand Down Expand Up @@ -174,7 +167,7 @@ def export v1, v2
@file.close

git = Git.open(RAILS_ROOT + '/code')
git.branch(Setting[:git_branch]).checkout
git.branch(Setting[:branch]).checkout
git.config('user.name', v2.user.try(:login) || 'Docbox')
git.config('user.email', v2.user.try(:email) || '[email protected]')
commit = git.commit_all("Documentation update for #{owner.name}")
Expand Down

0 comments on commit da0c2fd

Please sign in to comment.