Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…rguments on stubbed out methods
  • Loading branch information...
commit ced54eefe1ae1362e8b6476143c324f7814179d0 1 parent 44dd4b9
Brendon Muir brendon authored committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/activerecord-tableless.rb
10 lib/activerecord-tableless.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.