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.
Activity stream in rails 3.0 applications
Based on http://activitystrea.ms/spec/1.0/atom-activity-01.html
Just run the following command :
gem install activist
Then in your Gemfile add the following line :
gem 'activist'
And run
bundle install
First generate a status model :
rails generate activist:install
This command creates a new model called ActivistStatus in 'app/models' :
class ActivistStatus < ActiveRecord::Base
serialize :data, Hash
end
It also creates a new migration for the ActivistStatus model so don't forget to migrate your database :
rake db:migrate
Then add activist in your user model :
class User < ActiveRecord::Base
include Activist::Actor
stream :public do
all
end
stream :private do
[user]
end
end
And finally create some activities :
class Post < ActiveRecord::Base
include Activist::Action
belongs_to :user
activities :public, :on => :after_create
activities :private, :actor => :user, :action => :posted, :on => :after_create
activities :public, :on => :after_update, :data => proc { |post| post.changes }
after_destroy
activity :private, :action => :deleted
end
def promote
self.title = "[PROMOTED] #{self.title}"
activity :private, :action => :promoted, :data => proc { |post| { :title => post.title } }
end
end
FAQs
Unknown package
We found that activist 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.