inactive_record 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/History.txt +5 -0
- data/VERSION +1 -1
- data/inactive_record.gemspec +5 -4
- data/lib/inactive_record.rb +1 -1
- data/lib/inactive_record/base.rb +1 -16
- metadata +28 -13
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/*
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
data/inactive_record.gemspec
CHANGED
@@ -5,18 +5,19 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{inactive_record}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["C. Jason Harrelson (midas)"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-07-19}
|
13
13
|
s.description = %q{InactiveRecord gives you many of the features you know and love from ActiveRecord without the need for a backing database table.}
|
14
14
|
s.email = %q{jason@lookforwardenterprises.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"README.rdoc"
|
17
17
|
]
|
18
18
|
s.files = [
|
19
|
-
"
|
19
|
+
".gitignore",
|
20
|
+
"History.txt",
|
20
21
|
"README.rdoc",
|
21
22
|
"Rakefile",
|
22
23
|
"VERSION",
|
@@ -35,7 +36,7 @@ Gem::Specification.new do |s|
|
|
35
36
|
s.homepage = %q{http://github.com/midas/inactive_record}
|
36
37
|
s.rdoc_options = ["--charset=UTF-8"]
|
37
38
|
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = %q{1.3.
|
39
|
+
s.rubygems_version = %q{1.3.6}
|
39
40
|
s.summary = %q{InactiveRecord gives you many of the features you know and love from ActiveRecord without the need for a backing database table.}
|
40
41
|
s.test_files = [
|
41
42
|
"spec/inactive_record/base_spec.rb",
|
data/lib/inactive_record.rb
CHANGED
data/lib/inactive_record/base.rb
CHANGED
@@ -140,26 +140,11 @@ module InactiveRecord
|
|
140
140
|
def self.human_name( options={} )
|
141
141
|
Base.human_attribute_name(@name)
|
142
142
|
end
|
143
|
-
|
144
|
-
# Allows alternate humanized versions of attributes to be set. For example, an attribute such as 'num_employees' would be
|
145
|
-
# converted to 'Num employees' normally using <tt>human_attribute_name</tt>. More descriptive text can be set. Example:
|
146
|
-
# attr_human_name 'num_employees' => 'Number of employees'
|
147
|
-
def self.attr_human_name(attributes) # :nodoc:
|
148
|
-
attributes.stringify_keys!
|
149
|
-
write_inheritable_hash("attr_human_name", attributes || {})
|
150
|
-
|
151
|
-
# assign the current class to each column that is being assigned a new human attribute name
|
152
|
-
#self.columns.reject{|c| !attributes.has_key?(c.name)}.each{|c| c.parent_record_class = self}
|
153
|
-
end
|
154
|
-
|
155
|
-
def self.human_name_attributes # :nodoc:
|
156
|
-
read_inheritable_attribute("attr_human_name")
|
157
|
-
end
|
158
143
|
|
159
144
|
# Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example:
|
160
145
|
# Person.human_attribute_name("first_name") # => "First name"
|
161
146
|
def self.human_attribute_name(attribute_key_name) #:nodoc:
|
162
|
-
(
|
147
|
+
I18n.translate( "inactive_record.attributes.#{self.name.underscore.gsub( /\//, '.' )}.#{attribute_key_name.to_s}")
|
163
148
|
end
|
164
149
|
|
165
150
|
protected
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inactive_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
version: 1.0.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- C. Jason Harrelson (midas)
|
@@ -9,29 +14,36 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-07-19 00:00:00 -05:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: activerecord
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 2
|
23
30
|
version: "2.2"
|
24
|
-
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
25
33
|
- !ruby/object:Gem::Dependency
|
26
34
|
name: rspec
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
37
|
requirements:
|
31
38
|
- - ">="
|
32
39
|
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 1
|
42
|
+
- 2
|
43
|
+
- 9
|
33
44
|
version: 1.2.9
|
34
|
-
|
45
|
+
type: :development
|
46
|
+
version_requirements: *id002
|
35
47
|
description: InactiveRecord gives you many of the features you know and love from ActiveRecord without the need for a backing database table.
|
36
48
|
email: jason@lookforwardenterprises.com
|
37
49
|
executables: []
|
@@ -41,6 +53,7 @@ extensions: []
|
|
41
53
|
extra_rdoc_files:
|
42
54
|
- README.rdoc
|
43
55
|
files:
|
56
|
+
- .gitignore
|
44
57
|
- History.txt
|
45
58
|
- README.rdoc
|
46
59
|
- Rakefile
|
@@ -69,18 +82,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
82
|
requirements:
|
70
83
|
- - ">="
|
71
84
|
- !ruby/object:Gem::Version
|
85
|
+
segments:
|
86
|
+
- 0
|
72
87
|
version: "0"
|
73
|
-
version:
|
74
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
89
|
requirements:
|
76
90
|
- - ">="
|
77
91
|
- !ruby/object:Gem::Version
|
92
|
+
segments:
|
93
|
+
- 0
|
78
94
|
version: "0"
|
79
|
-
version:
|
80
95
|
requirements: []
|
81
96
|
|
82
97
|
rubyforge_project:
|
83
|
-
rubygems_version: 1.3.
|
98
|
+
rubygems_version: 1.3.6
|
84
99
|
signing_key:
|
85
100
|
specification_version: 3
|
86
101
|
summary: InactiveRecord gives you many of the features you know and love from ActiveRecord without the need for a backing database table.
|