ratnikov-active_record_base_without_table 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ratnikov-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-03-18 00:00:00 -07: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: false
28
+ homepage: http://github.com/ratnikov/active_record_base_without_table/tree/master
29
+ post_install_message:
30
+ rdoc_options: []
31
+
32
+ require_paths:
33
+ - .
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: "0"
39
+ version:
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ requirements: []
47
+
48
+ rubyforge_project:
49
+ rubygems_version: 1.2.0
50
+ signing_key:
51
+ specification_version: 2
52
+ summary: Allows to use ActiveRecord::Base functionality without database table
53
+ test_files: []
54
+