daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 48 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. ## Product Model
  2. class Product < ActiveRecord::Base
  3.  
  4.   has_and_belongs_to_many :categories
  5.   has_many :product_options
  6.  
  7.   validates_presence_of :piece_name
  8.   validates_uniqueness_of :piece_name
  9.  
  10.   has_attachment :content_type => :image,
  11.                   :storage => :file_system,
  12.                   :max_size => 5000.kilobytes,
  13.                   :path_prefix => "/public/images/products",
  14.                   #:resize_to => '384x256>',
  15.                   :processor => :ImageScience,
  16.                   :thumbnails => {
  17.                   :large => '96x96>',
  18.                   :medium => '64x64>',
  19.                   :small => '48x48>'
  20.                   }
  21.  
  22.   validates_as_attachment
  23.  
  24.   def full_filename(thumbnail = nil)
  25.     file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s
  26.     File.join(RAILS_ROOT, file_system_path, thumbnail_name_for(thumbnail))
  27.   end
  28.  
  29.   def product_option_attributes=(product_option_attributes)
  30.     product_option_attributes.each do |attributes|
  31.       product_options.build(attributes)
  32.     end
  33.   end
  34.  
  35.   def before_save
  36.     self.perma_link = Product.permalink_generator(self.piece_name)
  37.   end
  38.  
  39.   def self.permalink_generator(piece_name)
  40.     # Replace spaces with - here
  41.      piece_name = piece_name.downcase
  42.      piece_name = piece_name.gsub(" ", "-")
  43.      return piece_name
  44.   end
  45. end
  46.  
  47.  
  48. ## Error (when trying to access model)
  49. Processing ProductsController#index (for 203.217.21.54 at 2008-03-26 20:35:09) [GET]
  50.   Session ID: BAh7BzoMdXNlcl9pZGkGIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpG%0AbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--7d08708acef9257921eb5eff6af3fe79a062d129
  51.   Parameters: {"action"=>"index", "controller"=>"admin/products"}
  52. WARNING: You're using the Ruby-based MySQL library that ships with Rails. This library is not suited for production. Please install the C-based MySQL library instead (gem install mysql).
  53.  
  54.  
  55. SystemExit (exit):
  56.     /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.6/lib/inline.rb:74:in `exit'
  57.     /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.6/lib/inline.rb:74:in `rootdir'
  58.     /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.6/lib/inline.rb:88:in `directory'
  59.     /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.6/lib/inline.rb:262:in `so_name'
  60.     /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.6/lib/inline.rb:298:in `load_cache'
  61.     /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.6/lib/inline.rb:686:in `inline'
  62.     /usr/lib/ruby/gems/1.8/gems/image_science-1.1.3/lib/image_science.rb:84
  63.     /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
  64.     /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
  65.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
  66.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
  67.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
  68.     /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/image_science_processor.rb:1
  69.     /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
  70.     /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
  71.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
  72.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
  73.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
  74.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:104:in `require_or_load'
  75.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:248:in `load_missing_constant'
  76.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
  77.     /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:86:in `const_get'
  78.     /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:86:in `has_attachment'
  79.     /app/models/product.rb:18
  80.     /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
  81.     /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
  82.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
  83.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
  84.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
  85.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:104:in `require_or_load'
  86.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:248:in `load_missing_constant'
  87.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
  88.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:in `const_missing'
  89.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:260:in `load_missing_constant'
  90.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
  91.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:260:in `load_missing_constant'
  92.     /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:469:in `const_missing'
  93.     /app/controllers/admin/products_controller.rb:7:in `index'
  94.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send'
  95.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters'
  96.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters'
  97.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
  98.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  99.     /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
  100.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  101.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
  102.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action'
  103.     /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
  104.     /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache'
  105.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action'
  106.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send'
  107.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters'
  108.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
  109.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process'
  110.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
  111.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request'
  112.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
  113.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
  114.     /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
  115.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/rails.rb:76:in `process'
  116.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/rails.rb:74:in `synchronize'
  117.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/rails.rb:74:in `process'
  118.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:159:in `process_client'
  119.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:158:in `each'
  120.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:158:in `process_client'
  121.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:285:in `run'
  122.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:285:in `initialize'
  123.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:285:in `new'
  124.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:285:in `run'
  125.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:268:in `initialize'
  126.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:268:in `new'
  127.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel.rb:268:in `run'
  128.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/configurator.rb:282:in `run'
  129.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/configurator.rb:281:in `each'
  130.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/configurator.rb:281:in `run'
  131.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:128:in `run'
  132.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/command.rb:212:in `run'
  133.     /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:281
  134.     /usr/bin/mongrel_rails:19:in `load'
  135.     /usr/bin/mongrel_rails:19
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top