Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
decent_decoration allows you to use excellent decent_exposure 3.0 gem with decorators.
Add this line to your application's Gemfile:
gem 'decent_decoration', '~> 0.1.0'
And then execute:
$ bundle
# app/controllers/conferences_controller.rb
# with decent_exposure
class ConferencesController < ApplicationController
expose(:conference) { ConferenceDecorator.new(build_conference) }
private
def build_conference
# create new conference or fetch existing one
end
end
# with decent_decoration
class ConferencesController < ApplicationController
expose_decorated(:conference)
end
decent_decoration makes decorated objects accessible in views. They remain undecorated in your controllers.
Define a decorator explicitly:
# app/controllers/conferences_controller.rb
class ConferencesController < ApplicationController
expose_decorated(:conference, decorator: SponsoredConferenceDecorator)
end
decent_decoration detect automatically if you want to decorate a collection. To circumvent this pass collection: true/false
# app/controllers/conferences_controller.rb
class ConferencesController < ApplicationController
expose_decorated(:conferences, collection: false)
end
decent_decoration supports most of the awesome decent_exposure api. Read more about it!
# app/controllers/attendees_controller.rb
class AttendeesController < ApplicationController
expose_decorated(:conference)
expose_decorated(:attendees, scope: :conference)
end
You can use any decorator mechanism as long as ConferenceDecorator
responds to #decorate
or #new
. Try draper.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Copyright © 2012–2014 netguru. See LICENSE for further details.
FAQs
Unknown package
We found that decent_decoration demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.