Sha256: a46165de69086c96d18dae00c8d975c6f0ea3ec779a0e85d136a45b2e0a5d7a5

Contents?: true

Size: 864 Bytes

Versions: 15

Compression:

Stored size: 864 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, :couchrest, :sequel]
        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|\n"
        end
      end # Actions
    end # Admin
  end # Generators
end # Padrino

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
padrino-admin-0.9.24 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.23 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.22 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.21 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.20 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.19 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.18 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.17 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.16 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.15 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.14 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.13 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.12 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.11 lib/padrino-admin/generators/actions.rb
padrino-admin-0.9.10 lib/padrino-admin/generators/actions.rb