lib/generators/adminpanel/resource/resource_generator_helper.rb in adminpanel-2.6.0 vs lib/generators/adminpanel/resource/resource_generator_helper.rb in adminpanel-2.6.1
- old
+ new
@@ -74,11 +74,11 @@
":#{attribute.split(':').first}"
end
end.join(",\n")
end
- def get_attribute_hash
+ def form_attributes_hash
fields.map do |attribute|
assign_attributes_variables(attribute)
send(@attr_type + '_form_hash')
end.join(", \n")
end
@@ -105,12 +105,12 @@
def boolean_form_hash
attribute_hash(@attr_field, 'boolean')
end
- def datepicker_form_hash
- attribute_hash(@attr_field, 'datepicker')
+ def date_form_hash
+ attribute_hash(@attr_field, 'date')
end
def file_field_form_hash
attribute_hash(gallery_name.pluralize, 'adminpanel_file_field')
end
@@ -146,10 +146,10 @@
def placeholder_type
"'placeholder' => '#{@attr_field}'"
end
def model_type(model_name)
- "'options' => Proc.new { |object|\n" +
+ "'options' => Proc.new { |#{resource_name.downcase}_instance|\n" +
indent("Adminpanel::#{model_name}.all\n", 2) +
'}'
end
def has_associations?