More contract tweaks
This commit is contained in:
@@ -12,7 +12,6 @@ class Ability
|
||||
# By default, users can only see their own stuff
|
||||
can :read, Card, :user_id => user.id
|
||||
can :read, Certification
|
||||
can :read, Contract
|
||||
can :read_details, Mac
|
||||
can [:update], Mac, :user_id => nil
|
||||
can [:create,:update], Mac, :user_id => user.id
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Contract < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
attr_accessible :user_id, :first_name, :last_name, :signed_at, :document, :document_file_name, :document_content_type, :document_file_size, :document_updated_at
|
||||
attr_accessible :user_id, :first_name, :last_name, :cosigner, :signed_at, :document, :document_file_name, :document_content_type, :document_file_size, :document_updated_at
|
||||
|
||||
validates_presence_of :first_name, :signed_at #, :last_name
|
||||
|
||||
|
||||
@@ -145,7 +145,11 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def contract_date
|
||||
self.contracts.first.signed_at unless self.contracts.blank?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def send_new_user_email
|
||||
Rails.logger.info UserMailer.new_user_email(self).deliver
|
||||
|
||||
Reference in New Issue
Block a user