Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
346 commits
Select commit Hold shift + click to select a range
bdabaf5
Remove debug from spree_cmd
radar Aug 30, 2012
915d841
Set Spree::User to Spree.user_class when installing
radar Aug 30, 2012
088a5ad
No need for first slash in layout
radar Aug 30, 2012
9692592
Add skip_state_validation? method so that CheckoutController decorati…
radar Aug 30, 2012
17d201b
RUBY_PALTFORM problem
sailtsao Aug 31, 2012
11c9f81
Fix mis-spelling of prop in checkout.js
radar Aug 31, 2012
faaa2df
Decrease wait-time for customer autocomplete box
radar Aug 31, 2012
6cc3da5
Rename Spree::InventoryUnit.backorder to backordered
Aug 30, 2012
4653099
We only care about shipped units in Spree::LineItem#quantity_no_less_…
Aug 30, 2012
a21ad1b
Add lambda to scopes, see reasons at https://rails.lighthouseapp.com/…
Aug 30, 2012
a7cf3e7
Optimize Spree::LineItem#quantity_no_less_than_shipped
Aug 31, 2012
1a9b25c
Lock all adjustments (not just mandatory ones) on checkout completion
BDQ Sep 3, 2012
a46455a
Show currently selected currency in general_settings/edit
radar Sep 4, 2012
d7082ee
Remove ruby-debug and ruby-debug19 mentions from common_spree_depende…
radar Sep 2, 2012
575af69
Add :currency_symbol_position config setting
radar Sep 4, 2012
47a0719
Allow for currency_symbol_position to be customized in admin settings
radar Sep 4, 2012
829bff8
Check for existence of variant_images in _thumbnails partial
LBRapid Sep 4, 2012
bdf6f29
Target correct form class name in checkout.js
Sep 2, 2012
dbb0c56
Freeze to kaminari 0.13.0 until amatsuda/kaminari#280 is fixed
radar Sep 5, 2012
fc65105
Fix postgres orphaned preferences SQL
felixbuenemann Sep 1, 2012
6c9d21f
add percent per item calculator to promotions
citrus Jun 4, 2012
72be9d1
Upcase SQL syntax
Sep 5, 2012
1e60ecd
move authorization_helpers to testing_support so other extensions can…
peterberkenbosch Aug 30, 2012
3358d3e
awesome_nested_set is an optimised replacement for acts_as_nested_set…
nickfrandsen Sep 6, 2012
0ba5fa4
corrected a typo in accurate_title method that was introduced in comm…
cwise Sep 6, 2012
ba40569
Allow manually calling save_permalink with a value to recalculate
GeekOnCoffee Sep 5, 2012
c519410
Remove disclaimer for master branch from 1-2-stable's README
radar Sep 7, 2012
886f563
Fixed order/customer_details_spec
radar Aug 31, 2012
bea1a03
disable via js double click on remove link and update button, fixes #…
kennyadsl Sep 7, 2012
e9be4ff
Fix missing sass-rails dev dependency for extension gemspec
radar Sep 10, 2012
65c943f
Fix limiting the availability of aShippingMethod to front end or back…
tneems Sep 7, 2012
30eed3a
DRYed up go_to_state method.
ncolgan Sep 8, 2012
eae67a4
added tax rate label
yanicklandry Sep 5, 2012
f2f75c4
Tidy up TaxRate#create_label method
radar Sep 10, 2012
a61d6c7
added tax rate label
yanicklandry Sep 5, 2012
5df81d9
Tidy up TaxRate#create_label method
radar Sep 10, 2012
17ed234
Bump select2-rails to ~> 3.0 and rabl to 0.7.2
radar Sep 10, 2012
e9f8cdd
Fix product_properties autocomplete (raw output in js)
fabien Sep 4, 2012
3c0194d
Remove poor man's equivalent of to_json from product_properties/index…
radar Sep 10, 2012
80b94ae
Update core/db/default/spree/countries.yml
wans Sep 8, 2012
3bd2d67
Correct mistaken check for params[:option_type] introduced with #1859
radar Sep 10, 2012
20b356e
Add default values for delimiter and separator in Variant#parse_price
radar Sep 11, 2012
8028718
Revert "Add default values for delimiter and separator in Variant#par…
radar Sep 11, 2012
386810f
defect fix checkout address state not displaying
Sep 11, 2012
9e50972
Allow per_page param for admin orders pagination.
JDutil Sep 12, 2012
a51acf4
Use render_views in API controller tests to fix broken tests caused b…
radar Sep 10, 2012
f659930
Remove scoping from select2-highlighted query
radar Sep 12, 2012
acea886
Add disclaimer for separate execution in select2 method
radar Sep 12, 2012
f5b2b44
Correct comment in Promotion::Rules::ItemTotal
radar Sep 13, 2012
739a1b1
Don't need to use mock_model inside Spree::Promotion::Rules::ItemTota…
radar Sep 13, 2012
128af83
fix problem where multiple promos applied if using per item promotions
greinacker Sep 5, 2012
41150d9
Re-add banners/gateway partial to core
radar Sep 13, 2012
f1d3c4c
define disableSaveOnClick as a function on window (global) [fixes #1956]
Sep 13, 2012
881cb69
Fixes bad association between credit card and payments
Sep 13, 2012
f9d0dd0
Fix payment methods banner non-dismissal issue #1924
radar Sep 13, 2012
b48546a
Remove commented out pending line from preferable_spec.rb
radar Sep 13, 2012
d1062eb
if preference is not found, fallback to DB before falling back to def…
radar Sep 13, 2012
df5b262
Remove useless setting of code to blank string in promotion_adjustmen…
radar Aug 31, 2012
3858b4c
request spec to prevent regression of #1956
Sep 13, 2012
25128e8
Check if preferences table exists before falling back to DB.
radar Sep 13, 2012
84f91aa
Prevent double submission of checkout confirm step
BDQ Sep 14, 2012
66ea016
Fixed Product.in_taxon to not return duplicates
laurens Sep 13, 2012
aca2661
Fixes encoding problem in admin when using a different locale to :en
Sep 4, 2012
d0b06d6
Use display_amount which uses Money
Sep 17, 2012
95daa97
Revert "Use display_amount which uses Money"
radar Sep 17, 2012
0c904f6
Revert "Fixed Product.in_taxon to not return duplicates"
radar Sep 17, 2012
7a97829
wrap opts[:ignore_types] in array to properly concatenate
Sep 17, 2012
3a2df5e
Fix product factory name sequence with Kernel.rand so it is not inter…
RohanM Sep 14, 2012
4c703b5
Fix issue where states.js was using wrong URL in HTTPS
argami Sep 18, 2012
a2e35ef
adds threading to chain of shipping_method.compute calls
jsqu99 Sep 17, 2012
04d5c69
Changing action to relative path in cart_form
argami Sep 18, 2012
8730cb5
Allow canceling of order with no shipments (nil shipment_state)
crystalneth Sep 19, 2012
abe2ef6
Don't show deleted ShippingMethods by default
radar Sep 19, 2012
a6fd960
Don't render partial for order state in API if it doesn't exist
radar Sep 20, 2012
b041687
Ensure correct message is displayed when applying a promotion to an o…
radar Sep 20, 2012
60e6754
Added available? method to product
laurens Sep 22, 2012
4276f8a
[promo] Fix issue where promotion was being created after the order i…
radar Sep 24, 2012
1b90a48
Remove 1.9 'workarounds' that have been in place since 2009
radar Sep 21, 2012
148f598
- return correct configuration values regardless of cache status
jsqu99 Sep 19, 2012
aa6e67d
Add mail_server_settings[:tls] setting to mail_settings
radar Sep 24, 2012
c1acbe0
Tidied code inside preferences/store.rb
parndt Sep 24, 2012
a59d67e
Remove duplicate sass-rails dependency.
JDutil Sep 19, 2012
89e1dbf
Check for persistence availability before checking DB for preference key
radar Sep 24, 2012
5e57b73
[promo] Use Spree::OrderUpdater in order_spec
radar Sep 25, 2012
eafbcc5
Add discount value in gateway options
zeeyang Sep 13, 2012
085df82
Move admin translations out of assets and into a special view
radar Sep 25, 2012
6ce09cf
Fix stack level too deep error on Ruby 1.8 builds
radar Sep 26, 2012
13f2b30
Translate jstree labels + JS escape taxonomy names
laurens Sep 26, 2012
6a7601c
allow case insensitive coupon codes
kennyadsl Sep 26, 2012
da1e1d8
Show error message for GET requests to /orders/populate
radar Sep 27, 2012
c1837cf
Return options at end of gateway_options
radar Sep 27, 2012
42eb0ef
Referencing Correct I18n string for populate_get_error translation
Sep 27, 2012
ce09121
Fix missing address in gateway profile
zeeyang Sep 28, 2012
e163d70
Mail setting enable_starttls_auto and tls would throw ssl error if al…
zeeyang Sep 28, 2012
a1202f4
Fix preference lookup to use key not deprecated name column.
JDutil Sep 29, 2012
e892145
Remove doubly-defined gateway_options from Payment::Processing
radar Sep 27, 2012
c6dcf2d
Manage currency whose subunit is not 100 (like JPY)
kei-s Oct 1, 2012
eabb396
add some width to the select2 boxes
peterberkenbosch Oct 1, 2012
3cacb23
Don't automatically singularize taxonomy names within shared/_taxonomies
radar Oct 3, 2012
a86e8bc
Revert "Fix preference lookup to use key not deprecated name column."
radar Oct 3, 2012
d8e9dff
Tidy up return_authorizations/_form JS
radar Oct 3, 2012
b0ef8ab
Add workaround for rails/rails#5868
radar Oct 4, 2012
36714cf
Remove distinct option from ransack call in Admin::OrdersController
radar Oct 4, 2012
ce36000
Don't process payments if no payment is required
zeeyang Sep 28, 2012
7018474
stub payment_required? to be true for tests that check order complete…
radar Oct 4, 2012
f505c9c
Add greater_than validation to LineItem and ensure products can't be …
radar Oct 5, 2012
5e2b800
Account for situations where tax_rates may not have a zone
radar Oct 5, 2012
cbaab71
Apply payments partially
radar Sep 25, 2012
4902883
Downgrade to cocaine 0.3.2 as 0.4.0 breaks imagemagick.
radar Oct 7, 2012
e7e0c69
Move routes definition into a view to parallel translation settings.
ethier Oct 5, 2012
09d1c77
Freeze to paperclip 2.7.1 as 2.8.0 breaks without cocaine 0.4.0
radar Oct 7, 2012
c6043ed
Don't reference OrderUpdater in order/payment_spec
radar Oct 7, 2012
ea5f536
Correct stubbing for Order#process_payments
radar Oct 7, 2012
5fb367b
Re-add grouping for spree_variants.price to admin/products_controller
radar Oct 8, 2012
89f6e7b
Upgrade paperclip to 2.8
radar Oct 8, 2012
db30415
Exclude expired promotions from Spree::Product#possible_promotions
iloveitaly Oct 6, 2012
77e983b
Fix PriceSack incorrect calculation
radar Oct 8, 2012
c762d25
Remove save overriding from Spree::Promotion as rails/rails@91fd65105…
radar Oct 8, 2012
6be61fd
Use 1.8 compatible BigDecimal parsing in PriceSack
radar Oct 8, 2012
db31a33
Make base_helper test for flash_messages more resilient to random has…
radar Oct 8, 2012
27dacbd
use preference_cache_key inside check for preference
radar Oct 10, 2012
b85a896
Revert "use preference_cache_key inside check for preference"
radar Oct 10, 2012
1a7a100
Ensure that address information cannot be updated by people who do no…
radar Oct 11, 2012
0be84a4
[api] only admins should be allowed to create, edit or delete images
radar Oct 11, 2012
2268ac1
[api] Only allow admins to transition shipments to ready and ship
radar Oct 11, 2012
65f5c06
Pass all changes to variant.count_on_hand to on_hand= to ensure
BDQ Oct 11, 2012
c0a05db
Make variant lock_version accessible
BDQ Oct 11, 2012
63d42a1
Move backorder fulfillment within the variant model into after_save c…
BDQ Oct 11, 2012
4eb5ecf
Spree::AuthenticationHelpers should be loaded each request, not just …
radar Oct 11, 2012
7d26aa2
Don't alter variant on_hand amount with InventoryUnit#restock_variant…
radar Oct 12, 2012
9b2276b
Shipments should remain pending until the order is complete, and its
BDQ Oct 12, 2012
7df8f8d
Fix Api shipments_controller_spec
BDQ Oct 12, 2012
1b5af2a
Update order shipment_state on finalize also
BDQ Oct 12, 2012
fa309c7
Line item quantity validator must be greater than -1
radar Oct 14, 2012
486fe41
Correct card_code typo, and add coupon code hook.
JDutil Oct 15, 2012
1b393a0
Update order before redirecting to checkout when 'Checkout' button is…
LBRapid Oct 12, 2012
09cc6b9
Return product records rather than just their ids.
JDutil Oct 12, 2012
7d35001
Define import variables scss explicitly to allow extensions to run JS…
JDutil Oct 12, 2012
d3f796b
Go to checkout state page when checkout button is clicked
radar Oct 16, 2012
5f58982
[promo] Fix references to checkout *button*
radar Oct 16, 2012
e73a1cb
Provide the Spree current user to the searcher class
Oct 16, 2012
136cbda
Fix price parsing for numeric values
Oct 16, 2012
d9d40cd
Allow unauthenticated API requests for the ProductsController
radar Oct 11, 2012
3fad013
Remove not null constraint from products on hand
radar Oct 17, 2012
c2055e5
Add regression test for #2097
radar Oct 17, 2012
2f35cea
Add TestingSupport helpers for flash and preferences
radar Oct 1, 2012
8631f26
Add requires_authentication? check for check_for_api_key before_filte…
radar Oct 17, 2012
1880bc0
product_on_hand, not product_count_on_hand for regression test for #2097
radar Oct 17, 2012
e66daf7
Don't clear mail_method or payment_method password if it's not sent t…
radar Oct 17, 2012
d8c68d4
Use within in mail_methods_spec
radar Oct 17, 2012
596f460
Correctly set product_on_hand check in products_spec test
radar Oct 17, 2012
5b53c72
WIP: taxon selector
radar Oct 17, 2012
b12f99a
Fix parameter names within mail_methods_controller_spec
radar Oct 17, 2012
b1fd705
Revert "WIP: taxon selector"
radar Oct 17, 2012
83e2339
1-2-stable branch of spree_auth_devise MUST now be used with 1-2-stab…
radar Oct 17, 2012
d166514
Fix FactoryGirl deprecations.
JDutil Oct 17, 2012
b8739be
Marks orders as returned if all return authorizations are received.
Ben-M Oct 17, 2012
424916f
AJAXify autocomplete for taxons on product autocomplete page
radar Oct 17, 2012
1f17bff
check for returned? not returned for inventory units in ReturnAuthori…
radar Oct 18, 2012
d2c8811
Ensure that first state callbacks are run after an order is updated
radar Oct 18, 2012
113336f
Add regression test for #2004
radar Oct 18, 2012
6c478ee
Fix multiple products from appearing when using Product.in_taxons scope
radar Oct 18, 2012
d941a9a
Remove in_cached_group commented out code
radar Oct 18, 2012
2be1619
Add HBD for using distinct option when counting results for in_taxon
radar Oct 18, 2012
96415b0
Don't enable option type select2 box in products/_form if we're in te…
radar Oct 18, 2012
ce1e1fd
Regression test for #2004 has been moved out to orders_controller_tra…
radar Oct 18, 2012
741ebe9
Use count inside scopes_spec.rb
radar Oct 18, 2012
bd035fc
Use 1.8 syntax in product/scopes_spec
radar Oct 18, 2012
ac67745
Use _url to disregard asset host for states.js.
Oct 18, 2012
46df789
Spree::Product.on_hand no longer sums deleted variants
radar Oct 18, 2012
d8fe4e8
select2 is not enabled for option types in test mode
radar Oct 18, 2012
b60fc08
Remove excessive spacing in JS for products/new.html.erb
radar Oct 19, 2012
88b1c62
capture! now does not operate on 'completed' payments
radar Oct 19, 2012
b9fdd6a
Localize order adjustements term in orders/_adjustments view
Oct 19, 2012
0c91bad
Show credit card form on checkout payment screen after invalid data h…
radar Oct 22, 2012
fd37462
Create a tax charge whenever a line item is created or destroyed
radar Oct 22, 2012
87f5988
Added REST support for create, update, delete and show of product pro…
skorbut Oct 22, 2012
90e3f55
Destroying a product returns no data, therefore 204 status is better
radar Oct 23, 2012
9979c15
[api] Admin requests MUST now use a token, even if requires_authentic…
radar Oct 23, 2012
5708749
[api] Fix response.status for ProductsController#destroy
radar Oct 23, 2012
e271b4f
[api] Variants API is now paginated and scoped correctly
radar Oct 23, 2012
2b27c65
[api] Only show deleted variants when 1) the user is an admin and 2) …
radar Oct 23, 2012
ea05560
[api] /orders should always return an :orders key, even if there are …
radar Oct 24, 2012
f77a83e
[api] Allow an order to be created without parameters
radar Oct 24, 2012
b88a841
[api] nested_params does not need to define an instance variable
radar Oct 24, 2012
0f008be
[api] OrdersController#create should respond with 201
radar Oct 24, 2012
9142745
[api] Fix orders_controller tests
radar Oct 24, 2012
69d6946
[api] allow an order to have either its shipping address or billing a…
radar Oct 24, 2012
d3cb336
Do not allow void_transaction! to take place if payment is already vo…
radar Oct 24, 2012
dadb84d
[api] Always include a :payments key in payments response
radar Oct 24, 2012
461ef56
[api] Fix ProductPropertiesController to use ID, rather than name
skorbut Oct 23, 2012
66da2af
[api] Add capture endpoint for payments
radar Oct 25, 2012
7fbc3f3
[api] Don't use deprecated syntax in ProductPropertiesController
radar Oct 25, 2012
80f2ec0
[api] whitespaces in ProductPropertiesController
radar Oct 25, 2012
c116e37
Fix product properties API to not show properties for unavailable pro…
radar Oct 25, 2012
fbe3251
[api] Ensure there is always a :product_properties key returned by /p…
radar Oct 25, 2012
02719d1
[api] find by property id first, then name
radar Oct 25, 2012
02ae4a0
[api] allow build_from_api to accept empty line_item_attributes
radar Oct 25, 2012
7d9cc65
[api] destroy statuses should return status 204
radar Oct 25, 2012
3518b65
[api] Tidy up parameters in zones_controller_spec
radar Oct 26, 2012
405c764
Remove X-UA-Compatible from layout
Oct 26, 2012
38f7cf2
Fixing Jirafe Links, Fixes #2144
radar Oct 26, 2012
4d36d3f
Remove ShippingMethod#calculator_available?
radar Oct 25, 2012
5687ae0
Stripping EXIF from JPGs
jumph4x Oct 24, 2012
831436f
Ensure ALL select2 choices show up in taxons for admin/products/edit
radar Oct 26, 2012
4fb4617
[api] Fix zones_controller_spec
radar Oct 28, 2012
74a7914
Only include eligible promotions in promo_total
BDQ Nov 2, 2012
1a0db0d
Removes deprecation warning during preferable_spec run
camelmasa Nov 2, 2012
5ff1f4d
taxon autocomplete display pretty_name instead of name
sbounmy Nov 3, 2012
68b7019
orders should only display variant text on order_details page
sbounmy Nov 1, 2012
b37892c
Add patience to admin/configuration/states_spec
radar Nov 5, 2012
5b90824
no need for 1.9.2 statement inside gc_hacks anymore
radar Nov 5, 2012
96d1e17
Only show eligible adjustment in admin order edit view
BDQ Nov 5, 2012
913e7ca
Remove 1.8.7 support in travis
schof Nov 6, 2012
194ccdb
[Fixes #2184] CreditCard number is no longer blank when processing
LBRapid Nov 6, 2012
1158689
Explicitly set Spree::CreditCard table name within spree/payments.rb
radar Nov 6, 2012
3375f53
Remove check for with_state call in order_spec
radar Nov 6, 2012
3d1733e
Remove gc_hacks file
radar Nov 7, 2012
df570d0
Adding return authorization API
GeekOnCoffee Oct 30, 2012
58aac9d
Restrict admin-y actions on return authorizations to just admins
radar Nov 7, 2012
23fa86a
[api] Restrict all return authorization actions
radar Nov 7, 2012
1e4fb60
Adding Notes about Promo Checkout Controller Override
Nov 5, 2012
359c98f
Refactor out methods to product class that control if a product is on…
nickfrandsen Oct 31, 2012
5099d25
Adding promotion usage information to the admin
iloveitaly Nov 7, 2012
07f22d9
stub has_available_shipment calls in tests
radar Nov 8, 2012
b9915d0
stub has_available_shipment calls in tests
radar Nov 8, 2012
6a87378
update totals before checking if payment is required
radar Nov 8, 2012
93e6ede
Directly call update_totals in payment_required? method
radar Nov 8, 2012
74c0423
Various API improvements.
LBRapid Nov 8, 2012
f57f12d
Require secure connection on OrderController#show
iloveitaly Oct 31, 2012
fa99995
Adding Order#variants
iloveitaly Nov 8, 2012
ade5b3a
Don't include 'out of stock' error message in shipment mailers
radar Nov 12, 2012
9ecee52
Bump README Rails version to 3.2.9
radar Nov 12, 2012
a61f4f4
Bump state_machine_spec
radar Nov 12, 2012
5c65490
Stub call to restock_items! which we don't care about in order cancel…
radar Nov 13, 2012
c1eefb4
Force rails dependency to be 3.2.9 (or higher, within 3.2.x branch)
radar Nov 13, 2012
bf9f371
[api] fix syntactical errors in CountriesController
radar Nov 13, 2012
2da5749
[api] Fix syntax in ProductPropertiesController
radar Nov 13, 2012
4d5cab9
[api] Fix syntax within ReturnAuthorizationsController
radar Nov 13, 2012
160f4fd
[api] Fix syntax in taxonomies and variants controllers
radar Nov 13, 2012
80a8e5b
[promo] Fix user picker
radar Nov 14, 2012
6f0d8f3
Add spree_auth_devise to extension Gemfile
radar Nov 14, 2012
a5fab65
Remove testing_support/env
radar Nov 15, 2012
74868b0
Ignore .sass-cache for extensions.
Nov 14, 2012
09c9455
Freeze capybara dependency to 1.1.3
radar Nov 15, 2012
0d81ee0
Add missing route to api payments capture
BDQ Nov 15, 2012
6767ce6
Move OrdersController#accurate_title to private
Nov 18, 2012
b85fc2c
Version bump
schof Nov 19, 2012
c2b3044
1.2.2.beta version
schof Nov 19, 2012
b8da859
Version bump
schof Nov 19, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,5 @@ notifications:
skip_join: true
channels:
- "irc.freenode.org#spree"
branches:
only:
- 1-0-stable
- 1-1-stable
- master
rvm:
- 1.8.7
- 1.9.3
- 1.9.3
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
**THIS README IS FOR THE MASTER BRANCH OF SPREE AND REFLECTS THE WORK CURRENTLY EXISTING ON THE MASTER BRANCH. IF YOU ARE WISHING TO USE A NON-MASTER BRANCH OF
SPREE, PLEASE CONSULT THAT BRANCH'S README AND NOT THIS ONE.**

SUMMARY
-------

Expand Down Expand Up @@ -32,9 +29,9 @@ Installation
The fastest way to get started is by using the spree command line tool
available in the spree gem which will add Spree to an existing Rails application.

$ gem install rails -v 3.2.7
$ gem install rails -v 3.2.9
$ gem install spree
$ rails _3.2.7_ new my_store
$ rails _3.2.9_ new my_store
$ spree install my_store

This will add the Spree gem to your Gemfile, create initializers, copy migrations and
Expand Down Expand Up @@ -100,21 +97,21 @@ The source code is essentially a collection of gems. Spree is meant to be run w

1. Clone the Git repo

git clone git://github.com/spree/spree.git
cd spree
$ git clone git://github.com/spree/spree.git
$ cd spree

2. Install the gem dependencies

bundle install
$ bundle install

3. Create a sandbox Rails application for testing purposes (and automatically perform all necessary database setup)

bundle exec rake sandbox
$ bundle exec rake sandbox

4. Start the server

cd sandbox
rails server
$ cd sandbox
$ rails server

Performance
-----------
Expand All @@ -134,14 +131,22 @@ Use Dedicated Spree Devise Authentication
Add the following to your Gemfile

$ gem 'spree_auth_devise', :git => 'git://github.com/spree/spree_auth_devise'

Then run `bundle install`. Authentication will then work exactly as it did in previous versions of Spree.

If you're installing this in a new Spree 1.2+ application, you'll need to install and run the migrations with

$ bundle exec rake spree_auth:install:migrations
$ bundle exec rake db:migrate

change the following line in `config/initializers/spree.rb`
```ruby
Spree.user_class = "Spree::LegacyUser"
```
to
```ruby
Spree.user_class = "Spree::User"
```
and then run `bundle exec rake spree_auth:admin:create` in order to set up the admin user for the application.

Running Tests
Expand Down
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,7 @@ end

desc "Creates a sandbox application for simulating the Spree code in a deployed Rails app"
task :sandbox do
exec("lib/sandbox.sh")
Bundler.with_clean_env do
exec("lib/sandbox.sh")
end
end
2 changes: 1 addition & 1 deletion SPREE_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0.rc1
1.2.2
2 changes: 2 additions & 0 deletions api/app/controllers/spree/api/v1/addresses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ module V1
class AddressesController < Spree::Api::V1::BaseController
def show
@address = Address.find(params[:id])
authorize! :read, @address
end

def update
@address = Address.find(params[:id])
authorize! :read, @address
@address.update_attributes(params[:address])
render :show, :status => 200
end
Expand Down
26 changes: 23 additions & 3 deletions api/app/controllers/spree/api/v1/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ class BaseController < ActionController::Metal

attr_accessor :current_api_user

before_filter :check_for_api_key
before_filter :set_content_type
before_filter :check_for_api_key, :if => :requires_authentication?
before_filter :authenticate_user

rescue_from CanCan::AccessDenied, :with => :unauthorized
Expand All @@ -25,20 +26,39 @@ def map_nested_attributes_keys(klass, attributes)

private

def set_content_type
content_type = case params[:format]
when "json"
"application/json"
when "xml"
"text/xml"
end
headers["Content-Type"] = content_type
end

def check_for_api_key
render "spree/api/v1/errors/must_specify_api_key", :status => 401 and return if api_key.blank?
end

def authenticate_user
unless @current_api_user = Spree.user_class.find_by_spree_api_key(api_key)
render "spree/api/v1/errors/invalid_api_key", :status => 401 and return
if requires_authentication? || api_key.present?
unless @current_api_user = Spree.user_class.find_by_spree_api_key(api_key)
render "spree/api/v1/errors/invalid_api_key", :status => 401 and return
end
else
# Effectively, an anonymous user
@current_api_user = Spree.user_class.new
end
end

def unauthorized
render "spree/api/v1/errors/unauthorized", :status => 401 and return
end

def requires_authentication?
Spree::Api::Config[:requires_authentication]
end

def not_found
render "spree/api/v1/errors/not_found", :status => 404 and return
end
Expand Down
5 changes: 4 additions & 1 deletion api/app/controllers/spree/api/v1/countries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ module Api
module V1
class CountriesController < Spree::Api::V1::BaseController
def index
@countries = Country.includes(:states).order('name ASC')
@countries = Country.
ransack(params[:q]).result.
includes(:states).order('name ASC').
page(params[:page]).per(params[:per_page])
end

def show
Expand Down
5 changes: 4 additions & 1 deletion api/app/controllers/spree/api/v1/images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ def show
end

def create
authorize! :create, Image
@image = Image.create(params[:image])
render :show, :status => 201
end

def update
authorize! :update, Image
@image = Image.find(params[:id])
@image.update_attributes(params[:image])
render :show, :status => 200
end

def destroy
authorize! :delete, Image
@image = Image.find(params[:id])
@image.destroy
render :text => nil
render :text => nil, :status => 204
end

end
Expand Down
2 changes: 1 addition & 1 deletion api/app/controllers/spree/api/v1/line_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def destroy
authorize! :read, order
@line_item = order.line_items.find(params[:id])
@line_item.destroy
render :text => nil, :status => 200
render :text => nil, :status => 204
end

private
Expand Down
26 changes: 10 additions & 16 deletions api/app/controllers/spree/api/v1/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,25 @@ module Spree
module Api
module V1
class OrdersController < Spree::Api::V1::BaseController
before_filter :map_nested_attributes, :only => [:create, :update]
before_filter :authorize_read!, :except => [:index, :search, :create]

def index
# should probably look at turning this into a CanCan step
raise CanCan::AccessDenied unless current_api_user.has_spree_role?("admin")
@orders = Order.page(params[:page]).per(params[:per_page])
@orders = Order.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
end

def show
end

def search
@orders = Order.ransack(params[:q]).result.page(params[:page])
render :index
end

def create
@order = Order.build_from_api(current_api_user, @nested_params)
next!
@order = Order.build_from_api(current_api_user, nested_params)
next!(:status => 201)
end

def update
authorize! :update, Order
if order.update_attributes(@nested_params)
if order.update_attributes(nested_params)
order.update!
render :show
else
Expand All @@ -35,8 +29,8 @@ def update
end

def address
order.build_ship_address(params[:shipping_address])
order.build_bill_address(params[:billing_address])
order.build_ship_address(params[:shipping_address]) if params[:shipping_address]
order.build_bill_address(params[:billing_address]) if params[:billing_address]
next!
end

Expand Down Expand Up @@ -64,17 +58,17 @@ def empty

private

def map_nested_attributes
@nested_params = map_nested_attributes_keys Order, params[:order]
def nested_params
map_nested_attributes_keys Order, params[:order] || {}
end

def order
@order ||= Order.find_by_number!(params[:id])
end

def next!
def next!(options={})
if @order.valid? && @order.next
render :show, :status => 200
render :show, :status => options[:status] || 200
else
render :could_not_transition, :status => 422
end
Expand Down
6 changes: 5 additions & 1 deletion api/app/controllers/spree/api/v1/payments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PaymentsController < Spree::Api::V1::BaseController
before_filter :find_payment, :only => [:show, :authorize, :purchase, :capture, :void, :credit]

def index
@payments = @order.payments
@payments = @order.payments.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
end

def new
Expand All @@ -29,6 +29,10 @@ def authorize
perform_payment_action(:authorize)
end

def capture
perform_payment_action(:capture)
end

def purchase
perform_payment_action(:purchase)
end
Expand Down
64 changes: 64 additions & 0 deletions api/app/controllers/spree/api/v1/product_properties_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
module Spree
module Api
module V1
class ProductPropertiesController < Spree::Api::V1::BaseController
before_filter :find_product
before_filter :product_property, :only => [:show, :update, :destroy]

def index
@product_properties = @product.product_properties.
ransack(params[:q]).result
.page(params[:page]).per(params[:per_page])
end

def show
end

def new
end

def create
authorize! :create, ProductProperty
@product_property = @product.product_properties.new(params[:product_property])
if @product_property.save
render :show, :status => 201
else
invalid_resource!(@product_property)
end
end

def update
authorize! :update, ProductProperty
if @product_property && @product_property.update_attributes(params[:product_property])
render :show, :status => 200
else
invalid_resource!(@product_property)
end
end

def destroy
authorize! :delete, ProductProperty
if(@product_property)
@product_property.destroy
render :text => nil, :status => 204
else
invalid_resource!(@product_property)
end

end

private
def find_product
@product = super(params[:product_id])
end

def product_property
if @product
@product_property ||= @product.product_properties.find_by_id(params[:id])
@product_property ||= @product.product_properties.joins(:property).where('spree_properties.name' => params[:id]).readonly(false).first
end
end
end
end
end
end
9 changes: 2 additions & 7 deletions api/app/controllers/spree/api/v1/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ module Api
module V1
class ProductsController < Spree::Api::V1::BaseController
def index
@products = product_scope.page(params[:page])
end

def search
@products = product_scope.ransack(params[:q]).result.page(params[:page])
render :index
@products = product_scope.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
end

def show
Expand Down Expand Up @@ -44,7 +39,7 @@ def destroy
@product = find_product(params[:id])
@product.update_attribute(:deleted_at, Time.now)
@product.variants_including_master.update_all(:deleted_at => Time.now)
render :text => nil, :status => 200
render :text => nil, :status => 204
end
end
end
Expand Down
Loading