Changeset 582
- Timestamp:
- 09/08/07 21:25:39 (1 year ago)
- Files:
-
- apps/marble/trunk/app/models/comment.rb (modified) (1 diff)
- apps/marble/trunk/config/dependencies.rb (modified) (2 diffs)
- apps/marble/trunk/config/router.rb (modified) (1 diff)
- apps/marble/trunk/lib/magic_scaffold.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
apps/marble/trunk/app/models/comment.rb
r500 r582 17 17 when 'test', 'development' 18 18 recreate_table 19 [ 20 {:user_id => 1, :title => "I Like Your Site", :body => "Dude, nice site. Want some cheap pharmaceutical products?"} 21 ].each{ |row| insert row } 19 22 end 20 23 end apps/marble/trunk/config/dependencies.rb
r572 r582 1 1 puts "Loading dependencies..." 2 3 # Make the app's "deps" directory a place where gems are loaded from 2 4 Gem.clear_paths 3 5 Gem.path.unshift(MERB_ROOT / "deps") 4 $LOAD_PATH.unshift(File.join(MERB_ROOT, "lib")) 6 7 # Make theh app's "lib" directory a place where ruby files get "require"d from 8 $LOAD_PATH.unshift(MERB_ROOT / "lib") 5 9 6 10 # Need to get merb_sequel from svn, package it, and install it in deps/ before the next line: … … 11 15 require 'sequel_extra/mysql_table_columns' 12 16 17 Merb::Server.after_app_loads do 18 ### Add dependencies here that must load after the application loads: 19 20 # dependency "magic_admin" # this gem uses the app's model classes 21 end 22 13 23 # We pick up any old-style plugins in deps/plugins as a last-effort 14 Dir["#{MERB_ROOT}/deps/plugins/*/*.rb"].each { |m| require m } 15 24 Dir["#{MERB_ROOT}/deps/plugins/*/init.rb"].each { |m| require m } apps/marble/trunk/config/router.rb
r500 r582 32 32 admin.resources(:posts, :controller => 'admin/posts') 33 33 admin.resources(:comments, :controller => 'admin/comments') 34 # Default admin to Users#index 35 admin.match(%r[/?]).to(:controller => 'admin/users') 34 36 end 35 37 apps/marble/trunk/lib/magic_scaffold.rb
r570 r582 56 56 57 57 new_contents = "#{top.join}#{bottom.join}" 58 58 59 unless new_contents == original_contents 59 60 puts "Scaffolding #{model_class} - #{filename}:#{line}" … … 61 62 f.write new_contents 62 63 end 63 64 meta_def(:scaffold_loaded) { true } 65 66 load filename 67 end 64 end 65 66 meta_def(:scaffold_loaded) { true } 67 load filename 68 68 end 69 69 end
