Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error: uninitialized constant CreateConsents::Consent
- class CreateConsents < ActiveRecord::Migration
- def self.up
- create_table :consents do |t|
- t.integer :role_id, :user_id, :null => false
- t.timestamps
- end
- Role.create(:rolename => 'moderator')
- user = User.new
- user.student_no = "1274515412"
- user.username = "admin"
- user.password = "Testing12"
- user.password_confirmation = "Testing12"
- user.first_name = "Tim"
- user.last_name = "West"
- #user.grad_year = "10/02/2005"
- user.dob = "01/08/1968"
- user.email = "tim@aston.ac.uk"
- user.phone = "11545784145"
- user.photo = "image"
- #user.program = "MSc Internet Tech"
- #user.course_status = "entrolled"
- user.profession = "system admin"
- user.street = "Aston Triangle"
- user.city = "Birmingham"
- user.country = "United Kingdom"
- user.county = "west mids"
- user.post_code = "13342"
- #user.registered = "No"
- role = Role.find_by_rolename('moderator')
- user = User.find_by_username('admin')
- consent = Consent.new
- consent.role = role
- consent.user = user
- consent.save(false)
- end
- def self.down
- drop_table :consents
- Role.find_by_rolename('moderator').destroy
- User.find_by_username('admin').destroy
- end
- end
Add Comment
Please, Sign In to add comment