Sha256: cb9c52f4ecbc05243d4ce37184da5142b163cbaf579a10bc9cf95026bbb0c51a

Contents?: true

Size: 852 Bytes

Versions: 1

Compression:

Stored size: 852 Bytes

Contents

module Padrino
  module Generators
    module Admin
      module Actions
        ##
        # Tell us which orm we are using
        #
        def orm
          fetch_component_choice(:orm).to_sym rescue :datamapper
        end
        alias :adapter :orm

        ##
        # Tell us for now wich orm we support
        #
        def supported_orm
          [:datamapper, :activerecord, :mongomapper, :mongoid]
        end

        ##
        # Add access_control permission in our app.rb
        #
        def add_project_module(controller)
          permission = "      role.project_module :#{controller}, \"/#{controller}\"\n"
          inject_into_file destination_root("/admin/app.rb"),  permission, :after => "access_control.roles_for :admin do |role, account|\n"
        end
      end # Actions
    end # Admin
  end # Generators
end # Padrino

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
padrino-admin-0.9.7 lib/padrino-admin/generators/actions.rb