This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include RoleModel | |
| roles_attribute :roles_mask | |
| roles :guest, :executive, :manager, :sales, :cxo, :admin | |
| before_create :set_roles_mask | |
| def set_roles_mask | |
| emp = Employee.find_by(email: self.email) | |
| if emp == nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if user.has_role? :commercial_officer | |
| can :claimsForChecking, ExpensesClaim | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def second_or_fourth_saturday?(date) | |
| date.saturday? && ((date.day - 1) / 7).odd? | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def second_or_fourth_saturday?(date) | |
| return false unless date.saturday? | |
| (8..14).include?(date.day) || (22..28).include?(date.day) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fourth_saturday?(date) | |
| saturdays = (date.beginning_of_month..date.end_of_month).select { |date| date.wday == 6 } | |
| [saturdays.second, saturdays.fourth].include?(date) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'prawn' | |
| require 'prawn/table' | |
| def bullet_item string | |
| indent 15, 0 do | |
| text "* " + string, :align => :justify | |
| end | |
| end | |
| def bullet_item_2 string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def bullet_item string | |
| indent 15, 0 do | |
| text "* " + string, :align => :justify | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p> | |
| <strong>Terms & Conditions:</strong><br> | |
| <% if @offer.tnc != nil %> | |
| <% @offer.tnc.split("\n").each do |t| %> | |
| <span class="bordered-span"> <%= t %> </span><br> | |
| <% end %> | |
| <% end %> | |
| </p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title> Dynamically add / delete rows in HTML page </title> | |
| <style> | |
| .dropdown { | |
| position: relative; | |
| width: 200px; | |
| } | |
| .dropdown select |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title> Dynamically add / delete rows in HTML page </title> | |
| <script language="javascript"> | |
| var globalRowCount = 2; | |
| function addScreenRow(tableID) | |
| { | |
| var table = document.getElementById(tableID); | |
| var rowCount = table.rows.length; |