Permalink
Browse files

Added the ability to check if a model is tableless, and allowed for a…

…rguments on stubbed out methods
  • Loading branch information...
1 parent 44dd4b9 commit ced54eefe1ae1362e8b6476143c324f7814179d0 @brendon brendon committed with Aug 3, 2009
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/activerecord-tableless.rb
@@ -55,6 +55,9 @@ def has_no_table
# setup columns
end
+ def tableless?
+ false
+ end
end
module SingletonMethods
@@ -79,13 +82,16 @@ def add_columns(sql_type, *args)
%w(find create destroy).each do |m|
eval %{
- def #{m}
+ def #{m}(*args)
logger.warn "Can't #{m} a Tableless object"
false
end
}
end
+ def tableless?
+ true
+ end
end
module ClassMethods
@@ -116,7 +122,7 @@ def to_query_string(prefix = nil)
%w(save destroy).each do |m|
eval %{
- def #{m}
+ def #{m}(*args)
logger.warn "Can't #{m} a Tableless object"
false
end

0 comments on commit ced54ee

Please sign in to comment.