Skip to content

Instantly share code, notes, and snippets.

@laspluviosillas
Created March 18, 2013 15:05
Show Gist options
  • Save laspluviosillas/5187805 to your computer and use it in GitHub Desktop.
Save laspluviosillas/5187805 to your computer and use it in GitHub Desktop.
module Payroll
class Period < ActiveRecord::Base
set_table_name "payroll_periods"
has_many :fps_submissions,
:dependent => :delete_all,
:class_name => 'Payroll::FpsSubmission'
# Public: prepares a VatSubmission so it's ready for validation
#
# gateway_id - The users Government Gateway login as a String.
# gateway_password - The users Government Gateway password as a String.
# user - The User who is submitting the VatReturn.
#
# Returns nothing
def prepare_submission(gateway_id, gateway_password, user)
@current_submission = fps_submissions.build(
:gateway_id => gateway_id.gsub(/ +/, ''),
:gateway_password => gateway_password.gsub(/ +/, ''),
:sender => sender_for_user(user)
)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment