surrounded-rails 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/surrounded/rails/version.rb +1 -1
- data/lib/surrounded/railtie.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1771ec1d18ff450f5c270c7da2c8721ef312ed54
|
4
|
+
data.tar.gz: 804fe021d6c6b36752ed25032f60902f8a8e0415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b07f1373ab9f6933193ae1bbc8f660f881a12918d3b6ee976748dd2a8f19677abbebc8f322c27e50623166f970a53aaea7210a9868037592a2c723e55f60fcb
|
7
|
+
data.tar.gz: 070380e44e4aa169b684fe443f8bb34fcad5d60614063af648142f3394ea5cfd1480f55356b639b55abb9268c94d4f208d0301647f80cb043fc31fbd9e283839
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Surrounded::Rails
|
2
2
|
|
3
|
-
This sets up your ActiveRecord models and ActionController controllers to use [Surrounded](http://github.com/saturnflyer/surrounded).
|
3
|
+
This sets up your ActiveRecord and/or Mongoid models and ActionController controllers to use [Surrounded](http://github.com/saturnflyer/surrounded).
|
4
4
|
Support for non-ActiveRecord will be added.
|
5
5
|
|
6
6
|
## Installation
|
data/lib/surrounded/railtie.rb
CHANGED
@@ -3,8 +3,16 @@ require "surrounded"
|
|
3
3
|
require "rails"
|
4
4
|
module Surrounded
|
5
5
|
class Railtie < ::Rails::Railtie
|
6
|
-
|
7
|
-
|
6
|
+
if defined?(ActiveRecord)
|
7
|
+
initializer 'surrounded.active_record' do |app|
|
8
|
+
ActiveRecord::Base.send(:include, Surrounded)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
if defined?(Mongoid)
|
13
|
+
initializer 'surrounded.mongoid' do |app|
|
14
|
+
Mongoid::Document.send(:include, Surrounded)
|
15
|
+
end
|
8
16
|
end
|
9
17
|
|
10
18
|
initializer 'surrounded.action_controller' do |app|
|