This file contains 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
from = Date.parse("1-10-2017") | |
to = Date.parse("30-10-2017") | |
date_range = (from..to).map { |d| d } |
This file contains 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
Rails.application.eager_load! | |
ActiveRecord::Base.descendants # It returns all models and its attributes. | |
ApplicationRecord.descendants.collect(&:name) # It returns only the model names |
This file contains 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
wb = xlsx_package.workbook #create excel book | |
wb.add_worksheet(name: "Stock Status") do |sheet| | |
sps_img = File.expand_path(Rails.root+'app/assets/images/sps_logo.png') | |
sheet.add_image(:image_src => sps_img, :end_at => true) do |image| | |
image.start_at 0, 0 | |
image.end_at 3, 4 | |
end | |
header = wb.styles.add_style({:alignment => {:horizontal => :center, :vertical => :center, :wrap_text => true}, :border => { :style => :thin, :color => "000000" }}) | |
border = wb.styles.add_style({:border => { :style => :thin, :color => "000000" }}) | |
align_right = wb.styles.add_style({:alignment => {:horizontal => :right}}) |
This file contains 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
git log --author="Kalaivani Murugan" // list your commits only |
This file contains 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
config.logger = Logger.new(config.paths["log"].first, 5, 25.megabytes) # Keeps the Last 5 log files which are rotated at every 25MB | |
config.log_level = :error #in log file the errors only wriiten. |