-
In the developer.log I see the sql is not checking for the correct ID of the user, instead checking for is null?
Processing by RetailUsersController#new as HTML
[1m[36mRetailUser Load (2.0ms)[0m…
-
Hi guys,
This is my Ability.rb file :
``` ruby
class Ability
include CanCan::Ability
def initialize(user)
user ||= Manifold.new
if user.kind_of? User
if user.role? :super_admin
…
Awea updated
10 years ago
-
Hi, I'm using cancan 1.68 and i have a strange behaviour.
I have a Meeting and User models defined this way:
``` ruby
class Meeting < ActiveRecord::Base
audited
belongs_to :user
has_man…
-
In wiki we can read:
Important: If a block or hash of conditions exist they will be ignored when checking on a class, and it will return true. For example:
can :read, Project, :priority => 3
can? :r…
-
My two associations:
---
class Project < ActiveRecord::Base
belongs_to :user
end
class User < ActiveRecord::Base
include ActiveModel::MassAssignmentSecurity
has_many :projects
# list of at…
-
For example I have the following models
```
class Part < ActiveRecord::Base
has_and_belongs_to_many :assemblies
end
class Assembly < ActiveRecord::Base
has_and_belongs_to_many :parts
end
class En…
-
In Rails 3.2, the default recommendation is now to through an exception on mass-assignment of protected attributes in development and test environments.
In CanCan, even if one protects attributes, it…
-
Need check to user's ability to multiple instances is this valid in CanCan?
```
authorize! :assign_to_company, @contact, @company_profile
can [:assign_to_company, :withdraw_from_company], [Contact, …
-
-
Let's say you have this hypothetical order controller:
```
class OrderController < ApplicationController
load_and_authorize_resource :user
load_and_authorize_resource :payment_method, through: :…