Sha256: baf95b423aae7a93544005e1a6a5ce8f6dc1c44d9ef7d50fe914b549d2835be7
Contents?: true
Size: 938 Bytes
Versions: 1
Compression:
Stored size: 938 Bytes
Contents
class SalariesController < AuthorizedController # Filter/Search # ============= has_scope :by_state has_scope :by_value_period, :using => [:from, :to], :default => proc { |c| c.session[:has_scope] } has_scope :by_employee_id # Actions # ======= def statistics index! end def new # Allow pre-seeding some parameters salary_params = { :employer => current_tenant.company, :state => 'booked', :duration_from => Date.today, :duration_to => Date.today.in(30.days).to_date } # Set default parameters salary_params.merge!(params[:salary]) if params[:salary] @salary = Salary.new(salary_params) # Prebuild an empty attachment instance @salary.attachments.build new! end def create @salary = Salary.new(params[:salary]) if @salary.valid? @salary.build_booking end create! end def payslip show! end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bookyt-0.0.1 | app/controllers/salaries_controller.rb |