terrierscript
7/8/2016 - 12:49 PM

Rails5からはもうdefault_value_forは必要ないのかもしれない ref: http://qiita.com/inuscript/items/e98caa8469ed7143404a

Rails5からはもうdefault_value_forは必要ないのかもしれない ref: http://qiita.com/inuscript/items/e98caa8469ed7143404a

class SomeModel < ActiveRecord::Base
  attribute :some_flag, :boolean, default: -> { false }
end
class SomeModel < ActiveRecord::Base
  default_value_for :is_public, false
end