amoeba 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/amoeba.gemspec +3 -5
- data/lib/amoeba/version.rb +1 -1
- metadata +38 -11
- data/logo.jpg +0 -0
data/README.md
CHANGED
@@ -401,7 +401,7 @@ Using the `has_one :through` association is simple, just be sure to enable amoeb
|
|
401
401
|
|
402
402
|
### Has Many Through
|
403
403
|
|
404
|
-
Copying `has_many :through` associations
|
404
|
+
Copying of `has_many :through` associations works automatically. They perform the copy in the same way as the `has_and_belongs_to_many` association, meaning the actual child records are not copied, but rather the associations are simply maintained. You can add some field preprocessors to the middle model if you like but this is not strictly necessary:
|
405
405
|
|
406
406
|
class Assembly < ActiveRecord::Base
|
407
407
|
has_many :manifests
|
@@ -492,11 +492,11 @@ Prefix a field with some text. This only works for string fields. Accepts a hash
|
|
492
492
|
|
493
493
|
`append`
|
494
494
|
|
495
|
-
Append some text to a field. This only works for string fields. Accepts a hash of fields to prepend. The keys are the field names and the values are the prefix strings. An example would be to add " (copied version)" to your description field. Don't forget to add a leading space if you want it. Passing a hash will add each key value pair to the list of
|
495
|
+
Append some text to a field. This only works for string fields. Accepts a hash of fields to prepend. The keys are the field names and the values are the prefix strings. An example would be to add " (copied version)" to your description field. Don't forget to add a leading space if you want it. Passing a hash will add each key value pair to the list of append directives. If you wish to empty the list of directives, you may pass the hash inside of an array like this `[{:contents => " (copied version)"}]`.
|
496
496
|
|
497
497
|
`regex`
|
498
498
|
|
499
|
-
Globally search and replace the field for a given pattern. Accepts a hash of fields to run search and replace upon. The keys are the field names and the values are each a hash with information about what to find and what to replace it with. in the form of . An example would be to replace all occurrences of the word "dog" with the word "cat", the parameter hash would look like this `:contents => {:replace => /dog/, :with => "cat"}`. Passing a hash will add each key value pair to the list of
|
499
|
+
Globally search and replace the field for a given pattern. Accepts a hash of fields to run search and replace upon. The keys are the field names and the values are each a hash with information about what to find and what to replace it with. in the form of . An example would be to replace all occurrences of the word "dog" with the word "cat", the parameter hash would look like this `:contents => {:replace => /dog/, :with => "cat"}`. Passing a hash will add each key value pair to the list of regex directives. If you wish to empty the list of directives, you may pass the hash inside of an array like this `[{:contents => {:replace => /dog/, :with => "cat"}]`.
|
500
500
|
|
501
501
|
## Known Limitations and Issues
|
502
502
|
|
data/amoeba.gemspec
CHANGED
@@ -12,12 +12,10 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{Easy copying of rails models and their child associations.}
|
13
13
|
|
14
14
|
s.description = <<-EOF
|
15
|
-
|
15
|
+
An extension to ActiveRecord to allow the duplication method to also copy associated children, with recursive support for nested of grandchildren. The behavior is controllable with a simple DSL both on your rails models and on the fly, i.e. per instance. Numerous configuration styles and preprocessing directives are included for power and flexibility. Supports preprocessing of field values to prepend strings such as "Copy of ", to nullify or process field values with regular expressions. Supports most association types including has_one :through and has_many :through.
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
s.description = %q{}
|
17
|
+
Tags: copy child associations, copy nested children, copy associated child records, nested copy, copy associations, copy relations, copy relationships, duplicate associations, duplicate associated records, duplicate child records, duplicate children, copy all, duplicate all, clone child associations, clone nested children, clone associated child records, nested clone, clone associations, clone relations, clone relationships, cloning child associations, cloning nested children, cloning associated child records, deep_cloning, nested cloning, cloning associations, cloning relations, cloning relationships, cloning child associations, cloning nested children, cloning associated child records, nested cloning, cloning associations, cloning relations, cloning relationships, cloning child associations, cloning nested children, cloning associated child records, deep_cloning, nested cloning, cloning associations, cloning relations, cloning relationships, duplicate child associations, duplicate nested children, duplicate associated child records, nested duplicate, duplicate associations, duplicate relations, duplicate relationships, duplicate child associations, duplicate nested children, duplicate associated child records, deep_duplicate, nested duplicate, duplicate associations, duplicate relations, duplicate relationships, deep_copy, deep_clone, deep_cloning, deep clone, deep cloning, has_one, has_many, has_and_belongs_to_many
|
18
|
+
EOF
|
21
19
|
|
22
20
|
s.rubyforge_project = "amoeba"
|
23
21
|
|
data/lib/amoeba/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amoeba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-28 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &8925540 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *8925540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &8925000 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.3'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *8925000
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sqlite3-ruby
|
38
|
-
requirement: &
|
38
|
+
requirement: &8924600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *8924600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activerecord
|
49
|
-
requirement: &
|
49
|
+
requirement: &8923940 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,8 +54,36 @@ dependencies:
|
|
54
54
|
version: '3.0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
58
|
-
description: '
|
57
|
+
version_requirements: *8923940
|
58
|
+
description: ! 'An extension to ActiveRecord to allow the duplication method to also
|
59
|
+
copy associated children, with recursive support for nested of grandchildren. The
|
60
|
+
behavior is controllable with a simple DSL both on your rails models and on the
|
61
|
+
fly, i.e. per instance. Numerous configuration styles and preprocessing directives
|
62
|
+
are included for power and flexibility. Supports preprocessing of field values to
|
63
|
+
prepend strings such as "Copy of ", to nullify or process field values with regular
|
64
|
+
expressions. Supports most association types including has_one :through and has_many
|
65
|
+
:through.
|
66
|
+
|
67
|
+
|
68
|
+
Tags: copy child associations, copy nested children, copy associated child records,
|
69
|
+
nested copy, copy associations, copy relations, copy relationships, duplicate associations,
|
70
|
+
duplicate associated records, duplicate child records, duplicate children, copy
|
71
|
+
all, duplicate all, clone child associations, clone nested children, clone associated
|
72
|
+
child records, nested clone, clone associations, clone relations, clone relationships,
|
73
|
+
cloning child associations, cloning nested children, cloning associated child records,
|
74
|
+
deep_cloning, nested cloning, cloning associations, cloning relations, cloning relationships,
|
75
|
+
cloning child associations, cloning nested children, cloning associated child records,
|
76
|
+
nested cloning, cloning associations, cloning relations, cloning relationships,
|
77
|
+
cloning child associations, cloning nested children, cloning associated child records,
|
78
|
+
deep_cloning, nested cloning, cloning associations, cloning relations, cloning relationships,
|
79
|
+
duplicate child associations, duplicate nested children, duplicate associated child
|
80
|
+
records, nested duplicate, duplicate associations, duplicate relations, duplicate
|
81
|
+
relationships, duplicate child associations, duplicate nested children, duplicate
|
82
|
+
associated child records, deep_duplicate, nested duplicate, duplicate associations,
|
83
|
+
duplicate relations, duplicate relationships, deep_copy, deep_clone, deep_cloning,
|
84
|
+
deep clone, deep cloning, has_one, has_many, has_and_belongs_to_many
|
85
|
+
|
86
|
+
'
|
59
87
|
email: vaughn@rocksolidwebdesign.com
|
60
88
|
executables: []
|
61
89
|
extensions: []
|
@@ -69,7 +97,6 @@ files:
|
|
69
97
|
- amoeba.gemspec
|
70
98
|
- lib/amoeba.rb
|
71
99
|
- lib/amoeba/version.rb
|
72
|
-
- logo.jpg
|
73
100
|
- spec/lib/amoeba_spec.rb
|
74
101
|
- spec/spec_helper.rb
|
75
102
|
- spec/support/data.rb
|
data/logo.jpg
DELETED
Binary file
|