1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00
Commit graph

7 commits

Author SHA1 Message Date
Jonas Nicklas
753bb0a2b6 Revert namespaces 2014-08-22 11:19:36 +02:00
Jonas Nicklas
9d578a0a2d Make sure Pundit doesn’t generate any deprecation warnings with any version of RSpec 2014-07-18 16:20:48 +02:00
Jonas Nicklas
1942db052b Merge pull request #168 from elabs/headless-policies
Enable headless policies
2014-07-17 11:31:37 +02:00
Unknown_Guy
bf29cae128 find correct policy when model is namespaced 2014-07-15 13:08:08 +03:00
Thomas Klemm
b18d16ca10 Enable headless policies
Enables `policy(:dashboard) # => DashboardPolicy`.

Policies without a matching model can come in handy when a controller
isn't modeled alongside a resource, e.g. a `DashboardsController`.

The policy lookup by symbol also helps with strong parameters,
since I prefer `policy(:post)` or `policy(@post || :post)` over `policy(@post || Post)`.
2014-07-13 12:48:45 +02:00
Eduardo Gutierrez
4c7d3c4dd6 Lookup policies in the current namespace
Addresses #12. If the policy is not defined in `namespace`, `const_get`
will search through the inheritance change of `namespace` to find the
policy.
2014-05-22 12:55:34 -04:00
Dillon Benson
30b7861431 moved class definitions from pundit_spec.rb to spec_helper.rb 2014-04-23 22:58:38 -04:00