public
Fork of courtenay/altered_beast
Description: Ground-up rewrite of Beast, a Ruby on Rails forum.
Homepage: http://activereload.lighthouseapp.com/projects/7537-altered-beast/
Clone URL: git://github.com/technoweenie/altered_beast.git
Fixed validation error with Moderatorship model.
nbibler (author)
Thu Apr 24 19:05:56 -0700 2008
commit  ce0fa8c69cc36501416949608cb88227139eb3db
tree    b8b52ad4bc1ab04c207c18032ff7e1fcacbe2ce8
parent  a9221819c74854c157336c304779999533ca5475
...
13
14
15
16
 
17
18
19
...
13
14
15
 
16
17
18
19
0
@@ -13,7 +13,7 @@ protected
0
   end
0
   
0
   def user_and_forum_in_same_site
0
- unless user.site_id == forum.site_id
0
+ if user && forum && user.site_id != forum.site_id
0
       errors.add_to_base("User and Forum must be in the same Site.")
0
     end
0
   end
...
25
26
27
28
 
29
30
31
...
25
26
27
 
28
29
30
31
0
@@ -25,7 +25,7 @@ describe Moderatorship do
0
   
0
   %w(user_id forum_id).each do |attr|
0
     it "requires #{attr}" do
0
- mod = new_moderatorship(:default)
0
+ mod = Moderatorship.new
0
       mod.send("#{attr}=", nil)
0
       mod.should_not be_valid
0
       mod.errors.on(attr).should_not be_nil

Comments

    No one has commented yet.