Added Fred's Strong Parameter work
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
class Analytics < ActiveRecord::Base
|
||||
attr_accessible :ip_address, :referrer, :user_agent
|
||||
|
||||
scope :hits_by_ip, ->(ip,col="*") { select("#{col}").where(:ip_address => ip).order("id DESC")}
|
||||
|
||||
def self.count_by_col(col)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Benefits < ActiveRecord::Base
|
||||
attr_accessor :backup
|
||||
|
||||
def self.save(file, backup=false)
|
||||
data_path = Rails.root.join("public", "data")
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class KeyManagement < ActiveRecord::Base
|
||||
attr_accessible :iv, :user_id
|
||||
belongs_to :work_info
|
||||
belongs_to :user
|
||||
end
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Message < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
attr_accessible :creator_id, :message, :read, :receiver_id
|
||||
validates_presence_of :creator_id, :receiver_id, :message
|
||||
|
||||
def creator_name
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class PaidTimeOff < ActiveRecord::Base
|
||||
attr_accessible :pto_earned, :pto_taken, :sick_days_earned, :sick_days_taken
|
||||
belongs_to :user
|
||||
has_many :schedule, :foreign_key => :user_id, :primary_key => :user_id, :dependent => :destroy
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
class Pay < ActiveRecord::Base
|
||||
# mass-assignable attributes
|
||||
attr_accessible :bank_account_num, :bank_routing_num, :percent_of_deposit
|
||||
|
||||
# Associations
|
||||
belongs_to :user
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Performance < ActiveRecord::Base
|
||||
attr_accessible :comments, :date_submitted, :reviewer, :score
|
||||
belongs_to :user
|
||||
|
||||
def reviewer_name
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
class Retirement < ActiveRecord::Base
|
||||
attr_accessible :employee_contrib, :employer_contrib, :total
|
||||
belongs_to :user
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Schedule < ActiveRecord::Base
|
||||
attr_accessible :date_begin, :date_end, :event_desc, :event_name, :event_type
|
||||
belongs_to :paid_time_off
|
||||
|
||||
validates_presence_of :date_begin, :date_end, :event_desc, :event_name, :event_type
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require 'encryption'
|
||||
|
||||
class User < ActiveRecord::Base
|
||||
attr_accessible :email, :admin, :first_name, :last_name, :user_id, :password, :password_confirmation
|
||||
validates :password, :presence => true,
|
||||
:confirmation => true,
|
||||
:length => {:within => 6..40},
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class WorkInfo < ActiveRecord::Base
|
||||
attr_accessible :DoB, :SSN, :bonuses, :income, :years_worked
|
||||
belongs_to :user
|
||||
has_one :key_management, :foreign_key => :user_id, :primary_key => :user_id, :dependent => :destroy
|
||||
#before_save :encrypt_ssn
|
||||
|
||||
Reference in New Issue
Block a user