Skip to content

Instantly share code, notes, and snippets.

View guus2006's full-sized avatar

Guus guus2006

View GitHub Profile
@guus2006
guus2006 / model.rb
Created January 17, 2010 11:41 — forked from hjblok/validate_by_6pp.rb
6PP KVDB with activeresource
## Based on example of http://gist.github.com/276455 but change to not use nokogiri but Activeresource
# define file in model directory
class Sixpp < ActiveResource::Base
class << self
# 6pp returns a xml where first item is hash. We need to enter hash["item"] and then check if there is 1 or more records.
def instantiate_collection(collection, prefix_options = {})
unless collection["item"].kind_of? Array
require 'net/dns/resolver'
# Custom Domain
#
# Require net-dns gem
#
# A Rack middleware to to resolve the custom domain to original subdomain
# for your multi telent application.
#
# It's all transperant to your application, it performs cname lookup and