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
import math | |
from wasabi2d import Scene, run, event | |
from random import uniform as fraction | |
from random import randint as integer | |
from random import choice | |
scene = Scene() | |
scene.background = 'black' | |
screen = scene.layers[0] |
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 update | |
@document = Document.find(params[:document_id]) | |
@version = @document.document_versions.find(params[:id]) | |
authorize_action_for(@version, parent_project) | |
if @version.update_attributes(version_params) | |
if !params[:version][:file].blank? | |
# store document and project id in file so we can get to them later for permissions checking when file is served | |
@version.reload | |
@version.file.add_meta('attachable_type' => @document.class.to_s) | |
@version.file.add_meta('attachable_uid' => @document.id.to_s) |
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 create | |
@project = Project.find(params[:project_id]) | |
@document = Document.find(params[:document_id]) | |
@version = DocumentVersion.new(version_params) | |
authorize_action_for(@version, parent_project) | |
if !params[:version][:file].blank? | |
@version.file.add_meta('attachable_type' => @document.class.to_s) | |
@version.file.add_meta('attachable_uid' => @document.id.to_s) | |
@version.file.add_meta('project_uid' => params[:project_id]) | |
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
# put this in /lib/resque.rb | |
require 'mail' | |
module Emailer | |
class Send | |
@queue = :issue_mailer | |
def self.perform(addressee, subject, body) |