add rough user attributes API
This commit is contained in:
1 parent
29ee4585b2
commit
a40b117fbe
6 files changed
+32
-11
No files matched your search
+6
-3
@@ -2,11 +2,14 @@ namespace :dev do
|
||||
|
||||
task :build => :environment do
|
||||
User.delete_all
|
||||
UserAttribute.delete_all
|
||||
|
||||
User.create!( :email => 'ihower@rulingcom.com', :password => 'password', :password_confirmation => 'password', :use_attributes => ["teacher"] )
|
||||
|
||||
UserAttribute.create!( :ident => "teacher", :name => "Teacher", :attrs => [ "name" => { :type => 'text_field', :width => 100 },
|
||||
"title" => { :type => 'text_field', :width => 100 } ] )
|
||||
|
||||
UserAttribute.create!( :key => "teacher", :name => "Teacher", :attrs => [ { :name => "Name", :key => "name", :type => "text_field" }, { :name => "Title", :key => "title", :type => 'text_field' } ] )
|
||||
|
||||
UserAttribute.create!( :key => "staff", :name => "Staff", :attrs => [ { :name => "Name", :key => "name", :type => "text_field" }, { :name => "Duty", :key => "duty", :type => 'text_field' } ] )
|
||||
|
||||
[Announcement, Item, Snippet, Layout].each { |m| m.delete_all }
|
||||
Layout.create!( :name => 'root', :description => 'root', :content_zh_tw => File.open("#{RAILS_ROOT}/lib/template/root.layout.zh_tw").read,
|
||||
:content_en => File.open("#{RAILS_ROOT}/lib/template/root.layout.en").read)
|
||||
|
||||
Reference in new issue
Block a user