Sha256: 602057ab841849fd0f27012e30a85f99c144b6c8d5ed176a94c75926589771dc

Contents?: true

Size: 279 Bytes

Versions: 3

Compression:

Stored size: 279 Bytes

Contents

module RailsVoter
  class Election < ActiveRecord::Base
    has_many :election_details

    accepts_nested_attributes_for(
      :election_details,
      reject_if: proc { |bfd| bfd["name"].blank? },
      allow_destroy: true
    )

    validates :name, presence: true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_voter-0.2.1 app/models/rails_voter/election.rb
rails_voter-0.2.0 app/models/rails_voter/election.rb
rails_voter-0.1.0 app/models/rails_voter/election.rb