carter 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/carter.rb CHANGED
@@ -6,4 +6,4 @@ require 'carter/controller_resource'
6
6
  require 'carter/state_machine'
7
7
  require 'carter/errors'
8
8
  require 'carter/active_record/extensions'
9
- require 'rails/init'
9
+ require 'carter/rails/init'
@@ -0,0 +1,10 @@
1
+ if defined?(Rails)
2
+ ActiveRecord::Base.extend Carter::ActiveRecord::Cartable if defined?(ActiveRecord)
3
+ if Rails::VERSION::MAJOR == 3
4
+ require 'carter/engine'
5
+ else
6
+ require 'carter/routing'
7
+ ActionController::Routing::RouteSet::Mapper.send :include, Carter::Routing::MapperExtensions
8
+ end
9
+ end
10
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 0
10
- version: 0.6.0
9
+ - 1
10
+ version: 0.6.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Louis Gillies
@@ -160,7 +160,6 @@ files:
160
160
  - generators/carter_generator.rb
161
161
  - generators/carter_install_generator.rb
162
162
  - generators/templates/migration.rb
163
- - init.rb
164
163
  - lib/carter.rb
165
164
  - lib/carter/active_record/extensions.rb
166
165
  - lib/carter/cart.rb
@@ -172,10 +171,10 @@ files:
172
171
  - lib/carter/errors/multiple_cart_items_not_allowed.rb
173
172
  - lib/carter/errors/setup_error.rb
174
173
  - lib/carter/initializer.rb
174
+ - lib/carter/rails/init.rb
175
175
  - lib/carter/routing.rb
176
176
  - lib/carter/state_machine.rb
177
177
  - lib/tasks/carter.rake
178
- - rails/init.rb
179
178
  - LICENSE.txt
180
179
  - README.md
181
180
  - spec/active_record/cart_item_spec.rb
data/init.rb DELETED
@@ -1 +0,0 @@
1
- require 'rails/init.rb'
data/rails/init.rb DELETED
@@ -1,7 +0,0 @@
1
- if defined?(Rails)
2
- require 'carter/engine' if Rails::VERSION::MAJOR == 3
3
- ActiveRecord::Base.extend Carter::ActiveRecord::Cartable if defined?(ActiveRecord)
4
- require 'carter/routing'
5
- ActionController::Routing::RouteSet::Mapper.send :include, Carter::Routing::MapperExtensions
6
- end
7
-