migration_model 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/migration_model.rb +13 -0
- metadata +62 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
module MigrationModel
|
2
|
+
|
3
|
+
# returns a raw model class with no associations or validations
|
4
|
+
# # or anything like that, so it's safe to use in migrations
|
5
|
+
def migration_model model_class, &block
|
6
|
+
safe_model = Class.new(model_class.superclass){ set_table_name model_class.table_name }
|
7
|
+
safe_model.instance_eval(&block) if block
|
8
|
+
safe_model
|
9
|
+
end
|
10
|
+
|
11
|
+
alias mm migration_model
|
12
|
+
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: migration_model
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- remi
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-04-27 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Rails plugin for safely using models in your Rails migrations
|
22
|
+
email: remi@remitaylor.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- lib/migration_model.rb
|
31
|
+
has_rdoc: true
|
32
|
+
homepage: http://github.com/remi/migration_model
|
33
|
+
licenses: []
|
34
|
+
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options: []
|
37
|
+
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
54
|
+
requirements: []
|
55
|
+
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 1.3.6
|
58
|
+
signing_key:
|
59
|
+
specification_version: 3
|
60
|
+
summary: Rails plugin for safely using models in your Rails migrations
|
61
|
+
test_files: []
|
62
|
+
|