Skip to content

Commit

Permalink
Allow creating opportunities with non-unique name
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Dvorkin committed Sep 30, 2009
1 parent d9497c9 commit cdeae26
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ It does not matter how slowly you go as long as you do not stop.
First they ignore you, then they laugh at you, then they fight you,
then you win. –- Mahatma Gandhi

Sum, Sep 27, 2009
Tue, Sep 29, 2009
---------------------------------------------------------------------
- Adjusted activity timestamp to reflect UTC offset (thanks, Andrew!)
- Allow creating opportunities with non-unique name.

Sun, Sep 27, 2009
---------------------------------------------------------------------
- Added sidebar hooks on asset landing pages.
- crm_tags: added support for showing tags on asset landing pages.
Expand Down
1 change: 0 additions & 1 deletion app/models/opportunity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class Opportunity < ActiveRecord::Base
acts_as_paranoid

validates_presence_of :name, :message => "^Please specify the opportunity name."
validates_uniqueness_of :name, :scope => :user_id
validates_numericality_of [ :probability, :amount, :discount ], :allow_nil => true
validate :users_for_shared_access

Expand Down
5 changes: 5 additions & 0 deletions spec/models/opportunity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@
Opportunity.create!(:name => "Opportunity")
end

it "should be possible to create opportunity with the same name" do
first = Factory(:opportunity, :name => "Hello", :user => @current_user)
lambda { Factory(:opportunity, :name => "Hello", :user => @current_user) }.should_not raise_error(ActiveRecord::RecordInvalid)
end

end

0 comments on commit cdeae26

Please sign in to comment.