acts_as_paranoid_versioned and routes
This commit is contained in:
@@ -19,7 +19,7 @@ class String
|
||||
def format_wiki
|
||||
text = BlueCloth.new(self).to_html
|
||||
text = Hpricot(text, :xhtml_strict => true).to_s
|
||||
return text.sanitize
|
||||
return text.sanitize unless text.blank?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -20,7 +20,12 @@ class Event < ActiveRecord::Base
|
||||
# Plugins
|
||||
acts_as_paranoid
|
||||
acts_as_versioned :if_changed => [ :title, :description, :time ]
|
||||
acts_as_paranoid_versioned
|
||||
|
||||
#acts_as_paranoid_versioned
|
||||
self.versioned_class.class_eval do
|
||||
def self.delete_all(conditions = nil); return; end
|
||||
end
|
||||
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
|
||||
# Associacoes
|
||||
|
||||
@@ -21,7 +21,11 @@ class Message < ActiveRecord::Base
|
||||
acts_as_paranoid
|
||||
acts_as_versioned :if_changed => [ :title, :body ]
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
acts_as_paranoid_versioned
|
||||
|
||||
#acts_as_paranoid_versioned
|
||||
self.versioned_class.class_eval do
|
||||
def self.delete_all(conditions = nil); return; end
|
||||
end
|
||||
|
||||
# Associacoes
|
||||
belongs_to :user,
|
||||
|
||||
@@ -25,7 +25,6 @@ class WikiPage < ActiveRecord::Base
|
||||
acts_as_paranoid
|
||||
acts_as_list :scope => 'course_id = #{course_id}'
|
||||
acts_as_versioned :if_changed => [ :content, :description, :title ]
|
||||
acts_as_paranoid_versioned
|
||||
self.non_versioned_columns << 'front_page'
|
||||
self.non_versioned_columns << 'position'
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
@@ -43,6 +42,11 @@ class WikiPage < ActiveRecord::Base
|
||||
validates_uniqueness_of :canonical_title, :scope => :course_id
|
||||
validates_format_of :title, :with => /^[^0-9]/
|
||||
|
||||
# acts_as_paranoid_versioned
|
||||
self.versioned_class.class_eval do
|
||||
def self.delete_all(conditions = nil); return; end
|
||||
end
|
||||
|
||||
def before_validation
|
||||
self.canonical_title = self.title.pretty_url
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user