GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
fixed active_record controller helpers to use find_by_name
automatthew (author)
Fri Jul 11 20:32:53 -0700 2008
commit  3348ab86f52094e3df4b60b3d0ee8e263d7b82e3
tree    e798d61115f408a172988912c3e50b0bdcfb61ba
parent  f8fc5eab8cedde64aef33913913918a0a0a49fb2
...
20
21
22
23
24
25
26
27
28
 
29
30
31
...
66
67
68
69
70
 
 
71
72
73
74
75
76
77
78
 
 
79
80
81
82
 
 
83
84
85
...
20
21
22
 
 
 
 
 
 
23
24
25
26
...
61
62
63
 
 
64
65
66
67
68
69
70
71
 
 
72
73
74
75
 
 
76
77
78
79
80
0
@@ -20,12 +20,7 @@ module Waves
0
         
0
         def self.included(app)
0
           
0
- class Symbol
0
- # Protect ActiveRecord from itself by undefining the to_proc method.
0
- # Don't worry, AR will redefine it.
0
- alias :extensions_to_proc :to_proc
0
- remove_method :to_proc
0
- end
0
+
0
           require 'active_record'
0
           require "#{File.dirname(__FILE__)}/active_record/tasks/schema" if defined?(Rake)
0
           require "#{File.dirname(__FILE__)}/active_record/tasks/generate" if defined?(Rake)
0
@@ -66,20 +61,20 @@ module Waves
0
             model.find(:all)
0
           end
0
           
0
- def find( id )
0
- model.find(id) or not_found
0
+ def find( name )
0
+ model.find_by_name(name) or not_found
0
           end
0
           
0
           def create
0
             model.create( attributes )
0
           end
0
           
0
- def delete( id )
0
- find( id ).destroy
0
+ def delete( name )
0
+ find( name ).destroy
0
           end
0
           
0
- def update( id )
0
- instance = find( id )
0
+ def update( name )
0
+ instance = find( name )
0
             instance.update_attributes( attributes )
0
             instance
0
           end

Comments

    No one has commented yet.