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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 021c5831c428c4d827d6e21f274b3f9b5fdfb5bddbe84f973de9aedcd4850336
4
- data.tar.gz: e8295425bbc47bb6e461b52c0cf9b63a03f03dfae3dcc9406274296e4610a186
3
+ metadata.gz: da5343cf8aac00c325f7a04c67d0b393fdd2a3fb6a4c751969e5fd58eb104822
4
+ data.tar.gz: 508dd3ed8d998b65a5cfc4a06c17c075480fdb4781a77286e5ca5e17c8689a9c
5
5
  SHA512:
6
- metadata.gz: 35b7df004ef8b30d2c086859833d975424b1cc0b76d8a731fb4957376d95bef847427fdc446032ce3a3ae15e01c3d6424620848c12e9758e7f980c3ee01faf85
7
- data.tar.gz: 2ddff6aa9ff6e30e18f4e01125f5eb19b78ff26cc25a4def5bdf7c20e2072d5c87d7945af0b4a4823dd6bce7db14e382f95d156f5d7358b2c9c1ac13270560ef
6
+ metadata.gz: 45e32a204005bf0837745e4429660cb43c216d526c0bf1f1f01af027652a435820ad378db75b13ef4548d9a963fb2fe084243ccf4282448d16015cfa0b66f6e6
7
+ data.tar.gz: c8723fa247c1708856a364277d5afefbcbe2591b200d8c55ba0914f72679c209df93a1d0f4a5233259c559f43323290cc31bac792b7ae3115bd97164ac32a8c3
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 2.1.3 - 2018-01-02
8
+
9
+ * enhancements
10
+ * automatically include helper in controllers
11
+ * bugfixes
12
+ * fixed overriding `set_app_owner` method
13
+
7
14
  ### 2.1.2 - 2018-01-02
8
15
 
9
16
  * bugfixes
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 `protected` method to your `ApplicationController`:
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
 
@@ -67,9 +67,5 @@ module Native
67
67
  cookies[:nativeApp] = url
68
68
  end
69
69
 
70
- def set_app_owner
71
- super || current_user if current_user
72
- end
73
-
74
70
  end
75
71
  end
@@ -14,4 +14,8 @@ module NativeHelper
14
14
  stylesheet.concat javascript
15
15
  end
16
16
 
17
+ def set_app_owner
18
+ current_user if current_user
19
+ end
20
+
17
21
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Native
2
2
 
3
- VERSION = '2.1.2'
3
+ VERSION = '2.1.3'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: native
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Hübotter