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
def errors_report | |
return nil unless self.source.present? | |
# self.source — the paperclip attachment | |
book = Spreadsheet.open(self.source.path) | |
sheet = book.worksheet(0) | |
errors = self.import_errors.map { |e| e[:line] } | |
path = "tmp/#{self.source.original_filename}-errors.xls" |
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
new function($) { | |
return $.fn.ajaxChosen = function(options, callback) { | |
var select = this, | |
chosen; | |
select.chosen(); | |
chosen = select.data('chosen'); | |
var val, | |
timeout = null, |
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
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
# Activate the gem you are reporting the issue against. |
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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" | |
# Activate the gem you are reporting the issue against. |
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
# The OAuth access token provided by the Google API expires in 60 minutes. After expiration, | |
# you must exchange a refresh token for a new access token. Unfortunately, the the Google API | |
# ruby gem does not include a method for refreshing access tokens. | |
# You can read up on how to refresh an access token here: | |
# https://developers.google.com/accounts/docs/OAuth2WebServer#refresh | |
# This Token model implements that process. It's based off of a Token model that can be created | |
# by running: | |
# rails g model Token token:text refresh_token:string expires_at:datetime |