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:
- 1084 Bytes
1 | module ActiveRecord |
2 | module Associations |
3 | class HasOneThroughAssociation < HasManyThroughAssociation |
4 | |
5 | def create_through_record(new_value) #nodoc: |
6 | klass = @reflection.through_reflection.klass |
7 | |
8 | current_object = @owner.send(@reflection.through_reflection.name) |
9 | |
10 | if current_object |
11 | new_value ? current_object.update_attributes(construct_join_attributes(new_value)) : current_object.destroy |
12 | elsif new_value |
13 | if @owner.new_record? |
14 | self.target = new_value |
15 | through_association = @owner.send(:association_instance_get, @reflection.through_reflection.name) |
16 | through_association.build(construct_join_attributes(new_value)) |
17 | else |
18 | @owner.send(@reflection.through_reflection.name, klass.create(construct_join_attributes(new_value))) |
19 | end |
20 | end |
21 | end |
22 | |
23 | private |
24 | def find(*args) |
25 | super(args.merge(:limit => 1)) |
26 | end |
27 | |
28 | def find_target |
29 | super.first |
30 | end |
31 | |
32 | def reset_target! |
33 | @target = nil |
34 | end |
35 | end |
36 | end |
37 | end |