assignable_values 0.9.0 supports virtual attributes

Posted . Visible to the public.

Now you can say:

class Song < ActiveRecord::Base

  attr_accessor :virtual_attribute
  
  assignable_values_for :virtual_attribute do
    %w[air fluff]
  end

end
Profile picture of Martin Straub
Martin Straub
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Martin Straub to makandra dev (2014-04-17 10:11)