Skip to content

Instantly share code, notes, and snippets.

@noeticpenguin
Created July 26, 2013 21:26
Show Gist options
  • Save noeticpenguin/6092370 to your computer and use it in GitHub Desktop.
Save noeticpenguin/6092370 to your computer and use it in GitHub Desktop.
field.rb
class Field < ActiveRecord::Base
belongs_to :obj
has_many :child_relationships
has_many :picklist_values
accepts_nested_attributes_for :child_relationships, :picklist_values
attr_accessible :length, :name, :type, :defaultValue, :label, :byteLength, :unique, :nameField,
:sortable, :filterable, :calculated, :scale, :precision, :nillable, :caseSensitive,
:inlineHelpText, :controllerName, :writeRequiresMasterRead, :externalId, :idLookup,
:autoNumber, :soapType, :restrictedPicklist, :namePointing, :custom, :defaultedOnCreate,
:deprecatedAndHidden, :htmlFormatted, :defaultValueFormula, :calculatedFormula, :dependentPicklist,
:referenceTo, :relationshipName, :relationshipOrder, :cascadeDelete, :restrictedDelete,
:digits, :createable, :updateable, :groupable, :permissionable, :displayLocationInDecimal
def referenceTo=(data)
write_attribute(:referenceTo, data.join(" "))
end
self.inheritance_column = :_type_disabled
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment