Sha256: 6c9f77b9ab41ad6ba5329d96c2324a461204cd9af22d45fe96dc40b330d6af20

Contents?: true

Size: 520 Bytes

Versions: 3

Compression:

Stored size: 520 Bytes

Contents

module Iatelier
  module Controllers
    module Books
      class Edit
        include Iatelier::Action
        include Iatelier::Controllers::Books::DbConnector
		expose :book, :database
        def call(params)
            # [optional] setting the database
            @database = params.get(:database)
	        self.set_database @database

            #
	        @book = Object.const_get(params[:book_type].capitalize).find(params[:id])
            @book.namespace = @database
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iatelier-0.5.2 lib/iatelier/controllers/books/edit.rb
iatelier-0.5.1 lib/iatelier/controllers/books/edit.rb
iatelier-0.5.0 lib/iatelier/controllers/books/edit.rb