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

activeadmin / activeadmin / 5000
79%

Build:
DEFAULT BRANCH: master
Ran 21 Aug 2016 01:44AM UTC
Jobs 3
Files 135
Run time 1min
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

pending completion
5000

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`

3 of 3 new or added lines in 1 file covered. (100.0%)

3073 of 3777 relevant lines covered (81.36%)

29.94 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
100.0
lib/active_admin/form_builder.rb

Uncovered Existing Lines

Lines Coverage ∆ File
32
100.0
lib/active_admin/form_builder.rb
Jobs
ID Job ID Ran Files Coverage
3 5000.3 (2.3.0, RAILS=3.2.22) 21 Aug 2016 01:45AM UTC 0
81.07
Travis Job 5000.3
4 5000.4 (2.3.0, RAILS=4.2.5) 21 Aug 2016 01:44AM UTC 0
81.18
Travis Job 5000.4
5 5000.5 (2.3.0, RAILS=5.0.0) 21 Aug 2016 01:44AM UTC 0
81.18
Travis Job 5000.5
Source Files on build 5000
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5000
  • Pull Request #4591
  • PR Base - master (#4987)
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