Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2045 Bytes
1 | class Topic < ActiveRecord::Base |
2 | named_scope :base |
3 | named_scope :written_before, lambda { |time| |
4 | if time |
5 | { :conditions => ['written_on < ?', time] } |
6 | end |
7 | } |
8 | named_scope :approved, :conditions => {:approved => true} |
9 | named_scope :rejected, :conditions => {:approved => false} |
10 | |
11 | named_scope :by_lifo, :conditions => {:author_name => 'lifo'} |
12 | |
13 | named_scope :approved_as_hash_condition, :conditions => {:topics => {:approved => true}} |
14 | named_scope 'approved_as_string', :conditions => {:approved => true} |
15 | named_scope :replied, :conditions => ['replies_count > 0'] |
16 | named_scope :anonymous_extension do |
17 | def one |
18 | 1 |
19 | end |
20 | end |
21 | module NamedExtension |
22 | def two |
23 | 2 |
24 | end |
25 | end |
26 | module MultipleExtensionOne |
27 | def extension_one |
28 | 1 |
29 | end |
30 | end |
31 | module MultipleExtensionTwo |
32 | def extension_two |
33 | 2 |
34 | end |
35 | end |
36 | named_scope :named_extension, :extend => NamedExtension |
37 | named_scope :multiple_extensions, :extend => [MultipleExtensionTwo, MultipleExtensionOne] |
38 | |
39 | has_many :replies, :dependent => :destroy, :foreign_key => "parent_id" |
40 | has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title" |
41 | serialize :content |
42 | |
43 | before_create :default_written_on |
44 | before_destroy :destroy_children |
45 | |
46 | def parent |
47 | Topic.find(parent_id) |
48 | end |
49 | |
50 | # trivial method for testing Array#to_xml with :methods |
51 | def topic_id |
52 | id |
53 | end |
54 | |
55 | protected |
56 | def approved=(val) |
57 | @custom_approved = val |
58 | write_attribute(:approved, val) |
59 | end |
60 | |
61 | def default_written_on |
62 | self.written_on = Time.now unless attribute_present?("written_on") |
63 | end |
64 | |
65 | def destroy_children |
66 | self.class.delete_all "parent_id = #{id}" |
67 | end |
68 | |
69 | def after_initialize |
70 | if self.new_record? |
71 | self.author_email_address = 'test@test.com' |
72 | end |
73 | end |
74 | end |
75 | |
76 | module Web |
77 | class Topic < ActiveRecord::Base |
78 | has_many :replies, :dependent => :destroy, :foreign_key => "parent_id", :class_name => 'Web::Reply' |
79 | end |
80 | end |