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.
make-private is an ActiveRecord extension that will make all your active record properties private and give you control over what is private and what should be public.
By default active record makes all properties and associations public which does make it faster to develop with but breaks encapsulation by default. make-private has been developed to bring back encapsulation to active record model.
make-private is currently in development
To use make-private private you simply have to include the module in your model, simple.
require 'make-private'
class BusinessModel < ActiveRecord::Base
#a_property: string
include MakePrivate
end
business_model = BusinessModel.new
business_model.a_property # This will throw a NoMethodError exception
Properties can be set as normal from within the model
require 'make-private'
class BusinessModel < ActiveRecord::Base
#a_property: string
include MakePrivate
def do_something_useful parameter
##some logic
self.a_property = parameter
end
end
If you require to make a property publicly readable set the method to public
require 'make-private'
class BusinessModel < ActiveRecord::Base
#a_property: string
include MakePrivate
public :a_property
end
business_model = BusinessModel.new
business_model.a_property # This will no longer throw a NoMethodError exception
business_model.a_property = "something interesting" # This will still throw a NoMethodError exception
Similarly if you really really really need to make the property setter public.
require 'make-private'
class BusinessModel < ActiveRecord::Base
#a_property: string
include MakePrivate
public :a_property, :a_property=
end
business_model = BusinessModel.new
business_model.a_property # This will no longer throw a NoMethodError exception
business_model.a_property = "something interesting" # This will not throw a NoMethodError exception
##Notes
Please send any questions, comments or feedback to pythonandchips{at}gmail.com.
Cheers Colin
FAQs
Unknown package
We found that make-private 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.