marty 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/marty/auth_app.rb +4 -9
- data/app/components/marty/extras/layout.rb +16 -0
- data/app/components/marty/script_form.rb +1 -2
- data/app/controllers/marty/application_controller.rb +2 -0
- data/app/models/marty/pg_enum.rb +10 -0
- data/app/models/marty/user.rb +1 -0
- data/app/views/layouts/marty/application.html.erb +1 -1
- data/lib/marty/data_conversion.rb +5 -4
- data/lib/marty/monkey.rb +15 -0
- data/lib/marty/railtie.rb +1 -0
- data/lib/marty/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f1288f6cc23a26347fad541903d5f7df4c62c2e
|
4
|
+
data.tar.gz: b70b8b6df1ce3eab6720bddeed11f622b17421d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb4e5bf0e6dea87587dd93ae9d0a7bc78e65a425d64b3b8ba41a408df519d3ccb4d036f3d74570ba8d674d8514a74e4bb88c1569309a7e41a6756e8482882cb9
|
7
|
+
data.tar.gz: 762ca965e66e6f65d15a9ad713a2614c75dd7cee37669a94851be394260d0f40425da78462cd326fc36107ffaadd371845e92bae0c9124635828b44f84446702
|
@@ -39,19 +39,14 @@ class Marty::AuthApp < Marty::SimpleApp
|
|
39
39
|
|
40
40
|
endpoint :sign_in do |params|
|
41
41
|
user = Marty::User.try_to_login(params[:login], params[:password])
|
42
|
-
|
43
|
-
Netzke::Base.controller.set_user(user)
|
44
|
-
client.netzke_set_result(true)
|
45
|
-
true
|
46
|
-
else
|
47
|
-
client.netzke_set_result(false)
|
42
|
+
user ? Netzke::Base.controller.set_user(user) :
|
48
43
|
client.netzke_notify("Wrong credentials")
|
49
|
-
|
50
|
-
|
44
|
+
|
45
|
+
!!user
|
51
46
|
end
|
52
47
|
|
53
48
|
endpoint :sign_out do
|
54
49
|
Netzke::Base.controller.logout_user
|
55
|
-
|
50
|
+
true
|
56
51
|
end
|
57
52
|
end
|
@@ -55,6 +55,22 @@ module Marty
|
|
55
55
|
},
|
56
56
|
} + options
|
57
57
|
end
|
58
|
+
|
59
|
+
######################################################################
|
60
|
+
# PG ENUM field handling
|
61
|
+
|
62
|
+
def enum_column(c, klass)
|
63
|
+
editor_config = {
|
64
|
+
trigger_action: :all,
|
65
|
+
xtype: :combo,
|
66
|
+
store: klass::VALUES,
|
67
|
+
}
|
68
|
+
c.merge!(
|
69
|
+
column_config: { editor: editor_config },
|
70
|
+
field_config: editor_config,
|
71
|
+
type: :string,
|
72
|
+
)
|
73
|
+
end
|
58
74
|
end
|
59
75
|
end
|
60
76
|
end
|
@@ -162,9 +162,8 @@ class Marty::ScriptForm < Marty::Form
|
|
162
162
|
|
163
163
|
if script.save
|
164
164
|
client.netzke_set_form_values(js_record_data)
|
165
|
-
client.netzke_set_result(true)
|
166
165
|
client.refresh_parent(script.name)
|
167
|
-
return
|
166
|
+
return true
|
168
167
|
end
|
169
168
|
|
170
169
|
client.netzke_notify(model_adapter.errors_array(script).join("\n"))
|
data/app/models/marty/user.rb
CHANGED
@@ -25,6 +25,7 @@ class Marty::DataConversion
|
|
25
25
|
:float_array,
|
26
26
|
:json,
|
27
27
|
:jsonb,
|
28
|
+
:enum,
|
28
29
|
]
|
29
30
|
|
30
31
|
def self.convert(v, type)
|
@@ -39,11 +40,11 @@ class Marty::DataConversion
|
|
39
40
|
case type
|
40
41
|
when :boolean
|
41
42
|
case v.to_s.downcase
|
42
|
-
when "true", "1", "y" then true
|
43
|
-
when "false", "0", "n" then false
|
43
|
+
when "true", "1", "y", "t" then true
|
44
|
+
when "false", "0", "n", "f" then false
|
44
45
|
else raise "unknown boolean: #{v.inspect}"
|
45
46
|
end
|
46
|
-
when :string, :text
|
47
|
+
when :string, :text, :enum
|
47
48
|
v
|
48
49
|
when :integer
|
49
50
|
v.to_i
|
@@ -83,7 +84,7 @@ class Marty::DataConversion
|
|
83
84
|
# key for regular (non-mcfly) AR models which don't have
|
84
85
|
# MARTY_IMPORT_UNIQUENESS.
|
85
86
|
klass.const_get(:MARTY_IMPORT_UNIQUENESS) rescue [
|
86
|
-
klass.
|
87
|
+
klass.column_names.reject{|x| x=="id"}.first.to_sym]
|
87
88
|
end
|
88
89
|
|
89
90
|
@@associations = {}
|
data/lib/marty/monkey.rb
CHANGED
@@ -151,3 +151,18 @@ module Netzke::Basepack::DataAdapters
|
|
151
151
|
|
152
152
|
end
|
153
153
|
end
|
154
|
+
|
155
|
+
######################################################################
|
156
|
+
|
157
|
+
# Add pg_enum migration support -- FIXME: this doesn't belong here
|
158
|
+
module ActiveRecord
|
159
|
+
module ConnectionAdapters
|
160
|
+
class TableDefinition
|
161
|
+
def pg_enum(*args)
|
162
|
+
options = args.extract_options!
|
163
|
+
column_names = args
|
164
|
+
column_names.each { |name| column(name, name.to_s.pluralize, options) }
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
data/lib/marty/railtie.rb
CHANGED
data/lib/marty/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2016-
|
17
|
+
date: 2016-08-24 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: pg
|
@@ -389,6 +389,7 @@ files:
|
|
389
389
|
- app/models/marty/grid_index_string.rb
|
390
390
|
- app/models/marty/import_type.rb
|
391
391
|
- app/models/marty/name_validator.rb
|
392
|
+
- app/models/marty/pg_enum.rb
|
392
393
|
- app/models/marty/posting.rb
|
393
394
|
- app/models/marty/posting_type.rb
|
394
395
|
- app/models/marty/promise.rb
|