Skip to content

Instantly share code, notes, and snippets.

@jpr5
Created August 16, 2010 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpr5/527777 to your computer and use it in GitHub Desktop.
Save jpr5/527777 to your computer and use it in GitHub Desktop.
# The default DM property doesn't support serials, so we add it in here
module DataMapper
class Property
class String
accept_options :serial
end
end
end
module DataMapper::Salesforce
class Property
class SFSerial < DataMapper::Property::String
primitive ::String
length 15
serial true
def self.dump(value, property)
value[0..14] unless value.blank?
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment