rails_db_admin 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/GPL-3-LICENSE +674 -0
- data/README.md +5 -0
- data/Rakefile +30 -0
- data/app/assets/javascripts/rails_db_admin/application.js +9 -0
- data/app/assets/stylesheets/rails_db_admin/application.css +7 -0
- data/app/controllers/rails_db_admin/erp_app/desktop/base_controller.rb +182 -0
- data/app/controllers/rails_db_admin/erp_app/desktop/queries_controller.rb +173 -0
- data/app/helpers/rails_db_admin/application_helper.rb +4 -0
- data/app/views/layouts/application.html.erb +14 -0
- data/app/views/layouts/rails_db_admin/application.html.erb +14 -0
- data/config/initializers/rails_db_admin.rb +4 -0
- data/config/routes.rb +4 -0
- data/db/data_migrations/20110816005525_rails_db_admin_application.rb +31 -0
- data/lib/rails_db_admin.rb +15 -0
- data/lib/rails_db_admin/config.rb +27 -0
- data/lib/rails_db_admin/connection_handler.rb +17 -0
- data/lib/rails_db_admin/engine.rb +11 -0
- data/lib/rails_db_admin/extjs.rb +2 -0
- data/lib/rails_db_admin/extjs/json_column_builder.rb +139 -0
- data/lib/rails_db_admin/extjs/json_data_builder.rb +82 -0
- data/lib/rails_db_admin/query_support.rb +72 -0
- data/lib/rails_db_admin/table_support.rb +147 -0
- data/lib/rails_db_admin/version.rb +3 -0
- data/lib/tasks/rails_db_admin_tasks.rake +4 -0
- data/public/images/icons/rails_db_admin/rails_db_admin_16x16.png +0 -0
- data/public/images/icons/rails_db_admin/rails_db_admin_24x24.png +0 -0
- data/public/images/icons/rails_db_admin/rails_db_admin_32x32.png +0 -0
- data/public/images/icons/rails_db_admin/rails_db_admin_48x48.png +0 -0
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/database_combo.js +52 -0
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/module.js +429 -0
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/queries_tree_menu.js +86 -0
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/query_panel.js +206 -0
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/readonly_table_data_grid.js +27 -0
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/tables_tree_menu.js +87 -0
- data/public/stylesheets/erp_app/desktop/applications/rails_db_admin/rails_db_admin.css +10 -0
- data/spec/controllers/rails_db_admin/base_controller_spec.rb +481 -0
- data/spec/controllers/rails_db_admin/queries_controller_spec.rb +134 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +45 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +14 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/cucumber.rb +3 -0
- data/spec/dummy/config/environments/spec.rb +27 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/lib/rails_db_admin/extjs/json_column_builder_spec.rb +206 -0
- data/spec/lib/rails_db_admin/extjs/json_data_builder_spec.rb +201 -0
- data/spec/lib/rails_db_admin/query_support_spec.rb +40 -0
- data/spec/lib/rails_db_admin/table_support_spec.rb +349 -0
- data/spec/spec_helper.rb +60 -0
- metadata +183 -0
@@ -0,0 +1,349 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe RailsDbAdmin::TableSupport do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
@connection_class = double(ActiveRecord::Base)
|
7
|
+
@adapter = double(ActiveRecord::ConnectionAdapters::AbstractAdapter)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "instance methods" do
|
11
|
+
before(:each) do
|
12
|
+
@connection_class.should_receive(:connection).and_return(@adapter)
|
13
|
+
@instance = RailsDbAdmin::TableSupport.new(@connection_class)
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "update_table" do
|
17
|
+
|
18
|
+
it "should be able to send a correctly formed SQL statment to the ConnectionAdapter" do
|
19
|
+
|
20
|
+
@col = [ActiveRecord::ConnectionAdapters::Column.new("id",
|
21
|
+
"INTEGER",
|
22
|
+
false),
|
23
|
+
ActiveRecord::ConnectionAdapters::Column.new("parent_id",
|
24
|
+
"integer",
|
25
|
+
true),
|
26
|
+
ActiveRecord::ConnectionAdapters::Column.new("lft",
|
27
|
+
"integer",
|
28
|
+
true),
|
29
|
+
ActiveRecord::ConnectionAdapters::Column.new("rgt",
|
30
|
+
"integer",
|
31
|
+
true),
|
32
|
+
ActiveRecord::ConnectionAdapters::Column.new("description",
|
33
|
+
"varchar(255)",
|
34
|
+
true),
|
35
|
+
ActiveRecord::ConnectionAdapters::Column.new("comments",
|
36
|
+
"varchar(255)",
|
37
|
+
true),
|
38
|
+
ActiveRecord::ConnectionAdapters::Column.new("internal_identifier",
|
39
|
+
"varchar(255)",
|
40
|
+
true),
|
41
|
+
ActiveRecord::ConnectionAdapters::Column.new("external_identifier",
|
42
|
+
"varchar(255)",
|
43
|
+
true),
|
44
|
+
ActiveRecord::ConnectionAdapters::Column.new("external_id_source",
|
45
|
+
"varchar(255)",
|
46
|
+
true),
|
47
|
+
ActiveRecord::ConnectionAdapters::Column.new("created_at",
|
48
|
+
"datetime",
|
49
|
+
true),
|
50
|
+
ActiveRecord::ConnectionAdapters::Column.new("updated_at",
|
51
|
+
"datetime",
|
52
|
+
true)]
|
53
|
+
|
54
|
+
@table = "role_types"
|
55
|
+
data = {"parent_id" => "",
|
56
|
+
"lft" => "3",
|
57
|
+
"rgt" => "4",
|
58
|
+
"description" => "Partner-Test",
|
59
|
+
"comments" => "",
|
60
|
+
"internal_identifier" => "partner",
|
61
|
+
"external_identifier" => "",
|
62
|
+
"external_id_source" => "",
|
63
|
+
"created_at" => "2011-10-11 00:54:56.137144",
|
64
|
+
"updated_at" => "2011-10-11 00:54:56.137144"}
|
65
|
+
|
66
|
+
|
67
|
+
@sql = "UPDATE \"role_types\" SET \"parent_id\" = NULL, \"lft\" = 3, "\
|
68
|
+
"\"rgt\" = 4, \"description\" = 'Partner-Test', "\
|
69
|
+
"\"comments\" = NULL, \"internal_identifier\" = 'partner', "\
|
70
|
+
"\"external_identifier\" = NULL, \"external_id_source\" = NULL, "\
|
71
|
+
"\"created_at\" = '2011-10-11 00:54:56.137144', "\
|
72
|
+
"\"updated_at\" = '2011-10-11 00:54:56.137144' "\
|
73
|
+
"WHERE \"role_types\".\"id\" = 5"
|
74
|
+
|
75
|
+
@adapter.should_receive(:columns).with(@table).and_return(@col)
|
76
|
+
@adapter.should_receive(:execute).with(@sql)
|
77
|
+
@instance.update_table(@table, ["id","5"], data)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe "update_table_without_id" do
|
82
|
+
|
83
|
+
it "should be able to send a correctly formed SQL statment to the ConnectionAdapter" do
|
84
|
+
|
85
|
+
@col = [ActiveRecord::ConnectionAdapters::Column.new("preference_type_id",
|
86
|
+
"INTEGER",
|
87
|
+
true),
|
88
|
+
ActiveRecord::ConnectionAdapters::Column.new("preference_option_id",
|
89
|
+
"integer",
|
90
|
+
true),
|
91
|
+
ActiveRecord::ConnectionAdapters::Column.new("created_at",
|
92
|
+
"datetime",
|
93
|
+
true),
|
94
|
+
ActiveRecord::ConnectionAdapters::Column.new("updated_at",
|
95
|
+
"datetime",
|
96
|
+
true)]
|
97
|
+
|
98
|
+
@table = "preference_options_preference_types"
|
99
|
+
|
100
|
+
@data = [{"preference_type_id" => "1",
|
101
|
+
"preference_option_id" => "2",
|
102
|
+
"created_at" => "2011-10-11 00:54:56.137144",
|
103
|
+
"updated_at" => "2011-10-11 00:54:56.137144",
|
104
|
+
"fake_id" => 1},
|
105
|
+
{"preference_type_id" => 2,
|
106
|
+
"preference_option_id" => 2,
|
107
|
+
"created_at" => "",
|
108
|
+
"updated_at" => "2011-10-11 00:54:56.137144",
|
109
|
+
"fake_id" => 1}]
|
110
|
+
|
111
|
+
@sql = "UPDATE \"preference_options_preference_types\" "\
|
112
|
+
"SET \"preference_type_id\" = 1, \"created_at\" "\
|
113
|
+
"= '2011-10-11 00:54:56.137144' WHERE "\
|
114
|
+
"\"preference_options_preference_types\"."\
|
115
|
+
"\"preference_type_id\" = 2 AND "\
|
116
|
+
"\"preference_options_preference_types\"."\
|
117
|
+
"\"preference_option_id\" = 2 AND "\
|
118
|
+
"\"preference_options_preference_types\".\"created_at\" "\
|
119
|
+
"IS NULL AND \"preference_options_preference_types\"."\
|
120
|
+
"\"updated_at\" = '2011-10-11 00:54:56.137144'"\
|
121
|
+
|
122
|
+
@adapter.should_receive(:columns).with(@table).and_return(@col)
|
123
|
+
@adapter.should_receive(:execute).with(@sql)
|
124
|
+
@instance.update_table_without_id(@table, @data)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
describe "insert_row" do
|
130
|
+
|
131
|
+
it "should return an id" do
|
132
|
+
|
133
|
+
@table = "role_types"
|
134
|
+
|
135
|
+
mod_types_data = {"parent_id" => "",
|
136
|
+
"lft" => "3",
|
137
|
+
"rgt" => "4",
|
138
|
+
"description" => "Partner-Test",
|
139
|
+
"comments" => "",
|
140
|
+
"internal_identifier" => "partner",
|
141
|
+
"external_identifier" => "",
|
142
|
+
"external_id_source" => "",
|
143
|
+
"created_at" => "2011-10-11 00:54:56.137144",
|
144
|
+
"updated_at" => "2011-10-11 00:54:56.137144"}
|
145
|
+
|
146
|
+
sql = "INSERT INTO \"role_types\" (\"parent_id\", "\
|
147
|
+
"\"lft\", \"rgt\", \"description\", "\
|
148
|
+
"\"comments\", \"internal_identifier\", "\
|
149
|
+
"\"external_identifier\", \"external_id_source\", "\
|
150
|
+
"\"created_at\", \"updated_at\") "\
|
151
|
+
"VALUES (NULL, 3, 4, 'Partner-Test', NULL, "\
|
152
|
+
"'partner', NULL, NULL, '2011-10-11 00:54:56.137144', "\
|
153
|
+
"'2011-10-11 00:54:56.137144')"
|
154
|
+
|
155
|
+
@col = [ActiveRecord::ConnectionAdapters::Column.new("id",
|
156
|
+
"INTEGER",
|
157
|
+
false),
|
158
|
+
ActiveRecord::ConnectionAdapters::Column.new("parent_id",
|
159
|
+
"integer",
|
160
|
+
true),
|
161
|
+
ActiveRecord::ConnectionAdapters::Column.new("lft",
|
162
|
+
"integer",
|
163
|
+
true),
|
164
|
+
ActiveRecord::ConnectionAdapters::Column.new("rgt",
|
165
|
+
"integer",
|
166
|
+
true),
|
167
|
+
ActiveRecord::ConnectionAdapters::Column.new("description",
|
168
|
+
"varchar(255)",
|
169
|
+
true),
|
170
|
+
ActiveRecord::ConnectionAdapters::Column.new("comments",
|
171
|
+
"varchar(255)",
|
172
|
+
true),
|
173
|
+
ActiveRecord::ConnectionAdapters::Column.new("internal_identifier",
|
174
|
+
"varchar(255)",
|
175
|
+
true),
|
176
|
+
ActiveRecord::ConnectionAdapters::Column.new("external_identifier",
|
177
|
+
"varchar(255)",
|
178
|
+
true),
|
179
|
+
ActiveRecord::ConnectionAdapters::Column.new("external_id_source",
|
180
|
+
"varchar(255)",
|
181
|
+
true),
|
182
|
+
ActiveRecord::ConnectionAdapters::Column.new("created_at",
|
183
|
+
"datetime",
|
184
|
+
true),
|
185
|
+
ActiveRecord::ConnectionAdapters::Column.new("updated_at",
|
186
|
+
"datetime",
|
187
|
+
true)]
|
188
|
+
|
189
|
+
@adapter.should_receive(:insert).with(sql).and_return(30)
|
190
|
+
@adapter.should_receive(:columns).with(@table).and_return(@col)
|
191
|
+
|
192
|
+
returned = @instance.insert_row("role_types",mod_types_data)
|
193
|
+
returned.should eq(30)
|
194
|
+
end
|
195
|
+
|
196
|
+
it "should return a fake_id" do
|
197
|
+
|
198
|
+
@table = "preference_options_preference_types"
|
199
|
+
|
200
|
+
@data = {"preference_type_id" => "1",
|
201
|
+
"preference_option_id" => "2",
|
202
|
+
"created_at" => "2011-10-11 00:54:56.137144",
|
203
|
+
"updated_at" => "2011-10-11 00:54:56.137144"
|
204
|
+
}
|
205
|
+
|
206
|
+
@sql = "INSERT INTO \"preference_options_preference_types\" "\
|
207
|
+
"(\"preference_type_id\", \"preference_option_id\", "\
|
208
|
+
"\"created_at\", \"updated_at\") VALUES "\
|
209
|
+
"(1, 2, '2011-10-11 00:54:56.137144', "\
|
210
|
+
"'2011-10-11 00:54:56.137144')"
|
211
|
+
|
212
|
+
@adapter.should_receive(:insert).with(@sql).and_return(nil)
|
213
|
+
|
214
|
+
returned = @instance.insert_row(@table, @data, true)
|
215
|
+
returned.should > 100
|
216
|
+
returned.should < 501
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
describe "delete_row" do
|
221
|
+
|
222
|
+
it "should produce valid delete sql" do
|
223
|
+
|
224
|
+
@sql = "DELETE FROM \"some_table\" WHERE \"some_table\".\"id\" = 3"
|
225
|
+
@adapter.should_receive(:execute).with(@sql)
|
226
|
+
@instance.delete_row("some_table", ['id', 3])
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
describe "primary_key" do
|
231
|
+
|
232
|
+
it "should return an array with the name of the primary key and a nil" do
|
233
|
+
@adapter.should_receive(:primary_key).with("role_types").
|
234
|
+
and_return("id")
|
235
|
+
@returned = @instance.primary_key("role_types")
|
236
|
+
|
237
|
+
@returned.should eq(["id",nil])
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
|
242
|
+
describe "primary_key?" do
|
243
|
+
|
244
|
+
it "should return true because table supports a primary key" do
|
245
|
+
|
246
|
+
@table = "role_types"
|
247
|
+
@adapter.should_receive(:supports_primary_key?).and_return(true)
|
248
|
+
@adapter.should_receive(:primary_key).with(@table).
|
249
|
+
and_return("id")
|
250
|
+
@returned = @instance.primary_key?(@table)
|
251
|
+
|
252
|
+
@returned.should eq(true)
|
253
|
+
end
|
254
|
+
|
255
|
+
it "should return false because this table doesn't support a primary key" do
|
256
|
+
|
257
|
+
@table = "some_table"
|
258
|
+
@adapter.should_receive(:supports_primary_key?).and_return(true)
|
259
|
+
@adapter.should_receive(:primary_key).with(@table).
|
260
|
+
and_return(nil)
|
261
|
+
@returned = @instance.primary_key?(@table)
|
262
|
+
|
263
|
+
@returned.should eq(false)
|
264
|
+
end
|
265
|
+
|
266
|
+
it "should return false because the db doesn't support primary keys" do
|
267
|
+
|
268
|
+
@table = "some_table"
|
269
|
+
@adapter.should_receive(:supports_primary_key?).and_return(false)
|
270
|
+
@returned = @instance.primary_key?(@table)
|
271
|
+
|
272
|
+
@returned.should eq(false)
|
273
|
+
end
|
274
|
+
|
275
|
+
end
|
276
|
+
|
277
|
+
describe "clean_nulls" do
|
278
|
+
|
279
|
+
before(:each) do
|
280
|
+
@connection_class = RailsDbAdmin::ConnectionHandler.create_connection_class("spec")
|
281
|
+
@instance = RailsDbAdmin::TableSupport.new(@connection_class)
|
282
|
+
@data_hash = {"description" => "",
|
283
|
+
"parent_id" => 0,
|
284
|
+
"id" => 0}
|
285
|
+
end
|
286
|
+
|
287
|
+
it "if a column is nullable, should convert \"\" to nil" do
|
288
|
+
|
289
|
+
@table = "role_types"
|
290
|
+
@instance.clean_nulls!(@table, @data_hash)
|
291
|
+
@data_hash["description"].should eq(nil)
|
292
|
+
end
|
293
|
+
|
294
|
+
it "if a column is nullable, should convert 0 to NULL" do
|
295
|
+
|
296
|
+
@table = "role_types"
|
297
|
+
@instance.clean_nulls!(@table, @data_hash)
|
298
|
+
@data_hash["parent_id"].should eq(nil)
|
299
|
+
end
|
300
|
+
|
301
|
+
it "if a column is not nullable, leave \"\" as \"\""
|
302
|
+
|
303
|
+
it "if a column is not nullable, leave 0 as 0" do
|
304
|
+
|
305
|
+
@table = "role_types"
|
306
|
+
@instance.clean_nulls!(@table, @data_hash)
|
307
|
+
@data_hash["id"].should eq(0)
|
308
|
+
end
|
309
|
+
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
describe "static methods" do
|
314
|
+
|
315
|
+
describe "add_fake_id_col" do
|
316
|
+
|
317
|
+
it "should return an array of hashes, where each hash has a fake_id column" do
|
318
|
+
|
319
|
+
data = [{:preference_type_id => "1",
|
320
|
+
:preference_option_id => "2",
|
321
|
+
:created_at => "2011-10-11 00:54:56.137144",
|
322
|
+
:updated_at => "2011-10-11 00:54:56.137144"},
|
323
|
+
{:preference_type_id => "2",
|
324
|
+
:preference_option_id => "2",
|
325
|
+
:created_at => "2011-10-11 00:54:56.137144",
|
326
|
+
:updated_at => "2011-10-11 00:54:56.137144"}]
|
327
|
+
|
328
|
+
result = {:fake_id => 1,
|
329
|
+
:preference_type_id => "1",
|
330
|
+
:preference_option_id => "2",
|
331
|
+
:created_at => "2011-10-11 00:54:56.137144",
|
332
|
+
:updated_at => "2011-10-11 00:54:56.137144"}
|
333
|
+
result2 = {:fake_id => 2,
|
334
|
+
:preference_type_id => "2",
|
335
|
+
:preference_option_id => "2",
|
336
|
+
:created_at => "2011-10-11 00:54:56.137144",
|
337
|
+
:updated_at => "2011-10-11 00:54:56.137144"}
|
338
|
+
|
339
|
+
|
340
|
+
returned = RailsDbAdmin::TableSupport.add_fake_id_col(data)
|
341
|
+
returned[0].should include(result)
|
342
|
+
returned[1].should include(result2)
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
|
349
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'spork'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
Spork.prefork do
|
5
|
+
# Loading more in this block will cause your tests to run faster. However,
|
6
|
+
# if you change any configuration or code from libraries loaded here, you'll
|
7
|
+
# need to restart spork for it take effect.
|
8
|
+
|
9
|
+
ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
|
10
|
+
DUMMY_APP_ROOT=File.join(File.dirname(__FILE__), '/dummy')
|
11
|
+
|
12
|
+
require 'active_support'
|
13
|
+
require 'active_model'
|
14
|
+
require 'active_record'
|
15
|
+
require 'action_controller'
|
16
|
+
|
17
|
+
# Configure Rails Envinronment
|
18
|
+
ENV["RAILS_ENV"] = "spec"
|
19
|
+
require File.expand_path(DUMMY_APP_ROOT + "/config/environment.rb", __FILE__)
|
20
|
+
|
21
|
+
ActiveRecord::Base.configurations = YAML::load(IO.read(DUMMY_APP_ROOT + "/config/database.yml"))
|
22
|
+
ActiveRecord::Base.establish_connection(ENV["DB"] || "spec")
|
23
|
+
ActiveRecord::Migration.verbose = false
|
24
|
+
|
25
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
26
|
+
# in spec/support/ and its subdirectories.
|
27
|
+
Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f }
|
28
|
+
|
29
|
+
require 'rspec/rails'
|
30
|
+
require 'erp_dev_svcs'
|
31
|
+
|
32
|
+
RSpec.configure do |config|
|
33
|
+
config.use_transactional_fixtures = true
|
34
|
+
config.include Sorcery::TestHelpers::Rails
|
35
|
+
config.include ErpDevSvcs
|
36
|
+
config.include ErpDevSvcs::ControllerSupport, :type => :controller
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Spork.each_run do
|
41
|
+
#We have to execute the migrations from dummy app directory
|
42
|
+
Dir.chdir DUMMY_APP_ROOT
|
43
|
+
`rake db:drop`
|
44
|
+
Dir.chdir ENGINE_RAILS_ROOT
|
45
|
+
|
46
|
+
#We have to execute the migrations from dummy app directory
|
47
|
+
Dir.chdir DUMMY_APP_ROOT
|
48
|
+
`rake db:migrate`
|
49
|
+
Dir.chdir ENGINE_RAILS_ROOT
|
50
|
+
|
51
|
+
ErpDevSvcs::FactorySupport.load_engine_factories
|
52
|
+
|
53
|
+
require 'simplecov'
|
54
|
+
SimpleCov.start 'rails' do
|
55
|
+
add_filter "spec/"
|
56
|
+
end
|
57
|
+
#Need to explictly load the files in lib/ until we figure out how to
|
58
|
+
#get rails to autoload them for spec like it used to...
|
59
|
+
Dir[File.join(ENGINE_RAILS_ROOT, "lib/**/*.rb")].each {|f| load f}
|
60
|
+
end
|
metadata
ADDED
@@ -0,0 +1,183 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails_db_admin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Rick Koloski, Russell Holmes
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-06 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: erp_app
|
16
|
+
requirement: &2161005240 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2161005240
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: erp_forms
|
27
|
+
requirement: &2161004540 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2161004540
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: erp_dev_svcs
|
38
|
+
requirement: &2161003500 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *2161003500
|
47
|
+
description: RailsDB Admin is similar in functionality to PHPMyAdmin and other database
|
48
|
+
browsing and data editing tools. It uses the CompassAE database connection information
|
49
|
+
to discover the schema for an installation, and generates Extjs UIs for creating
|
50
|
+
queries and performing grid-based data inspection and editing.
|
51
|
+
email:
|
52
|
+
- russonrails@gmail.com
|
53
|
+
executables: []
|
54
|
+
extensions: []
|
55
|
+
extra_rdoc_files: []
|
56
|
+
files:
|
57
|
+
- public/images/icons/rails_db_admin/rails_db_admin_16x16.png
|
58
|
+
- public/images/icons/rails_db_admin/rails_db_admin_24x24.png
|
59
|
+
- public/images/icons/rails_db_admin/rails_db_admin_32x32.png
|
60
|
+
- public/images/icons/rails_db_admin/rails_db_admin_48x48.png
|
61
|
+
- public/javascripts/erp_app/desktop/applications/rails_db_admin/database_combo.js
|
62
|
+
- public/javascripts/erp_app/desktop/applications/rails_db_admin/module.js
|
63
|
+
- public/javascripts/erp_app/desktop/applications/rails_db_admin/queries_tree_menu.js
|
64
|
+
- public/javascripts/erp_app/desktop/applications/rails_db_admin/query_panel.js
|
65
|
+
- public/javascripts/erp_app/desktop/applications/rails_db_admin/readonly_table_data_grid.js
|
66
|
+
- public/javascripts/erp_app/desktop/applications/rails_db_admin/tables_tree_menu.js
|
67
|
+
- public/stylesheets/erp_app/desktop/applications/rails_db_admin/rails_db_admin.css
|
68
|
+
- app/assets/javascripts/rails_db_admin/application.js
|
69
|
+
- app/assets/stylesheets/rails_db_admin/application.css
|
70
|
+
- app/controllers/rails_db_admin/erp_app/desktop/base_controller.rb
|
71
|
+
- app/controllers/rails_db_admin/erp_app/desktop/queries_controller.rb
|
72
|
+
- app/helpers/rails_db_admin/application_helper.rb
|
73
|
+
- app/views/layouts/application.html.erb
|
74
|
+
- app/views/layouts/rails_db_admin/application.html.erb
|
75
|
+
- config/initializers/rails_db_admin.rb
|
76
|
+
- config/routes.rb
|
77
|
+
- db/data_migrations/20110816005525_rails_db_admin_application.rb
|
78
|
+
- lib/rails_db_admin/config.rb
|
79
|
+
- lib/rails_db_admin/connection_handler.rb
|
80
|
+
- lib/rails_db_admin/engine.rb
|
81
|
+
- lib/rails_db_admin/extjs/json_column_builder.rb
|
82
|
+
- lib/rails_db_admin/extjs/json_data_builder.rb
|
83
|
+
- lib/rails_db_admin/extjs.rb
|
84
|
+
- lib/rails_db_admin/query_support.rb
|
85
|
+
- lib/rails_db_admin/table_support.rb
|
86
|
+
- lib/rails_db_admin/version.rb
|
87
|
+
- lib/rails_db_admin.rb
|
88
|
+
- lib/tasks/rails_db_admin_tasks.rake
|
89
|
+
- GPL-3-LICENSE
|
90
|
+
- Rakefile
|
91
|
+
- README.md
|
92
|
+
- spec/controllers/rails_db_admin/base_controller_spec.rb
|
93
|
+
- spec/controllers/rails_db_admin/queries_controller_spec.rb
|
94
|
+
- spec/dummy/app/assets/javascripts/application.js
|
95
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
96
|
+
- spec/dummy/app/controllers/application_controller.rb
|
97
|
+
- spec/dummy/app/helpers/application_helper.rb
|
98
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
99
|
+
- spec/dummy/config/application.rb
|
100
|
+
- spec/dummy/config/boot.rb
|
101
|
+
- spec/dummy/config/database.yml
|
102
|
+
- spec/dummy/config/environment.rb
|
103
|
+
- spec/dummy/config/environments/cucumber.rb
|
104
|
+
- spec/dummy/config/environments/spec.rb
|
105
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
106
|
+
- spec/dummy/config/initializers/inflections.rb
|
107
|
+
- spec/dummy/config/initializers/mime_types.rb
|
108
|
+
- spec/dummy/config/initializers/secret_token.rb
|
109
|
+
- spec/dummy/config/initializers/session_store.rb
|
110
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
111
|
+
- spec/dummy/config/locales/en.yml
|
112
|
+
- spec/dummy/config/routes.rb
|
113
|
+
- spec/dummy/config.ru
|
114
|
+
- spec/dummy/public/404.html
|
115
|
+
- spec/dummy/public/422.html
|
116
|
+
- spec/dummy/public/500.html
|
117
|
+
- spec/dummy/public/favicon.ico
|
118
|
+
- spec/dummy/Rakefile
|
119
|
+
- spec/dummy/script/rails
|
120
|
+
- spec/lib/rails_db_admin/extjs/json_column_builder_spec.rb
|
121
|
+
- spec/lib/rails_db_admin/extjs/json_data_builder_spec.rb
|
122
|
+
- spec/lib/rails_db_admin/query_support_spec.rb
|
123
|
+
- spec/lib/rails_db_admin/table_support_spec.rb
|
124
|
+
- spec/spec_helper.rb
|
125
|
+
homepage: http://development.compassagile.com
|
126
|
+
licenses: []
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
requirements: []
|
144
|
+
rubyforge_project:
|
145
|
+
rubygems_version: 1.8.10
|
146
|
+
signing_key:
|
147
|
+
specification_version: 3
|
148
|
+
summary: RailsDB Admin is similar in functionality to PHPMyAdmin and other database
|
149
|
+
browsing and data editing tools.
|
150
|
+
test_files:
|
151
|
+
- spec/controllers/rails_db_admin/base_controller_spec.rb
|
152
|
+
- spec/controllers/rails_db_admin/queries_controller_spec.rb
|
153
|
+
- spec/dummy/app/assets/javascripts/application.js
|
154
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
155
|
+
- spec/dummy/app/controllers/application_controller.rb
|
156
|
+
- spec/dummy/app/helpers/application_helper.rb
|
157
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
158
|
+
- spec/dummy/config/application.rb
|
159
|
+
- spec/dummy/config/boot.rb
|
160
|
+
- spec/dummy/config/database.yml
|
161
|
+
- spec/dummy/config/environment.rb
|
162
|
+
- spec/dummy/config/environments/cucumber.rb
|
163
|
+
- spec/dummy/config/environments/spec.rb
|
164
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
165
|
+
- spec/dummy/config/initializers/inflections.rb
|
166
|
+
- spec/dummy/config/initializers/mime_types.rb
|
167
|
+
- spec/dummy/config/initializers/secret_token.rb
|
168
|
+
- spec/dummy/config/initializers/session_store.rb
|
169
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
170
|
+
- spec/dummy/config/locales/en.yml
|
171
|
+
- spec/dummy/config/routes.rb
|
172
|
+
- spec/dummy/config.ru
|
173
|
+
- spec/dummy/public/404.html
|
174
|
+
- spec/dummy/public/422.html
|
175
|
+
- spec/dummy/public/500.html
|
176
|
+
- spec/dummy/public/favicon.ico
|
177
|
+
- spec/dummy/Rakefile
|
178
|
+
- spec/dummy/script/rails
|
179
|
+
- spec/lib/rails_db_admin/extjs/json_column_builder_spec.rb
|
180
|
+
- spec/lib/rails_db_admin/extjs/json_data_builder_spec.rb
|
181
|
+
- spec/lib/rails_db_admin/query_support_spec.rb
|
182
|
+
- spec/lib/rails_db_admin/table_support_spec.rb
|
183
|
+
- spec/spec_helper.rb
|