lib/knj/knjdb/drivers/mysql/knjdb_mysql_tables.rb in knjrbfw-0.0.59 vs lib/knj/knjdb/drivers/mysql/knjdb_mysql_tables.rb in knjrbfw-0.0.62
- old
+ new
@@ -29,11 +29,11 @@
self.list(:name => table_name) do |table_obj|
return table_obj if table_obj.name == table_name
end
- raise Knj::Errors::NotFound.new("Table was not found: #{table_name}.")
+ raise Errno::ENOENT.new("Table was not found: #{table_name}.")
end
#Yields the tables of the current database.
def list(args = {})
ret = {} unless block_given?
@@ -101,11 +101,11 @@
@db.query(sql)
end
end
class KnjDB_mysql::Tables::Table
- attr_accessor :list
+ attr_reader :list
def initialize(args)
@args = args
@db = args[:db]
@data = args[:data]
@@ -158,11 +158,11 @@
self.columns(:name => name) do |col|
return col if col.name == name
end
- raise Knj::Errors::NotFound.new("Column not found: '#{name}'.")
+ raise Errno::ENOENT.new("Column not found: '#{name}'.")
end
def columns(args = nil)
@db.cols
ret = {}
@@ -240,10 +240,10 @@
self.indexes(:name => name) do |index|
return index if index.name.to_s == name
end
- raise Knj::Errors::NotFound.new("Index not found: #{name}.")
+ raise Errno::ENOENT.new("Index not found: #{name}.")
end
def create_columns(col_arr)
col_arr.each do |col_data|
sql = "ALTER TABLE `#{self.name}` ADD COLUMN #{@db.cols.data_sql(col_data)};"
\ No newline at end of file