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
cap rubber:setup_security_groups | |
triggering load callbacks | |
* 2013-03-05 17:32:59 executing `rubber:init' | |
* 2013-03-05 17:33:00 executing `rubber:setup_security_groups' | |
* Security Group already in cloud, syncing rules: sampleapp_production_default | |
* Missing rule, creating: {"source_group_name"=>"sampleapp_production_default", "source_group_account"=>"artsicle", "protocol"=>"tcp", "from_port"=>"1", "to_port"=>"65535"} | |
/home/ksh2115/.rvm/gems/ruby-1.9.3-p385@rails3tutorial2ndEd/gems/excon-0.19.5/lib/excon/middlewares/expects.rb:10:in `response_call': Unable to find group 'sampleapp_production_default' (Fog::Compute::AWS::NotFound) | |
from /home/ksh2115/.rvm/gems/ruby-1.9.3-p385@rails3tutorial2ndEd/gems/excon-0.19.5/lib/excon/connection.rb:325:in `response' | |
from /home/ksh2115/.rvm/gems/ruby-1.9.3-p385@rails3tutorial2ndEd/gems/excon-0.19.5/lib/excon/connection.rb:230:in `request' | |
from /home/ksh2115/.rvm/gems/ruby-1.9.3-p385@rails3tutorial2ndEd/gems/excon-0.19.5/lib/excon/middlewares/idempotent.rb:11:in |
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
<% elsif adjustment.label == "Artwork Credit" %> | |
<tr class="artwork-credit"> | |
<td class="credit-name"><%= adjustment.label %>:</td> | |
<td class="align-right"><%= number_to_currency adjustment.amount %></td> | |
<td class="credit-form"> | |
<%= form_for @order, url: update_cart_path, html: {class: 'remove-credit-form', id: "credit_#{adjustment.object_id}"} do |f| %> | |
<%= f.hidden_field :artwork_credit, value: '0' %> | |
<button type="button" class="close remove-artwork-credit" title="Remove Artwork Credit" rel="tooltip">×</button> | |
<% end %> |
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
artwork_credit.rb | |
# credit flag for this model marks whether or not it is an active credit (can be applied) | |
# following two methods are used in checkout process to when artwork credits are used, turned into adjustments, and deactivated to make sure they can't be reused | |
def use_credit | |
self.update_column(:credit, false) | |
end | |
def restore_credit | |
self.update_column(:credit, true) |
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
namespace :artwork_stat do | |
desc "Checks for artwork stat for completed orders" | |
task :check_for_stat => :environment do | |
Order.all.each do |order| | |
if order.completed? | |
if order.line_items.length != 0 && order.artworks.length == 0 | |
data_errors.create(message: "Order #{order.id} has line items but no artworks!") | |
elsif order.artworks.length != 0 | |
order.artworks.each do |artwork| | |
if artwork.stats.length == 0 |
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
NoMethodError: undefined method `spec' for nil:NilClass | |
An error occurred while installing paperclip-meta (0.4.3), and Bundler cannot continue. | |
Make sure that `gem install paperclip-meta -v '0.4.3'` succeeds before bundling. | |
[/home/ksh2115/.rvm/gems/ruby-1.9.3-p385@artsicle/specifications/paperclip-meta-0.4.3.gemspec] isn't a Gem::Specification (NilClass instead). | |
[/home/ksh2115/.rvm/gems/ruby-1.9.3-p385@artsicle/specifications/paperclip-meta-0.4.3.gemspec] isn't a Gem::Specification (NilClass instead). | |
ERROR: While executing gem ... (NoMethodError) | |
undefined method `spec' for nil:NilClass |
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
# note that these need to be viewable ids | |
vagrant_img_ids = [] | |
# try setting attachment_meta to nil and set_metadata! | |
# if that doesn't work add it to a new array and check the bucket for duplicate original images | |
Image.where(:viewable_type => 'User::Info').each do |img| | |
if img.attachment.width(:fw_500) == nil | |
img.update_attribute(:attachment_meta, nil) | |
img.set_metadata! | |
# check again if it didn't work, well fuck, check the bucket |
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
connection = Fog::Storage.new({ | |
:provider => 'AWS', | |
:aws_access_key_id => CONFIG[:access_key_id], | |
:aws_secret_access_key => CONFIG[:secret_access_key] | |
}) | |
bucket = connection.directories.get('artsicledev') | |
url = https://artsicledev.s3.amazonaws.com/ | |
Image.all.each do |img| |
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
desc "seperate medium and surface product properties" | |
task :seperate_medium_and_surface_properties => :environment do | |
# create a new surface property | |
Property.create(name: "Surface", presentation: "Surface") | |
# assign property ids to an actionable variables to work with later | |
# don't assume that medium id is what it is in the database, so don't hardcode it | |
medium_property_id = Property.find_by_name("Medium").id | |
surface_property_id = Property.find_by_name("Surface").id | |
# create an array of all "Medium" ProductProperties | |
actionable_properties = ProductProperty.all.select { |pp| pp.property_id == medium_property_id } |
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
desc "seperate medium and surface product properties" | |
task :seperate_medium_and_surface_properties => :environment do | |
medium_property_id = Property.find_by_name("Medium").id | |
if Property.find_by_name("Surface") | |
surface_property_id = Property.find_by_name("Surface").id | |
else | |
Property.create(name: "Surface", presentation: "Surface") | |
surface_property_id = Property.find_by_name("Surface").id | |
end |
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
# helper method for cleaning taxons and properties | |
# if an artist changes the medium_taxon for a product | |
# some product propeties need to be normalized | |
def correct_properties | |
sculpture_id = Taxon.find_by_name('Sculpture').id | |
product_medium_taxon_id = params[:product][:medium_taxon_id] | |
debugger | |
# if artist updates product to a sculpture taxon | |
# make sure there isn't an associated surface property |
OlderNewer