Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 173
- Log:
Updated to latest release of Beast according to the "getting started with
Beast" guide at:http://beast.caboo.se/forums/1/topics/381
This check-in includes frozen Edge Rails and has the beginnings of
configuration for the ROOL site included.
- Author:
- rool
- Date:
- Fri Mar 02 15:59:12 +0000 2007
- Size:
- 933 Bytes
1 | ActiveRecord::Base.class_eval do |
2 | include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper |
3 | def self.format_attribute(attr_name) |
4 | class << self; include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper; end |
5 | define_method(:body) { read_attribute attr_name } |
6 | define_method(:body_html) { read_attribute "#{attr_name}_html" } |
7 | define_method(:body_html=) { |value| write_attribute "#{attr_name}_html", value } |
8 | before_save :format_content |
9 | end |
10 | |
11 | def dom_id |
12 | [self.class.name.downcase.pluralize.dasherize, id] * '-' |
13 | end |
14 | |
15 | protected |
16 | def format_content |
17 | body.strip! if body.respond_to?(:strip!) |
18 | self.body_html = body.blank? ? '' : body_html_with_formatting |
19 | end |
20 | |
21 | def body_html_with_formatting |
22 | body_html = auto_link body { |text| truncate(text, 50) } |
23 | white_list(RedCloth.new(body_html).to_html) |
24 | end |
25 | end |