Sha256: c3516ce9232bc005d04edda9f70015ed726419cc43551081c6879af0d3f78740

Contents?: true

Size: 594 Bytes

Versions: 7

Compression:

Stored size: 594 Bytes

Contents

module ActsAsApprovable
  module Generators
    module Base
      protected
      def owner?
        options[:owner].present?
      end

      def owner
        options[:owner] == 'owner' ? 'User' : options[:owner]
      end

      def scripts?
        options[:scripts]
      end

      def collection_actions
        actions = [:index, :history]
        actions << :mine if owner?
        actions.map { |a| ":#{a}" }
      end

      def member_actions
        actions = [:approve, :reject]
        actions << :assign if owner?
        actions.map { |a| ":#{a}" }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
acts_as_approvable-0.7.0 lib/generators/acts_as_approvable/base.rb
acts-as-approvable-0.6.9.1 lib/generators/acts_as_approvable/base.rb
acts-as-approvable-0.6.9 lib/generators/acts_as_approvable/base.rb
acts-as-approvable-0.6.8.1 lib/generators/acts_as_approvable/base.rb
acts-as-approvable-0.6.7 lib/generators/acts_as_approvable/base.rb
acts-as-approvable-0.6.6 lib/generators/acts_as_approvable/base.rb
acts-as-approvable-0.6.5 lib/generators/acts_as_approvable/base.rb