• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

activeadmin / activeadmin / 5000 / 4
79%
master: 79%

Build:
DEFAULT BRANCH: master
Ran 21 Aug 2016 01:44AM UTC
Files 135
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Aug 2016 01:37AM UTC coverage: 81.176% (-0.1%) from 81.278%
2.3.0, RAILS=4.2.5

Pull #4591

travis-ci

web-flow
Make the has_many allow_destroy option smart

When I generate nested has_many forms, I might whant to set the `allow_destroy` parameter
depending on the child record.

For example: I want to not allow delete comments, that was created by an admin,
or I want to not allow delete articles that are published.

I added the ability to specify Symbol and Proc as `allow_destroy` parameter.

If a Symbol is specified, the child object's method will be called.

    # this will create 'delete' checkbox only for articles which #draft? method returns true
    f.has_many :articles, allow_destroy: :draft? do |a|

If a Proc is specified, the given blok will be calculated  for the child object.
The object is passed as the parameter of the block.

    f.has_many :comments, allow_destroy:  -> (comment) { !comment.author.admin? } do |c|
Pull Request #4591: Add the ability to specify Symbol and Proc as `allow_destroy` parameter of `f.has_many`

3066 of 3777 relevant lines covered (81.18%)

10.05 hits per line

Source Files on job 5000.4 (2.3.0, RAILS=4.2.5)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5000
  • Travis Job 5000.4
  • 4ef7b24e on github
  • Prev Job for 2.3.0, RAILS=4.2.5 on master (#4987.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc