Permalink
Browse files

Namespaced Models

  • Loading branch information...
1 parent 8dc033f commit 0ade550e16ee1f552cc4095d9bf284a0ea36b44c @LBRapid LBRapid committed Dec 1, 2011
@@ -1,8 +0,0 @@
-Image.attachment_definitions[:attachment][:styles] = { :mini => '48x48>', :small => '150x120>', :product => '240x240>', :large => '600x600>' }
-Image.attachment_definitions[:attachment][:storage] = :s3
-Image.attachment_definitions[:attachment][:s3_credentials] = S3_CREDENTIALS
-Image.attachment_definitions[:attachment][:bucket] = "railsdog-radio"
-Image.attachment_definitions[:attachment][:path] = ":attachment/:id/:style/:basename.:extension"
-Image.attachment_definitions[:attachment][:s3_headers] = {'Cache-Control' => 'max-age=31557600'}
-Image.attachment_definitions[:attachment][:default_url] = "/images/noimage/:style.png"
-Image.attachment_definitions[:attachment].delete :url
@@ -0,0 +1,8 @@
+Spree::Image.attachment_definitions[:attachment][:styles] = { :mini => '48x48>', :small => '150x120>', :product => '240x240>', :large => '600x600>' }
+Spree::Image.attachment_definitions[:attachment][:storage] = :s3
+Spree::Image.attachment_definitions[:attachment][:s3_credentials] = S3_CREDENTIALS
+Spree::Image.attachment_definitions[:attachment][:bucket] = "railsdog-radio"
+Spree::Image.attachment_definitions[:attachment][:path] = ":attachment/:id/:style/:basename.:extension"
+Spree::Image.attachment_definitions[:attachment][:s3_headers] = {'Cache-Control' => 'max-age=31557600'}
+Spree::Image.attachment_definitions[:attachment][:default_url] = "/images/noimage/:style.png"
+Spree::Image.attachment_definitions[:attachment].delete :url
@@ -1,6 +1,6 @@
StateMachine::Machine.ignore_method_conflicts = true
-Order.class_eval do
+Spree::Order.class_eval do
state_machines.clear
state_machine :initial => 'cart', :use_transactions => false do
@@ -52,7 +52,7 @@ def create_shipment!
shipment.shipping_method = shipping_method
shipment.save
else
- self.shipments << Shipment.create(:order => self, :shipping_method => shipping_method, :address => self.ship_address)
+ self.shipments << Spree::Shipment.create(:order => self, :shipping_method => shipping_method, :address => self.ship_address)
end
end
@@ -0,0 +1,7 @@
+Spree::Taxon.attachment_definitions[:icon][:styles] = { :mini => '32x32>', :normal => '140x82>', :large => '661x-1' }
+Spree::Taxon.attachment_definitions[:icon][:storage] = :s3
+Spree::Taxon.attachment_definitions[:icon][:s3_credentials] = "#{Rails.root}/config/s3.yml"
+Spree::Taxon.attachment_definitions[:icon][:bucket] = "spree"
+Spree::Taxon.attachment_definitions[:icon][:path] = "taxons/:id/:style/:basename.:extension"
+Spree::Taxon.attachment_definitions[:icon][:s3_headers] = {'Cache-Control' => 'max-age=31557600'}
+Spree::Taxon.attachment_definitions[:icon].delete :url
@@ -1,13 +1,13 @@
-class UserDecorator
+class Spree::UserDecorator
include CanCan::Ability
def initialize(user)
- user ||= User.new
+ user ||= Spree::User.new
if user.has_role? 'read_only'
can :read, :all
end
end
end
-Ability.register_ability(UserDecorator)
+Spree::Ability.register_ability(Spree::UserDecorator)
@@ -1,7 +0,0 @@
-Taxon.attachment_definitions[:icon][:styles] = { :mini => '32x32>', :normal => '140x82>', :large => '661x-1' }
-Taxon.attachment_definitions[:icon][:storage] = :s3
-Taxon.attachment_definitions[:icon][:s3_credentials] = "#{Rails.root}/config/s3.yml"
-Taxon.attachment_definitions[:icon][:bucket] = "spree"
-Taxon.attachment_definitions[:icon][:path] = "taxons/:id/:style/:basename.:extension"
-Taxon.attachment_definitions[:icon][:s3_headers] = {'Cache-Control' => 'max-age=31557600'}
-Taxon.attachment_definitions[:icon].delete :url

0 comments on commit 0ade550

Please sign in to comment.