diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..0fa5426 --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Global Impact + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 1bf7dcc..d31ceb8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Surveyable -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/surveyable`. To experiment with that code, run `bin/console` for an interactive prompt. - -TODO: Delete this and the text above, and describe your gem +Simple gem to deal with attaching 'surveys' to existing models. This involves question and answer types defined here. ## Installation @@ -22,15 +20,38 @@ Or install it yourself as: ## Usage -TODO: Write usage instructions here - -## Development - -After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. - -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). - +Run migrations (to be included as files soon) + +### Migrations + + create_table :questions do |t| + t.integer :survey_id + t.string :survey_type + t.text :text + t.string :type + t.boolean :required + end + create_table :answers do |t| + t.integer :question_id + t.integer :response_id + t.string :response_type + t.text :text + t.integer :answer_choice_id + t.index [:response_id,:response_type] + end + create_table :answer_choices do |t| + t.integer :question_id + t.text :text + t.index :question_id + end + +### Attach to models +Put 'acts_as_survey' in your survey class (the model that needs custom questions). +Put 'acts_as_response' in your response class (the model that your answers will attach to). ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/surveyable. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct. +Bug reports and pull requests are welcome on GitHub at https://github.com/globalimpact/surveyable. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct. + +##License +MIT License. Copyright 2015 Global Impact. https://charity.org \ No newline at end of file -- libgit2 0.21.0