account working
This commit is contained in:
7
app/models/account.rb
Normal file
7
app/models/account.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Account < ApplicationRecord
|
||||
validates_presence_of :title, :account_type
|
||||
|
||||
has_many :menu_items
|
||||
# belongs_to :lookup , :class_name => "Lookup" ,:foreign_key => :tax_type
|
||||
|
||||
end
|
||||
5
app/models/crm.rb
Normal file
5
app/models/crm.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module Crm
|
||||
def self.table_name_prefix
|
||||
'crm_'
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,6 @@
|
||||
class Lookup < ApplicationRecord
|
||||
|
||||
has_many :accounts
|
||||
|
||||
def available_types
|
||||
{'Employee Roles' => 'employee_roles',
|
||||
|
||||
@@ -3,7 +3,8 @@ class MenuItem < ApplicationRecord
|
||||
has_many :menu_item_instances
|
||||
belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true
|
||||
has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
|
||||
|
||||
belongs_to :account
|
||||
|
||||
default_scope { order('item_code asc') }
|
||||
|
||||
def self.collection
|
||||
|
||||
Reference in New Issue
Block a user