Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 390
- Log:
Initial import of Canvass, a donations-based poll application.
- Author:
- rool
- Date:
- Mon Mar 21 14:58:04 +0000 2011
- Size:
- 869 Bytes
1 | ######################################################################## |
2 | # File:: without_table.rb |
3 | # (C):: http://stackoverflow.com/questions/315850/rails-model-without-database/318919#318919 |
4 | # |
5 | # Purpose:: Define a class which lets us use ActiveRecord validations |
6 | # without needing a database representation of the model. |
7 | # ---------------------------------------------------------------------- |
8 | # 16-Feb-2011 (ADH): Imported from Artisan. |
9 | ######################################################################## |
10 | |
11 | class WithoutTable < ActiveRecord::Base |
12 | |
13 | self.abstract_class = true |
14 | |
15 | def self.columns |
16 | @columns ||= []; |
17 | end |
18 | |
19 | def self.column( name, sql_type = nil, default = nil, null = true ) |
20 | columns << ActiveRecord::ConnectionAdapters::Column.new( |
21 | name.to_s, |
22 | default, |
23 | sql_type.to_s, |
24 | null |
25 | ) |
26 | end |
27 | end |