lib/transit/package/page.rb in transit-0.0.1 vs lib/transit/package/page.rb in transit-0.0.2
- old
+ new
@@ -1,18 +1,26 @@
-module Transit
- module Package
+module Transit::Package
+ module Page
- module Page
- extend ActiveSupport::Concern
+ extend ActiveSupport::Concern
+
+ included do
+ class_attribute :delivery_template, instance_writer: false
+ self.delivery_template = :page
- included do
- field :name, :type => String
- field :url, :type => String
- field :keywords, :type => Array
- field :description, :type => String
-
- scope :published, where(:published => true)
- end
+ include Transit::Model::Base
+
+ field :name, :type => String
+ field :url, :type => String
+ field :keywords, :type => Array
+ field :description, :type => String
+
+ embeds_many :contexts, :as => :package, :class_name => 'Transit::Context'
end
+ def timestamp
+ return "" if self.post_date.nil?
+ self.post_date.strftime("%B %d, %Y")
+ end
+
end
end
\ No newline at end of file