Class: DatabaseLoader::RubyFile
- Inherits:
-
SqlFile
- Object
- SqlFile
- DatabaseLoader::RubyFile
show all
- Defined in:
- lib/database_loader/ruby_file.rb
Instance Attribute Summary
Attributes inherited from SqlFile
#path, #username
Instance Method Summary
collapse
Methods inherited from SqlFile
#initialize, #name, #read, #type
Instance Method Details
#excerpt ⇒ Object
8
9
10
|
# File 'lib/database_loader/ruby_file.rb', line 8
def excerpt
"#{read.first(60)} ..."
end
|
#execute ⇒ Object
16
17
18
19
20
21
|
# File 'lib/database_loader/ruby_file.rb', line 16
def execute
content = read
ActiveRecord::Schema.define do
instance_eval(content)
end
end
|
#render ⇒ Object
Also known as:
to_s
3
4
5
|
# File 'lib/database_loader/ruby_file.rb', line 3
def render
"-- Cannot dump ruby file"
end
|
#statements ⇒ Object
12
13
14
|
# File 'lib/database_loader/ruby_file.rb', line 12
def statements
[self]
end
|