You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The common way in which RubyCAS::Filter is recommended to be used (in a before_filter), and how it relies on the global configuration behaviour is complex
Having looked at the origins of this, I understand it's from the depths of 2006 or earlier, but it could do with a bit of love to remove the singleton nature and configuration pattern in favour of something more DI flavoured.
ie:
class YourController
before_filter :configurize, :restrict
def configurize
client = CASClient.new()
@filter = RubyCAS::Filter.new(client, config.rubycas)
end
def restrict
@filter.filter(self)
end
end
The text was updated successfully, but these errors were encountered:
The way the code is put together implies There Will Only Ever Be One Filter.
This is particularly annoying to test, as:
Having looked at the origins of this, I understand it's from the depths of 2006 or earlier, but it could do with a bit of love to remove the singleton nature and configuration pattern in favour of something more DI flavoured.
ie:
The text was updated successfully, but these errors were encountered: