Skip to content

Commit

Permalink
Replacing autoload of camping/db with camping/ar
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed May 24, 2008
1 parent 95d2262 commit 56d4c3a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/camping-unabridged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ module Views; include X, Helpers end
#
# Models cannot be referred to in Views at this time.
module Models
autoload :Base,'camping/db'
autoload :Base,'camping/ar'
def Y;self;end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/camping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ def method_missing m,c,*a;X.M;h=Hash===a[-1]?H[a.pop]:{};e=
H[h[:env]||{}].u({'rack.input'=>StringIO.new,'REQUEST_METHOD'=>m.to_s})
k=X.const_get(c).new(H[e]);k.send("input=",h[:input])if h[:input]
k.service(*a);end;end;module Views;include X,Helpers end;module Models
autoload:Base,'camping/db';def Y;self;end end;autoload:Mab,'camping/mab'end
autoload:Base,'camping/ar';def Y;self;end end;autoload:Mab,'camping/mab'end
2 changes: 1 addition & 1 deletion lib/camping/ar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def Base.table_name_prefix
module_eval $AR_EXTRAS
end
end
Camping::S.sub! /autoload\s*:Base\s*,\s*['"]camping\/db['"]/, ""
Camping::S.sub! /autoload\s*:Base\s*,\s*['"]camping\/ar['"]/, ""
Camping::S.sub! /def\s*Y[;\s]*self[;\s]*end/, $AR_EXTRAS
Object.constants.map{|c|Object.const_get(c)}.each do |c|
c::Models.module_eval $AR_EXTRAS if c.respond_to?(:goes)
Expand Down

0 comments on commit 56d4c3a

Please sign in to comment.