Hobo Dependencies on ActiveRecord

aravartanian edited this page Sep 12, 2010 · 5 revisions

Just opening up a wiki page to track dependencies that Hobo and Rapid make on Active Record.

rapid_helper.rb (line 143)


  def standard_fields(model, include_timestamps=false)
    fields = model.attr_order.*.to_s & model.content_columns.*.name
    raise fields.to_s
    fields -= %w{created_at updated_at created_on updated_on deleted_at} unless include_timestamps
    fields.reject! { |f| model.never_show? f }
    fields
  end</pre>

The model.content_columns is a call to an ActiveRecord method.

hobo_fields/model_extension.rb (line 79)


    class << self
      alias_method_chain :belongs_to, :field_declarations
    end

POROs (Plain Old Ruby Objects) don’t have a belongs_to class method.

rapid_forms.dryml (line 17 or so)


["#{pname}[#{field}]", val] unless val.nil? || 
  field.to_sym.in?(this.class.attr_protected) || 
  (this.new_record? && val == this.class.column(field).default)

The this.class.attr_protected is a call to ActiveRecord.