has_friendly_name 0.2.0 → 0.2.2
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.md +1 -1
- data/init.rb +1 -0
- data/lib/active_record_extensions.rb +24 -0
- metadata +4 -3
data/README.md
CHANGED
@@ -37,5 +37,5 @@ add the following to your config/enviroment.rb
|
|
37
37
|
|
38
38
|
the second record with the same name gets the same because unique is false
|
39
39
|
|
40
|
-
Copyright (c) 2010 Dennis Meise
|
40
|
+
Copyright (c) 2010 Dennis Meise , released under the MIT license
|
41
41
|
|
data/init.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module ConnectionAdapters
|
3
|
+
|
4
|
+
class TableDefinition
|
5
|
+
|
6
|
+
#erstellt ein friendly_name und name feld
|
7
|
+
def name
|
8
|
+
column(:name, :string)
|
9
|
+
column(:friendly_name, :string)
|
10
|
+
end
|
11
|
+
|
12
|
+
def default_text
|
13
|
+
column(:text, :text)
|
14
|
+
end
|
15
|
+
|
16
|
+
#erstellt ein feld vom typ integer mit name+_count und default 0
|
17
|
+
def count(name)
|
18
|
+
column("#{name.to_s}_count", :integer, :default => 0)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_friendly_name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Meise
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description:
|
17
|
-
email:
|
17
|
+
email: gems@dennis-meise.de
|
18
18
|
executables: []
|
19
19
|
|
20
20
|
extensions: []
|
@@ -27,9 +27,10 @@ files:
|
|
27
27
|
- README.md
|
28
28
|
- lib/has_friendly_name.rb
|
29
29
|
- lib/string_extensions.rb
|
30
|
+
- lib/active_record_extensions.rb
|
30
31
|
- rails/init.rb
|
31
32
|
has_rdoc: true
|
32
|
-
homepage: http://www.
|
33
|
+
homepage: http://www.dennis-meise.de
|
33
34
|
licenses: []
|
34
35
|
|
35
36
|
post_install_message:
|