15 Matching Annotations
- Sep 2024
-
-
It has two relations that are similar, but different: subscriber, and user. The concept here is that a User may have many objects that are relevant to warrant their own Campaign. For this reason, we include this as a default. For example, if you are Netflix and have a Subscription and a WatchHistory object. If a user does not finish watching a video, you may want to remind them that they can finish watching it. If their subscription lapses, you may want to also remind them in a separate campaign. So, you'd have separate Caffeinate::CampaignSubscription objects where the subscriber is the relevant Subscription object or the WatchHistory object, and the user is the User.
-
-
-
memoize :call, condition: -> { environment == 'production' }
-
- Apr 2024
-
superuser.com superuser.com
-
This will fix the problem, as long as the Chrome developers do not decide to remove this option.
-
- Nov 2023
-
github.com github.com
-
Implement restrictive defaults (potentially allowing an explicit bypass) I understand that easy usability and rich out-of-the-box functionality is likely essential to this library's appeal to its users. Nevertheless I'd like to propose making the authorization properties ransackable_[attributes/associations/etc.] empty sets by default, forcing the developer to explicitly define whitelists for their use case. To soften the usability blow, a new ransack_unsafe(params[:q]) or ransack_explicit(params[:q], ransackable_attributes='*', ransackable_associations=(:post, :comment)) method could be introduced to offer developers a shorthand to bypass or override the whitelists for specific queries (after they've had to read a warning about why these methods can be dangerous).
-
-
chromestory.com chromestory.com
-
FIREFOX has a regular setting to disable it. Better mobile browser in many ways!
-
- Mar 2023
-
stackoverflow.com stackoverflow.com
- Feb 2023
-
-
There's been an interest expressed in the ecosystem of having some form of counterclaim for advisories surfaced by npm audit. There's been some discussion of a potential counterclaim mechanism for some time, but I've not seen a solution proposed.
Tags
Annotators
URL
-
-
github.com github.com
-
There should thus be an option to give npm a list of vulnerability IDs (CVEs etc.) that it does not need to defend because the admin has decided it does not apply to their edge case.
should be optional
Tags
Annotators
URL
-
- Dec 2022
-
stackoverflow.com stackoverflow.com
-
The path separator can also be customized using COMPOSE_PATH_SEPARATOR.
-
- Nov 2022
-
-
So when configuring Capybara, I'm using ignore_default_browser_options, and only re-use this DEFAULT_OPTIONS and exclude the key I don't want Capybara::Cuprite::Driver.new( app, { ignore_default_browser_options: true, window_size: [1200, 800], browser_options: { 'no-sandbox': nil }.merge(Ferrum::Browser::Options::Chrome::DEFAULT_OPTIONS.except( "disable-features", "disable-translate", "headless" )), headless: false, } )
-
-
-
You may want to change the controllers to your custom controllers with: Rails.application.routes.draw do use_doorkeeper do # it accepts :authorizations, :tokens, :token_info, :applications and :authorized_applications controllers :applications => 'custom_applications' end end
-
-
gitlab.com gitlab.com
-
What if I hate snakes and/or indifference?
-
- Jul 2022
-
discuss.rubyonrails.org discuss.rubyonrails.org
-
Overriding the ActiveStorage controllers to add authentication or customize behavior is a bit tedious because it requires either: using custom routes, which means losing the nice url helpers provided by active storage copy pasting the routes in the application routes.rb, which is not very DRY.
-
-
github.com github.com
-
ActiveSupport.on_load :active_storage_blob do def accessible_to?(accessor) attachments.includes(:record).any? { |attachment| attachment.accessible_to?(accessor) } || attachments.none? end end ActiveSupport.on_load :active_storage_attachment do def accessible_to?(accessor) record.try(:accessible_to?, accessor) end end ActiveSupport.on_load :action_text_rich_text do def accessible_to?(accessor) record.try(:accessible_to?, accessor) end end module ActiveStorage::Authorize extend ActiveSupport::Concern included do before_action :require_authorization end private def require_authorization head :forbidden unless authorized? end def authorized? @blob.accessible_to?(Current.identity) end end Rails.application.config.to_prepare do ActiveStorage::Blobs::RedirectController.include ActiveStorage::Authorize ActiveStorage::Blobs::ProxyController.include ActiveStorage::Authorize ActiveStorage::Representations::RedirectController.include ActiveStorage::Authorize ActiveStorage::Representations::ProxyController.include ActiveStorage::Authorize end
Interesting, rather clean approach, I think
-
- Oct 2021
-
guides.rubyonrails.org guides.rubyonrails.org
-
You do not configure Zeitwerk manually in a Rails application. Rather, you configure the application using the portable configuration points explained in this guide, and Rails translates that to Zeitwerk on your behalf.
-