Sha256: f25b4b8062123b20744dbf9872742ecb5680ffc5a6cf0796e2279cf8841338fb
Contents?: true
Size: 648 Bytes
Versions: 6
Compression:
Stored size: 648 Bytes
Contents
class ForumsDataset < Dataset::Base uses :forum_sites if defined? Site def load create_forum "Public" create_forum "Private" create_forum "Misc" create_forum "Comments", :for_comments => true end helpers do def create_forum(name, attributes={}) create_model :forum, name.symbolize, attributes.update(:name => name) end def forum_attributes(attributes={}) name = attributes[:name] || "Forum" symbol = name.symbolize attributes = { :name => name, }.merge(attributes) attributes[:site] = sites(:test) if defined? Site attributes end end end
Version data entries
6 entries across 6 versions & 1 rubygems