citrusbyte-schemer 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -13,7 +13,7 @@ care about keeping the data or how it's defined.
13
13
 
14
14
  **WARNING:** This will create and delete data definitions on the fly with no
15
15
  warning! Only use this with volatile data! Never attach it to an existing model
16
- you care about as it will start adding and dropping columns without your
16
+ you care about as it will start adding and dropping columns without your
17
17
  consent!
18
18
 
19
19
  Usage
@@ -24,7 +24,7 @@ Usage
24
24
  end
25
25
 
26
26
  Creates a `users` table if it doesn't exist, complete with `username` and
27
- `password` columns the first time you call `User.new`.
27
+ `password` columns the first time the User class is loaded.
28
28
 
29
29
  Need another column to play with?
30
30
 
@@ -32,33 +32,30 @@ Need another column to play with?
32
32
  schema :username, :password, :email
33
33
  end
34
34
 
35
- Adds an `email` column the next time `User.new` is called.
35
+ Adds an `email` column the next time `User` class is loaded.
36
36
 
37
- Don't want a column anymore?
37
+ Want a relationship? (but fear commitment...)
38
38
 
39
- class User < ActiveRecord::Base
40
- schema :password, :email
39
+ class Widget < ActiveRecord::Base
40
+ schema :user_id, :name
41
+
42
+ belongs_to :user
41
43
  end
42
-
43
- Removes the `username` column the next time `User.new` is called.
44
44
 
45
- Want a relationship?
45
+ Works just fine, and you can drop it at any time!
46
46
 
47
47
  class Widget < ActiveRecord::Base
48
- schema :user_id
49
-
50
- belongs_to :user
48
+ schema :name
51
49
  end
52
-
53
- Works just fine!
50
+
51
+ Removes the `user_id` column the next time the `Widget` class is loaded.
54
52
 
55
53
  **NOTE:** All columns are created as string columns.
56
54
 
57
55
  Installation
58
56
  ------------
59
57
 
60
- $ gem sources -a http://gems.github.com (you only have to do this once)
61
- $ sudo gem install citrusbyte-schemer
58
+ $ sudo gem install citrusbyte-schemer --source=http://gems.github.com
62
59
 
63
60
  License
64
61
  -------
data/rails/init.rb CHANGED
@@ -1,2 +1,3 @@
1
- raise "We highly suggest you only use Schemer in development mode!" unless Rails.env.to_s == 'development'
1
+ raise "We highly suggest you only use Schemer in development or test mode (not in #{Rails.env})!" unless %w( development test ).include?(Rails.env.to_s)
2
+ Rails.logger.warn "Loading Schemer which will consider all your data volatile!"
2
3
  require 'schemer'
data/test/schemer_test.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'contest'
3
+ require 'override'
3
4
  require File.join(File.dirname(__FILE__), '..', 'lib', 'schemer')
4
5
 
5
6
  ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => 'test/schemer_test.db'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citrusbyte-schemer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Alavi