Skip to content

t-ichii/tester_ar_am

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tester Of ActiveRecord/ActiveModel

This is tester for ActiveRecord/ActiveModel without Rails.

License

MIT

Get Started

gem install bundler
bundle install --path=vendor/bundle
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec pry

Tester Example

parent = Parent.create!(body: '')
child = parent.children.create!(body: '')
grandchild = child.grandchildren.create!(body: '')

parent.reload
parent.children.first.mark_for_destruction
parent.save # child and grandchildren is not delete.

parent_id = parent.id
parent = Parent.includes(:chidren).find(parent_id)
parent.children.first.mark_for_destruction
parent.save # child and grandchildren is delete. Wow!

About

Tester of ActiveRecord/ActiveModel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages