2013-10-06から1日間の記事一覧
railsl4createアクションでもnewしているのでnilの場合だけ設定してる。 class Item < ActiveRecord::Base def initialize(*args, &block) super self.start_on = DateTime.now.to_date if self.start_on.nil? self.end_on = DateTime.now.to_date + 1.week …
railsl4createアクションでもnewしているのでnilの場合だけ設定してる。 class Item < ActiveRecord::Base def initialize(*args, &block) super self.start_on = DateTime.now.to_date if self.start_on.nil? self.end_on = DateTime.now.to_date + 1.week …