stffn / declarative_authorization

An unmaintained authorization plugin for Rails. Please fork to support current versions of Rails
MIT License
1.24k stars 230 forks source link

undefined method `filter_access_to' when deploying to heroku using a local version of the gem #153

Open bishma-stornelli opened 12 years ago

bishma-stornelli commented 12 years ago

I'm trying to deploy my application to heroku. It uses a local version of declarative_authorization because I needed to make a change to it.

The only change I did was https://github.com/bishma-stornelli/declarative_authorization/commit/b508c3c008ed4b72e9fe2ec7802bfafbc6c4590b

I needed to force reload of authorization rules because I'm storing permissions in the database.

It works perfect on deployment but I get undefined method `filter_access_to' for ClientsController when deploying to heroku.

These are the important parts of my files:

application_controller.rb

class ApplicationController < ActionController::Base
....
    before_filter { |contr| Authorization.current_user = contr.current_user }
....
end

clients_controller.rb

class ClientsController < ApplicationController
  inherit_resources
  actions :all, except: [:show]
  filter_access_to :index, require: :read, context: :client
  filter_access_to :new, :create, require: :create, context: :client
  filter_access_to :edit, :update, require: :update, context: :client
  filter_access_to :destroy, require: :destroy, context: :client
end

Gemfile

gem 'rails', '3.2.6'
gem "declarative_authorization", '= 0.5.5', path: "vendor/gems/declarative_authorization/"
gem 'ruby_parser'

config/enviroment.rb

IntegraProjectManagementSystem::Application.initialize! do |config|
  config.gem "declarative_authorization"
end

I've tried to add these gems to (following the installation instructions) but still not working:

gem 'gemcutter'
gem 'tumble'
gem 'faraday_middleware'

What am I missing? I asked this http://stackoverflow.com/questions/12280684/how-to-get-working-a-local-gem-on-heroku but no answer yet. Please help, I need to get it work on heroku really soon.