active_record_base_without_table 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,27 @@
1
+ module ActiveRecord
2
+ class BaseWithoutTable < Base
3
+ self.abstract_class = true
4
+
5
+ def create_or_update_without_callbacks
6
+ errors.empty?
7
+ end
8
+
9
+ class << self
10
+ def columns()
11
+ @columns ||= []
12
+ end
13
+
14
+ def column(name, sql_type = nil, default = nil, null = true)
15
+ columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
16
+ reset_column_information
17
+ end
18
+
19
+ # Reset everything, except the column information
20
+ def reset_column_information
21
+ columns = @columns
22
+ super
23
+ @columns = columns
24
+ end
25
+ end
26
+ end
27
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: active_record_base_without_table
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Jonathan Viney
8
+ - Dmitry Ratnikov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-12-15 00:00:00 -06:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description:
18
+ email: dmitryr@webitects.com
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files: []
24
+
25
+ files:
26
+ - lib/active_record/base_without_table.rb
27
+ has_rdoc: true
28
+ homepage: http://github.com/ratnikov/active_record_base_without_table/tree/master
29
+ licenses: []
30
+
31
+ post_install_message:
32
+ rdoc_options: []
33
+
34
+ require_paths:
35
+ - .
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: "0"
41
+ version:
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ version:
48
+ requirements: []
49
+
50
+ rubyforge_project:
51
+ rubygems_version: 1.3.5
52
+ signing_key:
53
+ specification_version: 3
54
+ summary: Allows to use ActiveRecord::Base functionality without database table
55
+ test_files: []
56
+