preflex 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/preflex/preferences_helper.rb +1 -1
- data/app/models/preflex/preference.rb +2 -2
- data/lib/preflex/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: e71862b1384da913297dc1a47fe91505cfdacc5623a1144ce1073c7f00e2d960
|
4
|
+
data.tar.gz: 403b45918e618161d15584d5d26e106a588728d80e1614953eedc7b55728d2b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8414c6f22471c66cdaaf76138e0f88fcdc0376ef942e32de98a69f60da88d1980ed932a91f8f31e84a7468ef6335773876f84567b66052fd18e3e6812ce4685b
|
7
|
+
data.tar.gz: 905fa3b347ea9601515394e7b6b7685f172336c563113347e0ec8fc9dddeed442147795bb20ea0afa0da6b69a86c2f41a7401193828a4760a9d9a247d83eef03
|
@@ -43,7 +43,7 @@ module Preflex
|
|
43
43
|
|
44
44
|
localStorage.setItem(this.localStorageKey, JSON.stringify(this.dataLocal))
|
45
45
|
this.updateOnServer(name, value)
|
46
|
-
document.dispatchEvent(new CustomEvent('preflex:preference-updated', { detail: { name, value } }))
|
46
|
+
document.dispatchEvent(new CustomEvent('preflex:preference-updated', { detail: { klass: this.klass, name, value } }))
|
47
47
|
}
|
48
48
|
|
49
49
|
updateOnServer(name, value) {
|
@@ -31,7 +31,7 @@ module Preflex
|
|
31
31
|
@preferences.add(name)
|
32
32
|
|
33
33
|
store_attribute(:data, name, type, default: default)
|
34
|
-
store_attribute(:data, "#{name}_updated_at_epoch".to_sym, :
|
34
|
+
store_attribute(:data, "#{name}_updated_at_epoch".to_sym, :big_integer, default: 0)
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.current_owner(controller_instance)
|
@@ -67,7 +67,7 @@ module Preflex
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def self.ensure_preference_exists(name)
|
70
|
-
raise "Preference #{name} was not defined. Make sure you define it (e.g. `preference :#{name}, :
|
70
|
+
raise "Preference #{name} was not defined. Make sure you define it (e.g. `preference :#{name}, :big_integer, default: 10`)" unless @preferences&.include?(name)
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
data/lib/preflex/version.rb
CHANGED