datts_right 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/datts_right.gemspec +20 -2
- data/lib/datts_right/instance_methods.rb +3 -0
- data/spec/datts_right_spec.rb +11 -0
- metadata +94 -4
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
data/datts_right.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{datts_right}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ramon Tayag"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-18}
|
13
13
|
s.description = %q{Creates a separate table that saves all your dynamic attributes.}
|
14
14
|
s.email = %q{ramon@tayag.net}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -176,6 +176,12 @@ Gem::Specification.new do |s|
|
|
176
176
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
177
177
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
178
178
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
179
|
+
s.add_development_dependency(%q<autotest>, [">= 0"])
|
180
|
+
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
181
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
182
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
183
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
184
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
179
185
|
else
|
180
186
|
s.add_dependency(%q<datts_right>, [">= 0"])
|
181
187
|
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
@@ -300,6 +306,12 @@ Gem::Specification.new do |s|
|
|
300
306
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
301
307
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
302
308
|
s.add_dependency(%q<rcov>, [">= 0"])
|
309
|
+
s.add_dependency(%q<autotest>, [">= 0"])
|
310
|
+
s.add_dependency(%q<sqlite3>, [">= 0"])
|
311
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
312
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
313
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
314
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
303
315
|
end
|
304
316
|
else
|
305
317
|
s.add_dependency(%q<datts_right>, [">= 0"])
|
@@ -425,6 +437,12 @@ Gem::Specification.new do |s|
|
|
425
437
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
426
438
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
427
439
|
s.add_dependency(%q<rcov>, [">= 0"])
|
440
|
+
s.add_dependency(%q<autotest>, [">= 0"])
|
441
|
+
s.add_dependency(%q<sqlite3>, [">= 0"])
|
442
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
443
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
444
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
445
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
428
446
|
end
|
429
447
|
end
|
430
448
|
|
@@ -80,7 +80,9 @@ module DattsRight
|
|
80
80
|
def build_dynamic_attributes
|
81
81
|
@dynamic_attributes_cache ||= {}
|
82
82
|
@dynamic_attributes_cache.each do |k, v|
|
83
|
+
#puts "about to save: #{v.inspect}"
|
83
84
|
v.save
|
85
|
+
#puts "Just to saved: #{v.inspect}"
|
84
86
|
#dynamic_attribute = dynamic_attributes.find_by_attr_key(k.to_s)
|
85
87
|
#value_column = "#{v[:object_type]}_value".to_sym
|
86
88
|
#if dynamic_attribute
|
@@ -95,6 +97,7 @@ module DattsRight
|
|
95
97
|
def cache_dynamic_attributes
|
96
98
|
@dynamic_attributes_cache = {}
|
97
99
|
dynamic_attributes.each do |dynamic_attribute|
|
100
|
+
#puts "Caching: #{dynamic_attribute.inspect}"
|
98
101
|
@dynamic_attributes_cache[dynamic_attribute.attr_key.to_sym] = dynamic_attribute
|
99
102
|
end
|
100
103
|
@dynamic_attributes_cache
|
data/spec/datts_right_spec.rb
CHANGED
@@ -414,4 +414,15 @@ describe DattsRight do
|
|
414
414
|
@page.dynamic_attribute_details(:price).class.should == DynamicAttribute
|
415
415
|
end
|
416
416
|
end
|
417
|
+
|
418
|
+
describe "when loading from database" do
|
419
|
+
it "should load the dynamic attributes for use" do
|
420
|
+
@page.add_dynamic_attribute(:price, "integer")
|
421
|
+
@page.write_dynamic_attribute(:price, 200)
|
422
|
+
@page.save
|
423
|
+
@page = Page.last
|
424
|
+
@page.read_datt(:price).should == 200
|
425
|
+
@page.dynamic_attribute_details(:price).value.should == 200
|
426
|
+
end
|
427
|
+
end
|
417
428
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datts_right
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 10
|
10
|
+
version: 0.0.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ramon Tayag
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-18 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -1864,6 +1864,96 @@ dependencies:
|
|
1864
1864
|
name: rcov
|
1865
1865
|
version_requirements: *id123
|
1866
1866
|
prerelease: false
|
1867
|
+
- !ruby/object:Gem::Dependency
|
1868
|
+
type: :development
|
1869
|
+
requirement: &id124 !ruby/object:Gem::Requirement
|
1870
|
+
none: false
|
1871
|
+
requirements:
|
1872
|
+
- - ">="
|
1873
|
+
- !ruby/object:Gem::Version
|
1874
|
+
hash: 3
|
1875
|
+
segments:
|
1876
|
+
- 0
|
1877
|
+
version: "0"
|
1878
|
+
name: autotest
|
1879
|
+
version_requirements: *id124
|
1880
|
+
prerelease: false
|
1881
|
+
- !ruby/object:Gem::Dependency
|
1882
|
+
type: :development
|
1883
|
+
requirement: &id125 !ruby/object:Gem::Requirement
|
1884
|
+
none: false
|
1885
|
+
requirements:
|
1886
|
+
- - ">="
|
1887
|
+
- !ruby/object:Gem::Version
|
1888
|
+
hash: 3
|
1889
|
+
segments:
|
1890
|
+
- 0
|
1891
|
+
version: "0"
|
1892
|
+
name: sqlite3
|
1893
|
+
version_requirements: *id125
|
1894
|
+
prerelease: false
|
1895
|
+
- !ruby/object:Gem::Dependency
|
1896
|
+
type: :development
|
1897
|
+
requirement: &id126 !ruby/object:Gem::Requirement
|
1898
|
+
none: false
|
1899
|
+
requirements:
|
1900
|
+
- - ~>
|
1901
|
+
- !ruby/object:Gem::Version
|
1902
|
+
hash: 3
|
1903
|
+
segments:
|
1904
|
+
- 2
|
1905
|
+
- 3
|
1906
|
+
- 0
|
1907
|
+
version: 2.3.0
|
1908
|
+
name: rspec
|
1909
|
+
version_requirements: *id126
|
1910
|
+
prerelease: false
|
1911
|
+
- !ruby/object:Gem::Dependency
|
1912
|
+
type: :development
|
1913
|
+
requirement: &id127 !ruby/object:Gem::Requirement
|
1914
|
+
none: false
|
1915
|
+
requirements:
|
1916
|
+
- - ~>
|
1917
|
+
- !ruby/object:Gem::Version
|
1918
|
+
hash: 23
|
1919
|
+
segments:
|
1920
|
+
- 1
|
1921
|
+
- 0
|
1922
|
+
- 0
|
1923
|
+
version: 1.0.0
|
1924
|
+
name: bundler
|
1925
|
+
version_requirements: *id127
|
1926
|
+
prerelease: false
|
1927
|
+
- !ruby/object:Gem::Dependency
|
1928
|
+
type: :development
|
1929
|
+
requirement: &id128 !ruby/object:Gem::Requirement
|
1930
|
+
none: false
|
1931
|
+
requirements:
|
1932
|
+
- - ~>
|
1933
|
+
- !ruby/object:Gem::Version
|
1934
|
+
hash: 7
|
1935
|
+
segments:
|
1936
|
+
- 1
|
1937
|
+
- 5
|
1938
|
+
- 2
|
1939
|
+
version: 1.5.2
|
1940
|
+
name: jeweler
|
1941
|
+
version_requirements: *id128
|
1942
|
+
prerelease: false
|
1943
|
+
- !ruby/object:Gem::Dependency
|
1944
|
+
type: :development
|
1945
|
+
requirement: &id129 !ruby/object:Gem::Requirement
|
1946
|
+
none: false
|
1947
|
+
requirements:
|
1948
|
+
- - ">="
|
1949
|
+
- !ruby/object:Gem::Version
|
1950
|
+
hash: 3
|
1951
|
+
segments:
|
1952
|
+
- 0
|
1953
|
+
version: "0"
|
1954
|
+
name: rcov
|
1955
|
+
version_requirements: *id129
|
1956
|
+
prerelease: false
|
1867
1957
|
description: Creates a separate table that saves all your dynamic attributes.
|
1868
1958
|
email: ramon@tayag.net
|
1869
1959
|
executables: []
|