Models to deal with Magento shop data of a specific shop instance.
Add this line to your application's Gemfile:
gem 'rawgento_models'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rawgento_models
-
Require this gem in your application.
require 'rawgento_models'
$ bundle install
-
Add the db-specific tasks to your Rakefile.
RawgentoModels.load_tasks
-
Configure your database
adapter: ... host: ... #...
-
Setup your database
rake db:migrate
-
Use Models in your application
require 'rawgento_models'
RawgentoModels.establish_connection
#RawgentoModels.establish_connection("alternative-config-file.yml")
RawgentoModels::LocalProducts.all
include RawgentoModels LocalProducts.all
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. Run bundle exec rawgento_models
to use the gem in this directory, ignoring other installed copies of this gem.
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.
Its easiest to copy an existing migration (from db/migrate), adjust the timestamp in the file name and replace the actual migration code.
According to [](Active Record Migrations) you can also run rake "db:new_migration[CreateUser, name birth:date]"
or rake db:new_migration name=CreateUser options="name birth:date"
, you'll get help from rake db:new_migration
.
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rawgento_models. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.