Sha256: 32cdb010d681f5ca71692b05b494c4f20c65375067e0ba71b03f6c0b3741aeaf
Contents?: true
Size: 972 Bytes
Versions: 1
Compression:
Stored size: 972 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.belongs_to :user, :model => ::Ixtlan::Models::USER model.class_eval <<-EOS, __FILE__, __LINE__ if protected_instance_methods.find {|m| m == 'to_x'}.nil? protected def permissions Guard.permissions(user) end alias :to_x :to_xml_document def to_xml_document(opts, doc = nil) opts.merge!({:exclude => [:password,:user_id], :methods => [:user, :permissions]}) to_x(opts, doc) end end EOS end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ixtlan-0.4.0.pre5 | lib/ixtlan/models/authentication.rb |