
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Master repository has moved to gitlab, all new code will be there:
https://gitlab.com/rocket-science/rails_admin_state
Allows easily sending state_machine events to a model from Rails Admin, including support for ActiveRecord \ Mongoid and custom state field name and multiple state machines per model.
Add this line to your application's Gemfile:
gem 'rails_admin_state'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rails_admin_state
Add the state action:
RailsAdmin.config do |config|
config.actions do
......
state
end
end
Mark the field you need display as state:
rails_admin do
list do
field :state, :state
...
end
edit do
field :state, :state
...
end
...
end
rails_admin do
list do
field :state, :state
...
end
...
state({
events: {dead: 'btn-danger', drain: 'btn-warning', alive: 'btn-success'},
states: {dead: 'label-important', drain: 'label-warning', alive: 'label-success'}
disable: [:dead] # disable some events so they are not shown.
})
end
Some classes are preset by default (published, deleted, etc)
cannot :manage, Recipes::Recipe
can :read, Recipes::Recipe
can :state, Recipes::Recipe # required to do any transitions
can :all_events, Recipes::Recipe
Just as usual for state_machine, see:
http://rdoc.info/github/pluginaweek/state_machine/master/StateMachine/Integrations/Mongoid
http://rdoc.info/github/pluginaweek/state_machine/master/StateMachine/Integrations/ActiveRecord
For namespaced models use "/", just as usual: "Blog::Post" is "blog/post"
State name set this way is also used in .human_state_name, error messages, etc
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that rails_admin_state 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.