Sha256: 5cdd601c38060a57a897fc5b9a43b25f1d28ad5c2233a519dee86ba7db9e645c
Contents?: true
Size: 926 Bytes
Versions: 2
Compression:
Stored size: 926 Bytes
Contents
require 'dm-serializer' module Ixtlan module Models module Authentication def self.included(model) model.send(:include, DataMapper::Resource) model.property :id, ::DataMapper::Types::Serial, :default => 1 model.property :login, String,:format => /^[a-zA-Z0-9\-!=+$%^&*\(\){}|\[\]<>_.]*$/ model.property :password, String,:format => /^[a-zA-Z0-9_.]*$/ model.send :attr_accessor, :token model.belongs_to :user, :model => ::Ixtlan::Models::USER model.class_eval <<-EOS, __FILE__, __LINE__ if protected_instance_methods.find {|m| m == 'to_x'}.nil? protected alias :to_x :to_xml_document def to_xml_document(opts, doc = nil) opts.merge!({:exclude => [:password,:user_id], :methods => [:token, :user]}) to_x(opts, doc) end end EOS end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ixtlan-0.4.0.pre2 | lib/ixtlan/models/authentication.rb |
ixtlan-0.4.0.pre | lib/ixtlan/models/authentication.rb |