Permalink
Browse files

Stubbed some database methods

  • Loading branch information...
1 parent 9a6b527 commit 2687b2d3f7a5a3cebdbc5e649ee9cba888b222bd @wagenet wagenet committed May 22, 2008
Showing with 25 additions and 0 deletions.
  1. +25 −0 lib/tableless.rb
View
@@ -48,6 +48,9 @@ def has_no_table
# extend
extend ActiveRecord::Tableless::SingletonMethods
+ # include
+ include ActiveRecord::Tableless::InstanceMethods
+
# setup columns
end
@@ -66,6 +69,28 @@ def column(name, sql_type = nil, default = nil, null = true)
tableless_options[:columns] << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
end
+ %w(find create destroy).each do |m|
+ eval %{
+ def #{m}
+ logger.warn "Can't #{m} a Tableless object"
+ false
+ end
+ }
+ end
+
+ end
+
+ module InstanceMethods
+
+ %w(save destroy).each do |m|
+ eval %{
+ def #{m}
+ logger.warn "Can't #{m} a Tableless object"
+ false
+ end
+ }
+ end
+
end
end

0 comments on commit 2687b2d

Please sign in to comment.