Skip to content
Browse files

Organizations can now pitch

  • Loading branch information...
1 parent 7a25334 commit ceae8e0204a8fc37d1a92a308c1e8f7b3ca0477a @spherop spherop committed Sep 18, 2009
View
2 app/controllers/homes_controller.rb
@@ -9,7 +9,7 @@ def start_story
if !logged_in?
session[:return_to] = start_story_path
redirect_to new_session_path
- elsif logged_in? && current_user.is_a?(Reporter)
+ elsif logged_in? && current_user.is_a?(Reporter) || current_user.is_a?(Organization)
redirect_to new_pitch_path
else
redirect_to new_tip_path
View
2 app/models/pitch.rb
@@ -170,7 +170,7 @@ def self.with_sort(sort='desc')
end
def self.createable_by?(user)
- user && user.reporter?
+ user && user.reporter? || user.organization?
end
def featured?
View
1 config/environment.rb
@@ -22,6 +22,7 @@
config.gem "rubyist-aasm", :lib => "aasm", :version => '>=2.0.5', :source => 'http://gems.github.com'
config.gem 'mislav-will_paginate', :lib => 'will_paginate', :version => '>=2.3.7', :source => 'http://gems.github.com/'
config.gem "rspec-rails", :lib => false, :version => "= 1.2.2"
+ config.gem "rspec", :lib => false, :version => "= 1.2.2"
config.gem "cucumber", :lib => false, :version => "= 0.1.16"
config.gem "webrat", :lib => false, :version => ">= 0.4.4"
config.gem "money", :version => ">=2.1.3"
View
1 db/migrate/20090219203016_load_display_name_for_default_network.rb
@@ -1,5 +1,6 @@
class LoadDisplayNameForDefaultNetwork < ActiveRecord::Migration
def self.up
+ #Network.reset_column_information
Network.create!(:name => 'sfbay', :display_name => 'Bay Area')
end
View
4 spec/models/pitch_spec.rb
@@ -508,6 +508,10 @@
it "is creatable by reporter" do
Pitch.createable_by?(Factory(:reporter)).should be
end
+
+ it "is creatable by organization" do
+ Pitch.createable_by?(Factory(:organization)).should be
+ end
it "is not creatable by user" do
Pitch.createable_by?(Factory(:user)).should_not be_true

0 comments on commit ceae8e0

Please sign in to comment.
Something went wrong with that request. Please try again.