Sha256: 480ed6078d56d6dc807a54a62c791603956c7ea4d2d4faeb21a136b21979b08e

Contents?: true

Size: 874 Bytes

Versions: 36

Compression:

Stored size: 874 Bytes

Contents

module Spider; module Master
    
    class Customer < Spider::Model::Managed
        element :name, String
        element :uuid, UUID
        element :public_key, Text
        element :private_key, Text
        multiple_choice :admins, Master::Admin, :add_multiple_reverse => {:name => :customers, :association => :multiple_choice} do
            element :receive_notifications, Bool, :default => true
            element :manage_plugins, Bool, :default => true
        end
        
        with_mapper do
            
            def before_save(obj, mode)
                if mode == :insert
                    global = Admin.where(:global => true)
                    global.each do |adm|
                        obj.admins << adm
                    end
                end
                super
            end
            
        end
        
    end
    
end; end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
spiderfw-1.0.1 apps/master/models/customer.rb
spiderfw-1.0.0 apps/master/models/customer.rb
spiderfw-0.6.39 apps/master/models/customer.rb
spiderfw-0.6.38 apps/master/models/customer.rb
spiderfw-0.6.37 apps/master/models/customer.rb
spiderfw-0.6.35 apps/master/models/customer.rb
spiderfw-0.6.34 apps/master/models/customer.rb
spiderfw-0.6.33 apps/master/models/customer.rb
spiderfw-0.6.32 apps/master/models/customer.rb
spiderfw-0.6.31 apps/master/models/customer.rb
spiderfw-0.6.30 apps/master/models/customer.rb
spiderfw-0.6.29 apps/master/models/customer.rb
spiderfw-0.6.28 apps/master/models/customer.rb
spiderfw-0.6.27 apps/master/models/customer.rb
spiderfw-0.6.26 apps/master/models/customer.rb
spiderfw-0.6.26.pre1 apps/master/models/customer.rb
spiderfw-0.6.25 apps/master/models/customer.rb
spiderfw-0.6.24 apps/master/models/customer.rb
spiderfw-0.6.23 apps/master/models/customer.rb
spiderfw-0.6.22 apps/master/models/customer.rb