Atualizando para o Rails 2.3.2
This commit is contained in:
@@ -58,6 +58,6 @@ class Course < ActiveRecord::Base
|
||||
|
||||
def to_param
|
||||
return self.short_name if self.period == App.current_period
|
||||
return self.id
|
||||
return self.id.to_s
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,7 +19,7 @@ class Event < ActiveRecord::Base
|
||||
# Plugins
|
||||
acts_as_paranoid
|
||||
acts_as_versioned :if_changed => [ :title, :description, :time ]
|
||||
self.non_versioned_fields << 'deleted_at'
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
|
||||
# Associacoes
|
||||
belongs_to :course
|
||||
|
||||
@@ -19,7 +19,7 @@ class Message < ActiveRecord::Base
|
||||
# Plugins
|
||||
acts_as_paranoid
|
||||
acts_as_versioned :if_changed => [ :title, :body ]
|
||||
self.non_versioned_fields << 'deleted_at'
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
|
||||
# Associacoes
|
||||
belongs_to :user,
|
||||
|
||||
@@ -80,7 +80,7 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def to_param
|
||||
self.login.match(/^[-_a-z0-9]*$/i).nil? ? self.id : self.login
|
||||
self.login.match(/^[-_a-z0-9]*$/i).nil? ? self.id.to_s : self.login
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
@@ -23,7 +23,8 @@ class WikiPage < ActiveRecord::Base
|
||||
acts_as_paranoid
|
||||
acts_as_list :scope => 'course_id = #{course_id}'
|
||||
acts_as_versioned :if_changed => [ :content, :description, :title ]
|
||||
self.non_versioned_fields << 'position'
|
||||
self.non_versioned_columns << 'position'
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
|
||||
# Associacoes
|
||||
belongs_to :course
|
||||
@@ -34,7 +35,6 @@ class WikiPage < ActiveRecord::Base
|
||||
validates_uniqueness_of :title, :scope => :course_id
|
||||
validates_format_of :title, :with => /^[^0-9]/
|
||||
|
||||
|
||||
def validate
|
||||
begin
|
||||
to_html
|
||||
@@ -48,7 +48,7 @@ class WikiPage < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def to_param
|
||||
self.title.match(/^[-_a-z0-9]*$/i).nil? ? self.id : self.title
|
||||
self.title.match(/^[-_a-z0-9]*$/i).nil? ? self.id.to_id : self.title
|
||||
end
|
||||
|
||||
def WikiPage.diff(from, to)
|
||||
|
||||
Reference in New Issue
Block a user