app/models/entities/opportunity.rb in fat_free_crm-0.11.1 vs app/models/entities/opportunity.rb in fat_free_crm-0.11.2
- old
+ new
@@ -46,10 +46,12 @@
has_many :contact_opportunities, :dependent => :destroy
has_many :contacts, :through => :contact_opportunities, :uniq => true, :order => "contacts.id DESC"
has_many :tasks, :as => :asset, :dependent => :destroy#, :order => 'created_at DESC'
has_many :emails, :as => :mediator
+ serialize :subscribed_users, Set
+
scope :state, lambda { |filters|
where('stage IN (?)' + (filters.delete('other') ? ' OR stage IS NULL' : ''), filters)
}
scope :created_by, lambda { |user| where('user_id = ?', user.id) }
scope :assigned_to, lambda { |user| where('assigned_to = ?', user.id) }
@@ -69,10 +71,10 @@
}
uses_user_permissions
acts_as_commentable
acts_as_taggable_on :tags
- has_paper_trail
+ has_paper_trail :ignore => [ :subscribed_users ]
has_fields
exportable
sortable :by => [ "name ASC", "amount DESC", "amount*probability DESC", "probability DESC", "closes_on ASC", "created_at DESC", "updated_at DESC" ], :default => "created_at DESC"
validates_presence_of :name, :message => :missing_opportunity_name