Skip to content

Commit

Permalink
Get rid Models.Y, was it ever used?
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Nov 30, 2009
1 parent 7785812 commit a7be307
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/camping-unabridged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/camping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions lib/camping/ar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit a7be307

Please sign in to comment.