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.
mongoid_extended_dirty_trackable
Advanced tools
A Mongoid Extension that gives you the ability to track changes to embedded and related documents through a parent.
It was born from a need in a production app I work on from which it was extracted. If you'd like a pretty detailed run down of what exactly the code is doing you can find it on my blog.
I don't consider this Gem production ready. Mostly because I ran into some issues when writing the specs after Gemifying the original Concern. None of these problems exist in my production app so I'm lead to believe they are the result of the hack job I did setting up and tearing down mongo for the tests. I plan on working these issues out in the near future and if you'd like to know more check out my blog post that covers them.
Add this line to your application's Gemfile:
gem 'mongoid_extended_dirty_trackable'
And then execute:
$ bundle
Or install it yourself with:
$ gem install mongoid_extended_dirty_trackable
I tried to make the specs work as documentation but for those of you averse to reading them I'll make it easy for you.
class Account
include Mongoid::Document
include Mongoid::ExtendedDirtyTrackable
field :name
embeds_one :address
embeds_many :invoices
has_many :offices
end
account = Account.create(name: "Prestige Worldwide")
account.name = "Umbrella Corp"
account.changed? #=> true
account.changes["name"] #=> ["Prestige Worldwide", "Umbrella Corp"]
account.create_address(zipcode: "90210")
account.address.zipcode = "1000 AS"
account.changed? #=> true
account.changes["zipcode"] #=> ["90210", "1000 AS"]
account.invoices.create(total: 420.00)
account.invoices.first.total = 69.69
account.changed? #=> true
account.changes["total"] #=> [420.00, 69.69]
office = account.offices.create(number: 666)
office.number = 5446
account.changed? #=> true
account.changes["number"] #=> [666, 5446]
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
All pull requests are met with open arms and gratitude.
Check the TODO file or the Github Issue tracker for suggestions on where to begin.
Please be sure your pull request includes descriptive commit messages and tests that cover your feature, change, or bug.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)versative/mongoid_relations_dirty_tracking - This is a little more full featured and much more in the direction I plan on taking but I feel like it can be done in a more simple manner with less code.
millisami/gist:721466 - The code in this Gist no longer works or maybe it never did but it served as the inspiration for my Gem. Thanks millisami!
FAQs
Unknown package
We found that mongoid_extended_dirty_trackable 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.