makumba_import 0.0.3 → 0.0.4
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.
- data/lib/makumba_import/importer.rb +2 -2
- data/lib/makumba_import/legacy.rb +4 -2
- metadata +1 -1
@@ -216,7 +216,6 @@ module MakumbaImport
|
|
216
216
|
txt << "class "+tablename.classify+" < ActiveRecord::Base\n"
|
217
217
|
txt << " set_table_name \""+tablename+"_\"\n"
|
218
218
|
txt << " set_primary_key \""+lastpart+"_\"\n"
|
219
|
-
txt << " fix_makumba_columns\n\n"
|
220
219
|
|
221
220
|
table.each do |name, field|
|
222
221
|
if name == 'ref'
|
@@ -230,8 +229,9 @@ module MakumbaImport
|
|
230
229
|
#puts " belongs_to :"+name.downcase+", :foreign_key => '"+name+"_', :class_name => '"+field['ptr'].gsub(".", "_").classify+"'\n"
|
231
230
|
end
|
232
231
|
end
|
233
|
-
|
234
232
|
end
|
233
|
+
|
234
|
+
txt << " fix_makumba_columns\n\n"
|
235
235
|
|
236
236
|
txt << "end\n\n"
|
237
237
|
|
@@ -8,8 +8,10 @@ module LegacyMakumba
|
|
8
8
|
column_names.each do |old_name|
|
9
9
|
if old_name.match(/_$/)
|
10
10
|
new_name = old_name[0...-1]
|
11
|
-
self.
|
12
|
-
|
11
|
+
unless self.method_defined? new_name
|
12
|
+
self.send(:define_method, new_name) { self.send(old_name) }
|
13
|
+
self.send(:define_method, "#{new_name}=") { |value| self.send("#{old_name}=", value) }
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|