class Tuttle::Presenters::ActiveRecord::ReflectionPresenter
Public Instance Methods
foreign_key()
click to toggle source
Calls superclass method
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 44 def foreign_key; super rescue 'Unknown' end def options_other other_options = options.except(:polymorphic, :dependent, :class_name, :autosave, :before_add, :before_remove) other_options.inspect unless other_options.empty? end end
inverse_of()
click to toggle source
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 13 def inverse_of if has_inverse? h.content_tag(:span, has_inverse?.inspect, class: options[:inverse_of].present? ? 'specified' : 'autodetected') end end
macro()
click to toggle source
Calls superclass method
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 10 def macro; super.inspect end
name()
click to toggle source
Calls superclass method
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 9 def name; super.inspect end
options_autosave()
click to toggle source
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 35 def options_autosave h.true_label(options[:autosave].present?, 'autosave') end
options_class_name()
click to toggle source
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 33 def options_class_name; options[:class_name] rescue 'Unknown' end def options_autosave h.true_label(options[:autosave].present?, 'autosave') end def options_required ## Todo handle auto-required? h.true_label(options[:required].present?, 'required') end def foreign_key; super rescue 'Unknown' end def options_other other_options = options.except(:polymorphic, :dependent, :class_name, :autosave, :before_add, :before_remove) other_options.inspect unless other_options.empty? end end end
options_dependent()
click to toggle source
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 32 def options_dependent; options[:dependent] rescue 'Unknown' end def options_class_name; options[:class_name] rescue 'Unknown' end def options_autosave h.true_label(options[:autosave].present?, 'autosave') end def options_required ## Todo handle auto-required? h.true_label(options[:required].present?, 'required') end def foreign_key; super rescue 'Unknown' end def options_other other_options = options.except(:polymorphic, :dependent, :class_name, :autosave, :before_add, :before_remove) other_options.inspect unless other_options.empty? end end end end
options_other()
click to toggle source
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 46 def options_other other_options = options.except(:polymorphic, :dependent, :class_name, :autosave, :before_add, :before_remove) other_options.inspect unless other_options.empty? end
options_required()
click to toggle source
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 39 def options_required ## Todo handle auto-required? h.true_label(options[:required].present?, 'required') end
polymorphic?()
click to toggle source
Calls superclass method
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 24 def polymorphic? h.true_label(super, 'polymorphic') end
scoped?()
click to toggle source
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 19 def scoped? # TODO: potentially show the scope h.true_label(scope.present?, 'scoped') end
type()
click to toggle source
Calls superclass method
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 11 def type; super rescue 'Unknown' end def inverse_of if has_inverse? h.content_tag(:span, has_inverse?.inspect, class: options[:inverse_of].present? ? 'specified' : 'autodetected') end end def scoped? # TODO: potentially show the scope h.true_label(scope.present?, 'scoped') end def polymorphic? h.true_label(super, 'polymorphic') end def validate? h.true_label(super, 'validate') end def options_dependent; options[:dependent] rescue 'Unknown' end def options_class_name; options[:class_name] rescue 'Unknown' end def options_autosave h.true_label(options[:autosave].present?, 'autosave') end def options_required ## Todo handle auto-required? h.true_label(options[:required].present?, 'required') end def foreign_key; super rescue 'Unknown' end def options_other other_options = options.except(:polymorphic, :dependent, :class_name, :autosave, :before_add, :before_remove) other_options.inspect unless other_options.empty? end end end end end
validate?()
click to toggle source
Calls superclass method
# File lib/tuttle/presenters/active_record/reflection_presenter.rb, line 28 def validate? h.true_label(super, 'validate') end