native 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +2 -4
- data/app/controllers/native/platforms_controller.rb +0 -4
- data/app/helpers/native_helper.rb +4 -0
- data/lib/native/railtie.rb +6 -0
- data/lib/native/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da5343cf8aac00c325f7a04c67d0b393fdd2a3fb6a4c751969e5fd58eb104822
|
4
|
+
data.tar.gz: 508dd3ed8d998b65a5cfc4a06c17c075480fdb4781a77286e5ca5e17c8689a9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45e32a204005bf0837745e4429660cb43c216d526c0bf1f1f01af027652a435820ad378db75b13ef4548d9a963fb2fe084243ccf4282448d16015cfa0b66f6e6
|
7
|
+
data.tar.gz: c8723fa247c1708856a364277d5afefbcbe2591b200d8c55ba0914f72679c209df93a1d0f4a5233259c559f43323290cc31bac792b7ae3115bd97164ac32a8c3
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -156,11 +156,9 @@ d.apps
|
|
156
156
|
|
157
157
|
If you are using Devise and your model is named `User`, the object returned by `current_user` will automatically be associated with the current app. If your Devise model is not named `User` or you are using a different user-management solution that does not implement a `current_user` method, you are able to override this default behavior.
|
158
158
|
|
159
|
-
Let's say our Devise model is named `Admin`. Just add a
|
159
|
+
Let's say our Devise model is named `Admin`. Just add a method to your `ApplicationController`:
|
160
160
|
|
161
161
|
```ruby
|
162
|
-
protected
|
163
|
-
|
164
162
|
def set_app_owner
|
165
163
|
current_admin if current_admin
|
166
164
|
end
|
@@ -174,7 +172,7 @@ Now you are able to access the applications used by an user:
|
|
174
172
|
User.first.native_apps
|
175
173
|
```
|
176
174
|
|
177
|
-
### View methods
|
175
|
+
### View & controller methods
|
178
176
|
|
179
177
|
**`current_app`** Returns `App` object related to current session. Returns `nil` when the Rails is being used normally.
|
180
178
|
|
data/lib/native/railtie.rb
CHANGED
@@ -9,6 +9,12 @@ module Native
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
+
initializer 'native.action_controller' do
|
13
|
+
ActiveSupport.on_load :action_controller do
|
14
|
+
include NativeHelper
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
12
18
|
initializer 'native.sprockets-rails' do
|
13
19
|
Rails.application.config.assets.precompile += %w( native/android.js native/ios.js native/uwp.js native/chrome.js native/osx.js native/win32.js native/win64.js native/lin32.js native/lin64.js native/web.js native/android.css native/ios.css native/uwp.css native/chrome.css native/osx.css native/win32.css native/win64.css native/lin32.css native/lin64.css native/web.css )
|
14
20
|
end
|
data/lib/native/version.rb
CHANGED