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

20 commits

Author SHA1 Message Date
Duncan Stuart
386cae5f07 Make generators comply with Rubocop
There doesn't seem to be any particular reason to exclude these. It's at
least nice to have consistent use of quotes within the same file.

This does run the risk of imposing our specific rubocop rules on other
people's code (double vs single quotes is the cause of holy wars), but
if anything obviously awful comes up, we can exclude generators from
that specific rule.

We do however need to exclude the templates, since these have a .rb
extension despite containing erb tags.
2019-08-21 17:23:00 +02:00
Max Calabrese
c6801a8963 Add type: :policy metadata to RSpec template #566 2018-11-26 09:29:29 +01:00
Ian Young
675d7c9c22 Use .all in the scope generators
This matches the examples in the README, and is the correct behavior for
anyone using ActiveRecord. Passing the `scope` object directly out can
cause weird behavior when used like `policy_scope(MyKlass)`.
2018-05-31 10:00:45 -05:00
Yoshiyuki Hirano
d9faff2a41 Remove empty line for cosme 2018-05-16 05:56:46 +09:00
Yoshiyuki Hirano
c6323534e4 chmod -x template/policy.rb 2018-05-16 05:56:46 +09:00
Yoshiyuki Hirano
8eaa94f21b Refactor source_root for cosme 2018-05-16 05:54:54 +09:00
Pavel Shpak
37fb6264db clean application_policy template 2016-05-10 11:33:15 +03:00
Corneliu Stanciu
7cee0f01a6 use new ruby syntax for install generator
Rubocop was showing a warning to use the new ruby syntax
2016-04-14 15:26:22 +02:00
Max Calabrese
aedebeab47 Use RSpec.describe in spec template
Fixes #311
2015-08-26 17:15:39 +02:00
Eric Kelly
5900e7ec6f Reorder policy spec actions 2014-10-31 14:25:56 -04:00
nTraum
2d36e93871 Use RSpec's described_class feature to specify the subject
Removes code duplication and makes it easier to rename policies.
2014-10-14 00:32:54 +02:00
y@su
3d31e97a57 Update rspec generator to case when rails_helper.rb exists 2014-09-10 15:43:52 +09:00
Brian Muller
9861c81a23 removed unecessary blank lines in installation template 2014-08-29 18:19:51 -04:00
Jonas Nicklas
451d8081e3 Inherit from application policy scope instead of using Struct 2014-06-24 01:43:31 +02:00
Thomas Klemm
068b5f5d7a Merge pull request #138 from johnotander/spec_generator
Add generators for policy specs / tests with Rspec, MiniTest and Test::Unit
2014-04-28 22:35:00 +02:00
John Otander
ab536852e0 Add generator support for test_unit/minitest. 2014-04-23 14:03:40 -06:00
John Otander
933d9295ba Add spec generator for policies.
Add test hook.

Remove old spec template.
2014-04-22 18:13:58 -06:00
Andrey Deryabin
d3bf3141b1 Add Scope class to generator 2014-03-05 01:30:45 +04:00
Brendon Murphy
cf8a739bb3 Change default index? policy to false
See gh-17 for initial discussion.  I think that the default provided
before this commit is confusing, because an empty result is not a
good indicator of authorization failure.  Returning false better
communicates "override this is you want it".
2013-03-09 03:01:49 -08:00
Jonas Nicklas
37810ccc31 Added generators 2012-11-19 10:53:14 +01:00