toolbox 0.1.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/bake/ruby/gdb.rb +135 -0
- data/bake/toolbox/gdb.rb +137 -0
- data/bake/toolbox/lldb.rb +137 -0
- data/context/fiber-debugging.md +171 -0
- data/context/getting-started.md +200 -0
- data/context/heap-debugging.md +351 -0
- data/context/index.yaml +28 -0
- data/context/object-inspection.md +208 -0
- data/context/stack-inspection.md +188 -0
- data/data/toolbox/command.py +479 -0
- data/data/toolbox/constants.py +200 -0
- data/data/toolbox/context.py +371 -0
- data/data/toolbox/debugger/__init__.py +101 -0
- data/data/toolbox/debugger/gdb_backend.py +664 -0
- data/data/toolbox/debugger/lldb_backend.py +986 -0
- data/data/toolbox/fiber.py +877 -0
- data/data/toolbox/format.py +205 -0
- data/data/toolbox/heap.py +679 -0
- data/data/toolbox/init.py +89 -0
- data/data/toolbox/print.py +79 -0
- data/data/toolbox/rarray.py +116 -0
- data/data/toolbox/rbasic.py +99 -0
- data/data/toolbox/rbignum.py +48 -0
- data/data/toolbox/rclass.py +136 -0
- data/data/toolbox/readme.md +214 -0
- data/data/toolbox/rexception.py +150 -0
- data/data/toolbox/rfloat.py +88 -0
- data/data/toolbox/rhash.py +151 -0
- data/data/toolbox/rstring.py +230 -0
- data/data/toolbox/rstruct.py +149 -0
- data/data/toolbox/rsymbol.py +278 -0
- data/data/toolbox/rvalue.py +183 -0
- data/data/toolbox/stack.py +620 -0
- data/lib/toolbox/gdb.rb +21 -0
- data/lib/toolbox/lldb.rb +21 -0
- data/lib/toolbox/version.rb +7 -1
- data/lib/toolbox.rb +9 -24
- data/license.md +21 -0
- data/readme.md +64 -0
- data/releases.md +9 -0
- data.tar.gz.sig +0 -0
- metadata +95 -165
- metadata.gz.sig +0 -0
- data/Rakefile +0 -61
- data/lib/dirs.rb +0 -9
- data/lib/toolbox/config.rb +0 -211
- data/lib/toolbox/default_controller.rb +0 -393
- data/lib/toolbox/helpers.rb +0 -11
- data/lib/toolbox/rendering.rb +0 -413
- data/lib/toolbox/searching.rb +0 -85
- data/lib/toolbox/session_params.rb +0 -63
- data/lib/toolbox/sorting.rb +0 -74
- data/locale/de/LC_MESSAGES/toolbox.mo +0 -0
- data/public/images/add.png +0 -0
- data/public/images/arrow_down.gif +0 -0
- data/public/images/arrow_up.gif +0 -0
- data/public/images/close.png +0 -0
- data/public/images/edit.gif +0 -0
- data/public/images/email.png +0 -0
- data/public/images/page.png +0 -0
- data/public/images/page_acrobat.png +0 -0
- data/public/images/page_add.png +0 -0
- data/public/images/page_copy.png +0 -0
- data/public/images/page_delete.png +0 -0
- data/public/images/page_edit.png +0 -0
- data/public/images/page_excel.png +0 -0
- data/public/images/page_list.png +0 -0
- data/public/images/page_save.png +0 -0
- data/public/images/page_word.png +0 -0
- data/public/images/remove.png +0 -0
- data/public/images/show.gif +0 -0
- data/public/images/spinner.gif +0 -0
- data/public/javascripts/popup.js +0 -498
- data/public/javascripts/toolbox.js +0 -18
- data/public/stylesheets/context_menu.css +0 -168
- data/public/stylesheets/popup.css +0 -30
- data/public/stylesheets/toolbox.css +0 -107
- data/view/toolbox/_collection.html.erb +0 -24
- data/view/toolbox/_collection_header.html.erb +0 -7
- data/view/toolbox/_context_menu.html.erb +0 -17
- data/view/toolbox/_dialogs.html.erb +0 -6
- data/view/toolbox/_form.html.erb +0 -30
- data/view/toolbox/_form_collection_row.html.erb +0 -18
- data/view/toolbox/_form_fieldset.html.erb +0 -30
- data/view/toolbox/_form_fieldset_row.html.erb +0 -19
- data/view/toolbox/_list.html.erb +0 -25
- data/view/toolbox/_list_row.html.erb +0 -10
- data/view/toolbox/_menu.html.erb +0 -7
- data/view/toolbox/_search_field.html.erb +0 -8
- data/view/toolbox/_show.html.erb +0 -12
- data/view/toolbox/_show_collection_row.html.erb +0 -6
- data/view/toolbox/_show_fieldset.html.erb +0 -21
- data/view/toolbox/edit.html.erb +0 -5
- data/view/toolbox/index.html.erb +0 -3
- data/view/toolbox/new.html.erb +0 -9
- data/view/toolbox/show.html.erb +0 -39
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
require File.expand_path("../dirs", File.dirname(__FILE__))
|
|
2
|
-
require 'fastercsv'
|
|
3
|
-
|
|
4
|
-
module Toolbox
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
# Defines the default action.
|
|
8
|
-
#
|
|
9
|
-
module DefaultController
|
|
10
|
-
|
|
11
|
-
def self.setup #:nodoc:
|
|
12
|
-
ActionController::Base.send(:extend, ClassMethods)
|
|
13
|
-
#ActionController::Base.send(:include, InstanceMethods)
|
|
14
|
-
ActionView::Base.send(:include, HelperMethods)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
module HelperMethods
|
|
18
|
-
def get_record
|
|
19
|
-
instance_variable_get ('@' + controller.model_name).to_sym
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def context_menu_link(rec, context = nil)
|
|
23
|
-
if controller.respond_to? :menu_config
|
|
24
|
-
context_records = []
|
|
25
|
-
# get the record in show-mode
|
|
26
|
-
context_records << get_record if get_record.is_a? ActiveRecord::Base
|
|
27
|
-
context_records << context if context
|
|
28
|
-
p = {}
|
|
29
|
-
context_records.each { |r| p["#{r.class.name.to_s}_id".to_sym] = r }
|
|
30
|
-
ctx_url =send("context_menu_#{rec.class.to_s.underscore}_path".to_sym, rec, p)
|
|
31
|
-
link_to_function('▼', "show_context_menu(event, '#{ctx_url}')")
|
|
32
|
-
else
|
|
33
|
-
''
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# returns html necessary to load javascript and css to make the toolbox work
|
|
38
|
-
def toolbox_includes()
|
|
39
|
-
return "" if @toolbox_already_included
|
|
40
|
-
@toolbox_already_included = true
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
js = javascript_include_tag "toolbox-#{Toolbox::VERSION}/toolbox", "toolbox-#{Toolbox::VERSION}/popup"
|
|
44
|
-
cs = stylesheet_link_tag 'toolbox/context_menu', 'toolbox/popup', 'toolbox/toolbox'
|
|
45
|
-
js + "\n" + cs + "\n"
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
module ClassMethods
|
|
52
|
-
|
|
53
|
-
# The listed associations are included in when using find together with
|
|
54
|
-
# search fields. Thus if a search field defintion contains "foreign" fields
|
|
55
|
-
# one may include the corresponding association.
|
|
56
|
-
def include_assoc *assoc
|
|
57
|
-
write_inheritable_attribute('include_assoc', assoc)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
module InstanceMethods #:nodoc:all
|
|
63
|
-
|
|
64
|
-
def index
|
|
65
|
-
obj = paging
|
|
66
|
-
instance_variable_set :@recs, obj
|
|
67
|
-
|
|
68
|
-
respond_to do |format|
|
|
69
|
-
format.html do
|
|
70
|
-
begin
|
|
71
|
-
render # allow to overwrite the view of an action
|
|
72
|
-
rescue ActionView::MissingTemplate
|
|
73
|
-
render :template => 'toolbox/index'
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
format.xml { render :xml => obj }
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
def show
|
|
81
|
-
rec = model_class.find(params[:id])
|
|
82
|
-
set_record rec
|
|
83
|
-
|
|
84
|
-
@show_config = show_config rec
|
|
85
|
-
@embedded_list = nil
|
|
86
|
-
if @show_config.embedded_lists.length > 0
|
|
87
|
-
prefix = params[:list] || @show_config.embedded_lists.first.prefix
|
|
88
|
-
@show_config.embedded_lists.each do |embedded_list|
|
|
89
|
-
@embedded_list = embedded_list if embedded_list.prefix == prefix
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
respond_to do |format|
|
|
94
|
-
format.html do
|
|
95
|
-
begin
|
|
96
|
-
render # allow to overwrite the view of an action
|
|
97
|
-
rescue ActionView::MissingTemplate
|
|
98
|
-
render :template => 'toolbox/show'
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
format.xml { render :xml => rec }
|
|
102
|
-
format.pdf #{ render @show_config.pdf_options }
|
|
103
|
-
format.csv { stream_csv show_csv(rec, params) }
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def new
|
|
109
|
-
# Handle dublicate command
|
|
110
|
-
param_name = "#{model_name}_id".to_sym
|
|
111
|
-
attr = {}
|
|
112
|
-
attr = model_class.find(params[param_name]).attributes if params[param_name]
|
|
113
|
-
obj = model_class.new attr
|
|
114
|
-
|
|
115
|
-
set_record obj
|
|
116
|
-
|
|
117
|
-
# context support
|
|
118
|
-
# set all _id fields, if available from params
|
|
119
|
-
params.each_pair do | key,value |
|
|
120
|
-
if key.to_s.ends_with? '_id' and obj.respond_to? key + '='
|
|
121
|
-
obj.send(key + '=', value)
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
respond_to do |format|
|
|
126
|
-
format.html { render :template => 'toolbox/new' }
|
|
127
|
-
format.xml { render :xml => obj }
|
|
128
|
-
format.js do
|
|
129
|
-
render :update do |page|
|
|
130
|
-
locals = {:widgetsets => controller.edit_config(obj).controlsets, :dialog => true }
|
|
131
|
-
page.replace_html 'dialog_id', :partial => "toolbox/form", :object => obj, :locals => locals
|
|
132
|
-
page << "$('dialog_id').popup.show();"
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
def edit
|
|
139
|
-
obj = model_class.find(params[:id])
|
|
140
|
-
set_record obj
|
|
141
|
-
|
|
142
|
-
respond_to do |format|
|
|
143
|
-
format.html { render :template => 'toolbox/edit' }
|
|
144
|
-
format.js do
|
|
145
|
-
render :update do |page|
|
|
146
|
-
locals = {:widgetsets => controller.edit_config(obj).controlsets, :dialog => true }
|
|
147
|
-
page.replace_html 'dialog_id', :partial => "toolbox/form", :object => obj, :locals => locals
|
|
148
|
-
page << "$('dialog_id').popup.show();"
|
|
149
|
-
end
|
|
150
|
-
end
|
|
151
|
-
end
|
|
152
|
-
end
|
|
153
|
-
|
|
154
|
-
def create
|
|
155
|
-
if params[:save] # save or ok clicked
|
|
156
|
-
p = params[model_name.to_sym]
|
|
157
|
-
preprocess_params nil, p
|
|
158
|
-
obj = model_class.new p
|
|
159
|
-
set_record obj
|
|
160
|
-
|
|
161
|
-
respond_to do |format|
|
|
162
|
-
if obj.save
|
|
163
|
-
obj = redirect_create obj if respond_to? :redirect_create
|
|
164
|
-
flash[:notice] = Messages.created % { :object => s_(controller_name.singularize.humanize.downcase)}
|
|
165
|
-
format.html { redirect_to(obj) }
|
|
166
|
-
format.js do
|
|
167
|
-
render :update do
|
|
168
|
-
|page| page << 'window.location.reload();' # TODO improvment?
|
|
169
|
-
end
|
|
170
|
-
end
|
|
171
|
-
format.xml { render :xml => obj, :status => :created, :location => obj }
|
|
172
|
-
else
|
|
173
|
-
format.html { render :template => "toolbox/new" }
|
|
174
|
-
format.xml { render :xml => obj.errors, :status => :unprocessable_entity }
|
|
175
|
-
format.js do
|
|
176
|
-
render :update do |page|
|
|
177
|
-
locals = {:widgetsets => controller.edit_config(obj).controlsets, :dialog => true }
|
|
178
|
-
page.replace_html 'dialog_id', :partial => "toolbox/form", :object => obj, :locals => locals
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
end
|
|
182
|
-
end
|
|
183
|
-
else # cancel clicked
|
|
184
|
-
redirect_to eval("#{controller_name}_path")
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
def update
|
|
190
|
-
obj = model_class.find(params[:id])
|
|
191
|
-
set_record obj
|
|
192
|
-
|
|
193
|
-
if params[:save]
|
|
194
|
-
par = params[model_name.to_sym]
|
|
195
|
-
preprocess_params obj, par
|
|
196
|
-
# Ensure that the the collection attributes exist - create them if not
|
|
197
|
-
# This is needed, if all collection items have been deleted.
|
|
198
|
-
edit_config(obj).controlsets.each do |controlset|
|
|
199
|
-
if controlset.collection_config
|
|
200
|
-
attr = Toolbox::Helpers.collection_attribute_name(controlset.collection_config, obj)
|
|
201
|
-
par[attr] ||= {}
|
|
202
|
-
end
|
|
203
|
-
end
|
|
204
|
-
|
|
205
|
-
respond_to do |format|
|
|
206
|
-
if obj.update_attributes(par)
|
|
207
|
-
flash[:notice] = Messages.updated % { :object => s_(controller_name.singularize.humanize.downcase)}
|
|
208
|
-
format.html { redirect_to(obj) }
|
|
209
|
-
format.xml { head :ok }
|
|
210
|
-
format.js do
|
|
211
|
-
render :update do |page|
|
|
212
|
-
page << 'window.location.reload();' # TODO improve ?
|
|
213
|
-
end
|
|
214
|
-
end
|
|
215
|
-
else
|
|
216
|
-
format.html { render :template => "toolbox/edit" }
|
|
217
|
-
format.xml { render :xml => obj.errors, :status => :unprocessable_entity }
|
|
218
|
-
format.js do
|
|
219
|
-
render :update do |page|
|
|
220
|
-
locals = {:widgetsets => controller.edit_config(obj).controlsets, :dialog => true }
|
|
221
|
-
page.replace_html 'dialog_id', :partial => "toolbox/form", :object => obj, :locals => locals
|
|
222
|
-
end
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
|
-
end
|
|
226
|
-
else # cancel clicked
|
|
227
|
-
respond_to do |format|
|
|
228
|
-
format.html { redirect_to(obj) }
|
|
229
|
-
format.xml { head :ok }
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
end
|
|
233
|
-
|
|
234
|
-
def destroy
|
|
235
|
-
obj = model_class.find(params[:id])
|
|
236
|
-
set_record obj
|
|
237
|
-
obj.destroy
|
|
238
|
-
|
|
239
|
-
respond_to do |format|
|
|
240
|
-
format.html { redirect_to(send(controller_name + '_url')) }
|
|
241
|
-
format.xml { head :ok }
|
|
242
|
-
format.js do
|
|
243
|
-
render :update do |page|
|
|
244
|
-
page << 'window.location.reload();' # TODO: improve?
|
|
245
|
-
end
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
end
|
|
249
|
-
|
|
250
|
-
def context_menu
|
|
251
|
-
rec = model_class.find(params[:id])
|
|
252
|
-
set_record rec
|
|
253
|
-
context = {}
|
|
254
|
-
params.select { |k,v| k.ends_with? '_id' }.each {|a| context[a[0]] = a[1] }
|
|
255
|
-
locals = { :context => context, :widget_list => menu_config(rec, context)}
|
|
256
|
-
respond_to do |format|
|
|
257
|
-
format.html { render :partial => "toolbox/context_menu", :object => rec, :locals => locals }
|
|
258
|
-
format.js do
|
|
259
|
-
render :update do |page|
|
|
260
|
-
page.replace_html 'context_menu_id', :partial => "toolbox/context_menu", :object => rec, :locals => locals
|
|
261
|
-
end
|
|
262
|
-
end
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
def model_name
|
|
267
|
-
controller_name.singularize
|
|
268
|
-
end
|
|
269
|
-
|
|
270
|
-
def model_class
|
|
271
|
-
controller_name.classify.constantize
|
|
272
|
-
end
|
|
273
|
-
|
|
274
|
-
def embedded_list_collection rec
|
|
275
|
-
options = {}
|
|
276
|
-
options[:order] = Toolbox::Sorting.order_by params, @embedded_list.widget_list.widgets, @embedded_list.prefix
|
|
277
|
-
options[:include] = @embedded_list.include_assoc if @embedded_list.include_assoc
|
|
278
|
-
rec.send(@embedded_list.collection_config.model_method).find(:all, options)
|
|
279
|
-
end
|
|
280
|
-
|
|
281
|
-
protected
|
|
282
|
-
|
|
283
|
-
def stream_csv options
|
|
284
|
-
field_renderers = options[:widget_list].widgets.map { |f| Toolbox::FieldRenderer.new self, f }
|
|
285
|
-
|
|
286
|
-
csv_string = FasterCSV.generate do |csv|
|
|
287
|
-
# Title
|
|
288
|
-
csv << field_renderers.map { |fr| fr.label(false, false) }
|
|
289
|
-
options[:collection].each do |rec|
|
|
290
|
-
csv << field_renderers.map { |fr| fr.render_value(rec, false) }
|
|
291
|
-
end
|
|
292
|
-
end
|
|
293
|
-
send_data csv_string, :type => "text/csv",
|
|
294
|
-
:filename=> options[:filename],
|
|
295
|
-
:disposition => 'attachment'
|
|
296
|
-
end
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
# check the consitency between the visible input-field
|
|
300
|
-
# and the invisible id field of autocomplete fields and
|
|
301
|
-
# parses date-fields
|
|
302
|
-
def preprocess_params rec, params
|
|
303
|
-
edit_config(rec).controlsets.each do |controlset|
|
|
304
|
-
controlset.widget_list.widgets.each do |widget|
|
|
305
|
-
case widget.type
|
|
306
|
-
when :auto_complete
|
|
307
|
-
if controlset.collection_config
|
|
308
|
-
# remove autocomplete text field for new or existing entries
|
|
309
|
-
a = Toolbox::Helpers.collection_attribute_name(controlset.collection_config, rec)
|
|
310
|
-
coll = params[a]
|
|
311
|
-
if coll
|
|
312
|
-
coll.each { |p| remove_autocomplete_text p, widget} if coll.is_a? Array
|
|
313
|
-
coll.each_value { |p| remove_autocomplete_text p, widget} if coll.is_a? Hash
|
|
314
|
-
end
|
|
315
|
-
if rec # may also have new entries...
|
|
316
|
-
a = Toolbox::Helpers.collection_attribute_name(controlset.collection_config, nil)
|
|
317
|
-
coll = params[a]
|
|
318
|
-
coll.each { |p| remove_autocomplete_text p, widget} if coll
|
|
319
|
-
end
|
|
320
|
-
else
|
|
321
|
-
remove_autocomplete_text params, widget
|
|
322
|
-
end
|
|
323
|
-
when :date
|
|
324
|
-
#params[widget.name] = Date.strptime(params[widget.name], '%d.%m.%y')
|
|
325
|
-
end
|
|
326
|
-
end
|
|
327
|
-
end
|
|
328
|
-
params
|
|
329
|
-
end
|
|
330
|
-
|
|
331
|
-
# do the paging for the index
|
|
332
|
-
def paging
|
|
333
|
-
filter = (params[:query] || params[:filter] || '')
|
|
334
|
-
cond = Toolbox::Searching.create_search_condition filter, search_fields
|
|
335
|
-
order = Toolbox::Sorting.order_by params, index_config.widgets
|
|
336
|
-
options = { :page => params[:page], :conditions => cond }
|
|
337
|
-
options[:order] = order if order
|
|
338
|
-
options[:include] = include_assoc if include_assoc
|
|
339
|
-
if respond_to? :index_data
|
|
340
|
-
index_data.paginate options
|
|
341
|
-
else
|
|
342
|
-
model_class.paginate options
|
|
343
|
-
end
|
|
344
|
-
end
|
|
345
|
-
|
|
346
|
-
private
|
|
347
|
-
|
|
348
|
-
def remove_autocomplete_text param, widget
|
|
349
|
-
value = param.delete widget.name
|
|
350
|
-
param[widget.name.to_s.foreign_key] = nil if value == '' || value == nil
|
|
351
|
-
end
|
|
352
|
-
|
|
353
|
-
def set_record obj
|
|
354
|
-
instance_variable_set "@#{model_name}".to_sym, obj
|
|
355
|
-
end
|
|
356
|
-
|
|
357
|
-
def include_assoc
|
|
358
|
-
self.class.read_inheritable_attribute('include_assoc')
|
|
359
|
-
end
|
|
360
|
-
|
|
361
|
-
end
|
|
362
|
-
|
|
363
|
-
end
|
|
364
|
-
|
|
365
|
-
# needed for not to conflict with the textdomain from the application controller
|
|
366
|
-
module Messages #:nodoc:all
|
|
367
|
-
include GetText
|
|
368
|
-
bindtextdomain('toolbox', :path => Toolbox::Dirs::LOCALE)
|
|
369
|
-
def self.created
|
|
370
|
-
_('%{object} was successfully created.')
|
|
371
|
-
end
|
|
372
|
-
def self.updated
|
|
373
|
-
_('%{object} was successfully updated.')
|
|
374
|
-
end
|
|
375
|
-
|
|
376
|
-
def self.create
|
|
377
|
-
_('Create')
|
|
378
|
-
end
|
|
379
|
-
|
|
380
|
-
def self.save
|
|
381
|
-
_('Save')
|
|
382
|
-
end
|
|
383
|
-
|
|
384
|
-
def self.cancel
|
|
385
|
-
_('Cancel')
|
|
386
|
-
end
|
|
387
|
-
|
|
388
|
-
def self.nothing_found
|
|
389
|
-
_('Nothing found')
|
|
390
|
-
end
|
|
391
|
-
end
|
|
392
|
-
|
|
393
|
-
end
|
data/lib/toolbox/helpers.rb
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
module Toolbox
|
|
3
|
-
module Helpers
|
|
4
|
-
|
|
5
|
-
def self.collection_attribute_name collection_config, rec
|
|
6
|
-
new_or_existing = rec && !rec.new_record? ? 'existing' : 'new'
|
|
7
|
-
"#{new_or_existing}_#{collection_config.type.name.to_s.underscore}_attributes"
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
end
|
|
11
|
-
end
|