diff --git a/lib/camping-unabridged.rb b/lib/camping-unabridged.rb index b74c71a..88475b5 100644 --- a/lib/camping-unabridged.rb +++ b/lib/camping-unabridged.rb @@ -691,8 +691,7 @@ module Views; include X, Helpers end # # Models cannot be referred to in Views at this time. module Models - autoload :Base,'camping/ar' - def Y;self;end + autoload :Base,'camping/ar' end autoload :Mab, 'camping/mab' diff --git a/lib/camping.rb b/lib/camping.rb index 342401e..2bedb65 100644 --- a/lib/camping.rb +++ b/lib/camping.rb @@ -48,4 +48,4 @@ def method_missing m,c,*a;X.M;h=Hash===a[-1]?a.pop: {} k=X.const_get(c).new(e,m.to_s);k.send("input=",h[:input])if h[:input] k.service(*a);end;def use*a,&b;m=a.shift.new(method(:call),*a,&b);meta_def(:call){|e| m.call(e)}end end;module Views;include X,Helpers end;module Models -autoload:Base,'camping/ar';def Y;self;end end;autoload:Mab,'camping/mab';C end +autoload:Base,'camping/ar';end;autoload:Mab,'camping/mab';C end diff --git a/lib/camping/ar.rb b/lib/camping/ar.rb index 47eea89..334158e 100644 --- a/lib/camping/ar.rb +++ b/lib/camping/ar.rb @@ -9,8 +9,6 @@ class MissingLibrary < Exception #:nodoc: all $AR_EXTRAS = %{ Base = ActiveRecord::Base unless const_defined? :Base - def Y; ActiveRecord::Base.verify_active_connections!; self; end - class SchemaInfo < Base end @@ -71,8 +69,7 @@ def Base.table_name_prefix module_eval $AR_EXTRAS end end -Camping::S.sub! /autoload\s*:Base\s*,\s*['"]camping\/ar['"]/, "" -Camping::S.sub! /def\s*Y[;\s]*self[;\s]*end/, $AR_EXTRAS +Camping::S.sub! /autoload\s*:Base\s*,\s*['"]camping\/ar['"]/, $AR_EXTRAS Camping::Apps.each do |c| c::Models.module_eval $AR_EXTRAS end