Sha256: 0e64304b76a013b84151dda9d9d79db63e4aa53ff48d92b5225ed4cd1022f731

Contents?: true

Size: 667 Bytes

Versions: 22

Compression:

Stored size: 667 Bytes

Contents

# coding: UTF-8

module Daddy
  module Models
    
    module CrudExtension
      def self.included(base)
        base.extend(ClassMethods)
        base.__send__(:include, InstanceMethods)
      end

      module InstanceMethods

        def readable_by?(user)
          true
        end

        def creatable_by?(user)
          readable_by?(user)
        end

        def updatable_by?(user)
          readable_by?(user)
        end

        def deletable_by?(user)
          readable_by?(user)
        end

        def destroy_logically!
          self.deleted = true
          save!
        end
      end

      module ClassMethods
      end

    end

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
daddy-0.3.0 lib/daddy/models/crud_extension.rb
daddy-0.2.23 lib/daddy/models/crud_extension.rb
daddy-0.2.22 lib/daddy/models/crud_extension.rb
daddy-0.2.21 lib/daddy/models/crud_extension.rb
daddy-0.2.20 lib/daddy/models/crud_extension.rb
daddy-0.2.19 lib/daddy/models/crud_extension.rb
daddy-0.2.18 lib/daddy/models/crud_extension.rb
daddy-0.2.17 lib/daddy/models/crud_extension.rb
daddy-0.2.16 lib/daddy/models/crud_extension.rb
daddy-0.2.15 lib/daddy/models/crud_extension.rb
daddy-0.2.14 lib/daddy/models/crud_extension.rb
daddy-0.2.13 lib/daddy/models/crud_extension.rb
daddy-0.2.12 lib/daddy/models/crud_extension.rb
daddy-0.2.11 lib/daddy/models/crud_extension.rb
daddy-0.2.10 lib/daddy/models/crud_extension.rb
daddy-0.2.9 lib/daddy/models/crud_extension.rb
daddy-0.2.8 lib/daddy/models/crud_extension.rb
daddy-0.2.7 lib/daddy/models/crud_extension.rb
daddy-0.2.6 lib/daddy/models/crud_extension.rb
daddy-0.2.5 lib/daddy/models/crud_extension.rb