framework 0.1.1 → 0.1.3
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.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/lib/framework/application.rb +31 -22
- data/lib/framework/generators/application_generator.rb +20 -43
- data/lib/framework/generators/migration_generator.rb +1 -1
- data/lib/framework/migration.rb +1 -10
- data/lib/framework/tasks/console.rake +4 -2
- data/lib/framework/templates/migration.rb.erb +1 -3
- data/lib/framework/version.rb +1 -1
- data/lib/framework.rb +0 -1
- metadata +34 -50
- data/lib/framework/extensions/active_record/base_extension.rb +0 -38
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ef9dd8116948509019cf766f777c3c125731f8ce1a169af6898bb5052b4153f
|
|
4
|
+
data.tar.gz: 60608b1b2d198a2b12e5831bc85cd416f53761cfc6b74d34411bc4a9493834e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e34fd1665e3c9b6d632123fbd316db6413f0d36874968128e43334427f7b09644d988182c3350e8be3858ccc0f15fd25f44fe4db3dacef1523dba5adef09a83
|
|
7
|
+
data.tar.gz: 38c3134502fa998a665d32ad1b8f09d0562b22d7281738eaa7454bf3c709cd58b77faf9bd1ec032ec1e9e8c8e607ca89414628628a379b0ac02caa18d32dab9c
|
data/README.md
CHANGED
|
@@ -3,11 +3,10 @@ Ruby Framework
|
|
|
3
3
|
|
|
4
4
|
[](http://badge.fury.io/rb/framework)
|
|
5
5
|
|
|
6
|
-
Framework to build Ruby applications for all your needs.
|
|
6
|
+
Framework to build Ruby applications for all your needs. Rails without web perks.
|
|
7
7
|
|
|
8
8
|
### Features
|
|
9
9
|
|
|
10
|
-
- Easy configuration to work with multiple databases
|
|
11
10
|
- ActiveRecord interface
|
|
12
11
|
- Customizable structure
|
|
13
12
|
- YAML configuration
|
|
@@ -70,7 +69,7 @@ Pretty similar to Rails (just a sample):
|
|
|
70
69
|
| | |____hello.rake
|
|
71
70
|
|____config
|
|
72
71
|
| |____application.yml
|
|
73
|
-
| |
|
|
72
|
+
| |____database.yml
|
|
74
73
|
| |____environment.rb
|
|
75
74
|
| |____initializers
|
|
76
75
|
| | |____time_zone.rb
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
require 'framework/root'
|
|
2
2
|
require 'framework/config'
|
|
3
|
-
require '
|
|
4
|
-
require '
|
|
5
|
-
require 'action_dispatch/middleware/callbacks'
|
|
3
|
+
require 'active_support/reloader'
|
|
4
|
+
require 'active_support/file_update_checker'
|
|
6
5
|
|
|
7
6
|
module Framework
|
|
8
7
|
class Application
|
|
9
|
-
CONFIG_PATH = "config/application.yml"
|
|
8
|
+
CONFIG_PATH = "config/application.yml".freeze
|
|
10
9
|
|
|
11
10
|
attr_reader :env
|
|
12
11
|
attr_accessor :logger
|
|
@@ -52,7 +51,7 @@ module Framework
|
|
|
52
51
|
|
|
53
52
|
def create_database!(name = nil)
|
|
54
53
|
name ||= 'default'
|
|
55
|
-
cfg = database_config[
|
|
54
|
+
cfg = name == 'default' ? database_config[env] : database_config.dig(env, name)
|
|
56
55
|
|
|
57
56
|
case cfg['adapter']
|
|
58
57
|
when 'postgresql'
|
|
@@ -70,7 +69,7 @@ module Framework
|
|
|
70
69
|
|
|
71
70
|
def drop_database!(name = nil)
|
|
72
71
|
name ||= 'default'
|
|
73
|
-
cfg = database_config[
|
|
72
|
+
cfg = name == 'default' ? database_config[env] : database_config.dig(env, name)
|
|
74
73
|
|
|
75
74
|
case cfg['adapter']
|
|
76
75
|
when 'postgresql'
|
|
@@ -84,15 +83,15 @@ module Framework
|
|
|
84
83
|
raise "Unknown adapter '#{cfg['adapter']}'"
|
|
85
84
|
end
|
|
86
85
|
|
|
87
|
-
puts "The database #{
|
|
86
|
+
puts "The database #{cfg['database']} has been successfully dropped"
|
|
88
87
|
end
|
|
89
88
|
|
|
90
89
|
def migrate_database(version = nil)
|
|
91
|
-
ActiveRecord::
|
|
90
|
+
ActiveRecord::Migrator.migrate root.join("db/migrate"), version.try(:to_i)
|
|
92
91
|
end
|
|
93
92
|
|
|
94
93
|
def rollback_database(steps = 1)
|
|
95
|
-
ActiveRecord::
|
|
94
|
+
ActiveRecord::Migrator.rollback root.join("db/migrate"), steps
|
|
96
95
|
end
|
|
97
96
|
|
|
98
97
|
# @return [Hash<String>]
|
|
@@ -102,8 +101,8 @@ module Framework
|
|
|
102
101
|
|
|
103
102
|
# @return [String] Database name
|
|
104
103
|
def database
|
|
105
|
-
adapter = database_config
|
|
106
|
-
database = database_config
|
|
104
|
+
adapter = database_config.dig(env, 'adapter')
|
|
105
|
+
database = database_config.dig(env, 'database')
|
|
107
106
|
adapter == 'sqlite3' ? root.join("db/sqlite/#{env}/#{database}.db") : database
|
|
108
107
|
end
|
|
109
108
|
|
|
@@ -112,7 +111,7 @@ module Framework
|
|
|
112
111
|
end
|
|
113
112
|
|
|
114
113
|
def db_connection(db_name = 'default')
|
|
115
|
-
ActiveRecord::Base.establish_connection(database_config
|
|
114
|
+
ActiveRecord::Base.establish_connection(db_name == 'default' ? database_config.dig(env) : database_config.dig(env, db_name))
|
|
116
115
|
ActiveRecord::Base.connection
|
|
117
116
|
end
|
|
118
117
|
|
|
@@ -177,33 +176,43 @@ module Framework
|
|
|
177
176
|
end
|
|
178
177
|
|
|
179
178
|
def establish_database_connection
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
env_dbs = database_config[env]
|
|
180
|
+
|
|
181
|
+
if env_dbs
|
|
182
|
+
# If all are hashes, then we have multiple connections
|
|
183
|
+
if env_dbs.all? { |item| item.is_a?(Hash) }
|
|
184
|
+
env_dbs.each do |_db_key, db_config|
|
|
185
|
+
ActiveRecord::Base.establish_connection(db_config.except('enable_logging'))
|
|
183
186
|
|
|
184
|
-
|
|
185
|
-
|
|
187
|
+
if db_config['enable_logging']
|
|
188
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
|
189
|
+
end
|
|
186
190
|
end
|
|
191
|
+
else
|
|
192
|
+
# We have flat one database
|
|
193
|
+
ActiveRecord::Base.establish_connection(env_dbs.except('enable_logging'))
|
|
187
194
|
end
|
|
188
195
|
end
|
|
189
196
|
end
|
|
190
197
|
|
|
191
198
|
# Used to create/drop db
|
|
192
199
|
def establish_postgres_connection(name = 'default')
|
|
193
|
-
if database_config
|
|
194
|
-
|
|
195
|
-
|
|
200
|
+
if database_config
|
|
201
|
+
conf = name == 'default' ? database_config.dig(env) : database_config.dig(env, name)
|
|
202
|
+
|
|
203
|
+
ActiveRecord::Base.establish_connection(conf.merge('database' => 'postgres',
|
|
204
|
+
'schema_search_path' => 'public'))
|
|
196
205
|
end
|
|
197
206
|
end
|
|
198
207
|
|
|
199
208
|
# @return [Hash]
|
|
200
209
|
def load_application_config
|
|
201
|
-
@config = Framework::Config.new(YAML.load(erb(CONFIG_PATH).result)[env])
|
|
210
|
+
@config = Framework::Config.new(YAML.load(erb(CONFIG_PATH).result, aliases: true)[env])
|
|
202
211
|
end
|
|
203
212
|
|
|
204
213
|
# @return [Hash]
|
|
205
214
|
def load_database_config
|
|
206
|
-
@database_config = YAML.load(erb('config/
|
|
215
|
+
@database_config = YAML.load(erb('config/database.yml').result, aliases: true)
|
|
207
216
|
end
|
|
208
217
|
|
|
209
218
|
# @param [String] path
|
|
@@ -50,49 +50,26 @@ module Framework
|
|
|
50
50
|
def create_database_config
|
|
51
51
|
db_name = name.underscore
|
|
52
52
|
|
|
53
|
-
create_file 'config/
|
|
53
|
+
create_file 'config/database.yml' do
|
|
54
54
|
<<-CONFIG.strip_heredoc
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
production:
|
|
74
|
-
<<: *common
|
|
75
|
-
database: #{db_name}_production
|
|
76
|
-
|
|
77
|
-
# second_one:
|
|
78
|
-
# development: &common
|
|
79
|
-
# adapter: postgresql
|
|
80
|
-
# username:
|
|
81
|
-
# password:
|
|
82
|
-
# database: second_sample_development
|
|
83
|
-
# min_messages: WARNING
|
|
84
|
-
# reconnect: true
|
|
85
|
-
# pool: 5
|
|
86
|
-
# encoding: unicode
|
|
87
|
-
# host: localhost
|
|
88
|
-
#
|
|
89
|
-
# test:
|
|
90
|
-
# <<: *common
|
|
91
|
-
# database: second_sample_test
|
|
92
|
-
#
|
|
93
|
-
# production:
|
|
94
|
-
# <<: *common
|
|
95
|
-
# database: second_sample_production
|
|
55
|
+
development: &common
|
|
56
|
+
adapter: postgresql
|
|
57
|
+
username:
|
|
58
|
+
password:
|
|
59
|
+
database: #{db_name}_development
|
|
60
|
+
min_messages: WARNING
|
|
61
|
+
reconnect: true
|
|
62
|
+
pool: 5
|
|
63
|
+
encoding: unicode
|
|
64
|
+
host: localhost
|
|
65
|
+
|
|
66
|
+
test:
|
|
67
|
+
<<: *common
|
|
68
|
+
database: #{db_name}_test
|
|
69
|
+
|
|
70
|
+
production:
|
|
71
|
+
<<: *common
|
|
72
|
+
database: #{db_name}_production
|
|
96
73
|
CONFIG
|
|
97
74
|
end
|
|
98
75
|
end
|
|
@@ -102,7 +79,7 @@ module Framework
|
|
|
102
79
|
<<-CONFIG.strip_heredoc
|
|
103
80
|
# Set up gems listed in the Gemfile.
|
|
104
81
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
|
105
|
-
require 'bundler/setup' if File.
|
|
82
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
|
106
83
|
|
|
107
84
|
require 'framework'
|
|
108
85
|
|
data/lib/framework/migration.rb
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
module Framework
|
|
2
|
-
class Migration < ActiveRecord::Migration[
|
|
3
|
-
|
|
4
|
-
def self.use_database(db_name)
|
|
5
|
-
define_method :connection do
|
|
6
|
-
@connection ||= begin
|
|
7
|
-
Framework::Logger.whishper "Using database: #{db_name}"
|
|
8
|
-
Framework.app.db_connection(db_name)
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
2
|
+
class Migration < ActiveRecord::Migration[7.0]
|
|
12
3
|
end
|
|
13
4
|
end
|
data/lib/framework/version.rb
CHANGED
data/lib/framework.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: framework
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergei Nikolaevich Zinin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-03-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -16,136 +16,122 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 7.0.4
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
26
|
+
version: 7.0.4
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: activesupport
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 7.0.4
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
40
|
+
version: 7.0.4
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: actionpack
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: 7.0.4
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
54
|
+
version: 7.0.4
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
56
|
+
name: rake
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
62
|
-
type: :runtime
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: 2.0.0.pre2
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: rake
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
61
|
+
version: '13.0'
|
|
73
62
|
- - ">="
|
|
74
63
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
76
|
-
- - "~>"
|
|
77
|
-
- !ruby/object:Gem::Version
|
|
78
|
-
version: '12.3'
|
|
64
|
+
version: 13.0.6
|
|
79
65
|
type: :runtime
|
|
80
66
|
prerelease: false
|
|
81
67
|
version_requirements: !ruby/object:Gem::Requirement
|
|
82
68
|
requirements:
|
|
83
|
-
- - ">="
|
|
84
|
-
- !ruby/object:Gem::Version
|
|
85
|
-
version: 12.3.0
|
|
86
69
|
- - "~>"
|
|
87
70
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '
|
|
71
|
+
version: '13.0'
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: 13.0.6
|
|
89
75
|
- !ruby/object:Gem::Dependency
|
|
90
76
|
name: thor
|
|
91
77
|
requirement: !ruby/object:Gem::Requirement
|
|
92
78
|
requirements:
|
|
93
79
|
- - "~>"
|
|
94
80
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '
|
|
81
|
+
version: '1.2'
|
|
96
82
|
- - ">="
|
|
97
83
|
- !ruby/object:Gem::Version
|
|
98
|
-
version:
|
|
84
|
+
version: 1.2.1
|
|
99
85
|
type: :runtime
|
|
100
86
|
prerelease: false
|
|
101
87
|
version_requirements: !ruby/object:Gem::Requirement
|
|
102
88
|
requirements:
|
|
103
89
|
- - "~>"
|
|
104
90
|
- !ruby/object:Gem::Version
|
|
105
|
-
version: '
|
|
91
|
+
version: '1.2'
|
|
106
92
|
- - ">="
|
|
107
93
|
- !ruby/object:Gem::Version
|
|
108
|
-
version:
|
|
94
|
+
version: 1.2.1
|
|
109
95
|
- !ruby/object:Gem::Dependency
|
|
110
96
|
name: bundler
|
|
111
97
|
requirement: !ruby/object:Gem::Requirement
|
|
112
98
|
requirements:
|
|
113
99
|
- - "~>"
|
|
114
100
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '
|
|
101
|
+
version: '2.4'
|
|
116
102
|
- - ">="
|
|
117
103
|
- !ruby/object:Gem::Version
|
|
118
|
-
version:
|
|
104
|
+
version: '2.4'
|
|
119
105
|
type: :development
|
|
120
106
|
prerelease: false
|
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
|
122
108
|
requirements:
|
|
123
109
|
- - "~>"
|
|
124
110
|
- !ruby/object:Gem::Version
|
|
125
|
-
version: '
|
|
111
|
+
version: '2.4'
|
|
126
112
|
- - ">="
|
|
127
113
|
- !ruby/object:Gem::Version
|
|
128
|
-
version:
|
|
114
|
+
version: '2.4'
|
|
129
115
|
- !ruby/object:Gem::Dependency
|
|
130
116
|
name: rspec
|
|
131
117
|
requirement: !ruby/object:Gem::Requirement
|
|
132
118
|
requirements:
|
|
133
|
-
- - ">="
|
|
134
|
-
- !ruby/object:Gem::Version
|
|
135
|
-
version: 3.8.0
|
|
136
119
|
- - "~>"
|
|
137
120
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: '3.
|
|
121
|
+
version: '3.12'
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: 3.12.0
|
|
139
125
|
type: :development
|
|
140
126
|
prerelease: false
|
|
141
127
|
version_requirements: !ruby/object:Gem::Requirement
|
|
142
128
|
requirements:
|
|
143
|
-
- - ">="
|
|
144
|
-
- !ruby/object:Gem::Version
|
|
145
|
-
version: 3.8.0
|
|
146
129
|
- - "~>"
|
|
147
130
|
- !ruby/object:Gem::Version
|
|
148
|
-
version: '3.
|
|
131
|
+
version: '3.12'
|
|
132
|
+
- - ">="
|
|
133
|
+
- !ruby/object:Gem::Version
|
|
134
|
+
version: 3.12.0
|
|
149
135
|
description: Allows to quickly build well structured complex Ruby apps.
|
|
150
136
|
email: zinin@xakep.ru
|
|
151
137
|
executables:
|
|
@@ -162,7 +148,6 @@ files:
|
|
|
162
148
|
- lib/framework/cli.rb
|
|
163
149
|
- lib/framework/config.rb
|
|
164
150
|
- lib/framework/db_listener.rb
|
|
165
|
-
- lib/framework/extensions/active_record/base_extension.rb
|
|
166
151
|
- lib/framework/generators/application_generator.rb
|
|
167
152
|
- lib/framework/generators/migration_generator.rb
|
|
168
153
|
- lib/framework/generators/multi_generator.rb
|
|
@@ -189,15 +174,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
189
174
|
requirements:
|
|
190
175
|
- - ">="
|
|
191
176
|
- !ruby/object:Gem::Version
|
|
192
|
-
version: 2.
|
|
177
|
+
version: 3.2.1
|
|
193
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
179
|
requirements:
|
|
195
180
|
- - ">="
|
|
196
181
|
- !ruby/object:Gem::Version
|
|
197
|
-
version: 2.
|
|
182
|
+
version: 3.2.1
|
|
198
183
|
requirements: []
|
|
199
|
-
|
|
200
|
-
rubygems_version: 2.7.9
|
|
184
|
+
rubygems_version: 3.4.8
|
|
201
185
|
signing_key:
|
|
202
186
|
specification_version: 4
|
|
203
187
|
summary: Ruby Application Framework for all your needs.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
module Framework
|
|
2
|
-
module Extensions
|
|
3
|
-
module ActiveRecord
|
|
4
|
-
module BaseExtension
|
|
5
|
-
extend ActiveSupport::Concern
|
|
6
|
-
|
|
7
|
-
module ClassMethods
|
|
8
|
-
|
|
9
|
-
# @override
|
|
10
|
-
# def inherited(child_class)
|
|
11
|
-
# super
|
|
12
|
-
#
|
|
13
|
-
# unless child_class == ::ActiveRecord::SchemaMigration
|
|
14
|
-
# if (chunks = child_class.name.split('::')).many?
|
|
15
|
-
# child_class.store_full_sti_class = false
|
|
16
|
-
# child_class.use_database(chunks.first.downcase)
|
|
17
|
-
# end
|
|
18
|
-
# end
|
|
19
|
-
# end
|
|
20
|
-
|
|
21
|
-
# Makes your model use different databases
|
|
22
|
-
# @param [String, Symbol] db_name
|
|
23
|
-
# @param [String] env
|
|
24
|
-
def use_database(db_name, env = nil)
|
|
25
|
-
env ||= Framework.app.env
|
|
26
|
-
env = env.to_s
|
|
27
|
-
db_name = db_name.to_s
|
|
28
|
-
|
|
29
|
-
# self.abstract_class = Framework.env != 'test'
|
|
30
|
-
# self.table_name = self.name.split('::').last.tableize if self.superclass == ::ActiveRecord::Base
|
|
31
|
-
establish_connection(Framework.app.database_config[db_name][env])
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
ActiveRecord::Base.send :include, Framework::Extensions::ActiveRecord::BaseExtension
|