Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
CI / scan_ruby (push) Failing after 11m20s
CI / scan_js (push) Successful in 10m35s
CI / lint (push) Has been cancelled

Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 23:01:48 +02:00
co-authored by Cursor
commit c4e5f289cf
258 changed files with 11293 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
class Project < ApplicationRecord
include Auditable
has_many :user_projects, dependent: :destroy
has_many :users, through: :user_projects
has_many :organization_projects, dependent: :destroy
has_many :organizations, through: :organization_projects
has_many :opportunities, dependent: :restrict_with_exception
has_many :sales_goals, dependent: :nullify
has_many :mail_templates, dependent: :destroy
has_many :mailings, dependent: :destroy
validates :name, :code, presence: true
validates :code, uniqueness: { case_sensitive: false },
format: { with: /\A[a-z0-9_-]+\z/, message: "usa solo lettere minuscole, numeri, - e _" }
before_validation :normalize_code
scope :active, -> { where(active: true) }
scope :ordered, -> { order(:position, :name) }
def to_s
name
end
private
def normalize_code
self.code = code.to_s.strip.downcase.parameterize(separator: "_")
end
end