Using singular subject in exception message #725

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@ericboehs

The keys in the translation files are still the new 2.0 style (plural) but the subject being returned by the exception message shouldn't be plural. This makes this possible:

en:
  unauthorized:
    access:
      all: 'You do not have permission to %{action} this %{subject}.'

Maybe your intent was to use plural subjects here (e.g. ... have permission to edit comments) but in general you're only asking if the user can edit a singular object, not if they can edit comments in general (instance vs class object). If this is your intent I purpose a subject_plural key or similar as there is no way to run code on translation variables.

@travisbot

This pull request fails (merged b53ad06b into aed9f26).

@ericboehs

Any luck on this? Did you really mean to switch this to plural in 2.0?

I've rebased it to master; no conflicts. You should be able to auto-merge.

@xhoy

Dear submitter, Since cancan/raynB hasn't been active for more than 6 months and no body else then ryam himself has commit permissions the cancan project is on a stand still.
Since cancan has several issues including missing support for rails 4 cancan is moving forward to cancancan. More details on: #994

If your feel that your pull request or bug is still applicable (and hasn't been merged in to cancan) it would be really appreciated if you would resubmit it to cancancan (https://github.com/cancancommunity/cancancan)

We hope to see you on the other side!

@ericboehs

xhoy: I don't use cancan anymore. At the time he changed something in 2.0 which seemed to break some stuff. If this is still a problem I'm sure someone would have found it by now.

@ericboehs ericboehs closed this Apr 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment