active-fedora 4.6.0.rc1 → 4.6.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.rubygems_version = %q{1.3.7}
17
17
 
18
18
  s.add_dependency('rsolr')
19
- s.add_dependency('om', '~> 1.6.0')
19
+ s.add_dependency('om', '~> 1.7.0.rc1')
20
20
  s.add_dependency('solrizer', '~>1.2.0')
21
21
  s.add_dependency("activeresource", '>= 3.0.0')
22
22
  s.add_dependency("activesupport", '>= 3.0.0')
@@ -24,7 +24,7 @@ module ActiveFedora
24
24
  # name
25
25
  #
26
26
  #
27
- # 'datatype' is a datatype, currently :string, :text and :date are supported.
27
+ # 'datatype' is a datatype, currently :string, :integer and :date are supported.
28
28
  #
29
29
  # opts is an options hash, which will affect the generation of the xml representation of this datastream.
30
30
  #
@@ -49,7 +49,7 @@ module ActiveFedora
49
49
  self.class.class_fields << name.to_s
50
50
  # add term to terminology
51
51
  unless self.class.terminology.has_term?(name.to_sym)
52
- term = OM::XML::Term.new(name.to_sym, {}, self.class.terminology)
52
+ term = OM::XML::Term.new(name.to_sym, {:type=>datatype}, self.class.terminology)
53
53
  self.class.terminology.add_term(term)
54
54
  term.generate_xpath_queries!
55
55
  end
@@ -81,7 +81,7 @@ module ActiveFedora
81
81
  if things
82
82
  field_symbol = ActiveFedora::SolrService.solr_name(field_key, field_info[:type])
83
83
  things.val.each do |val|
84
- ::Solrizer::Extractor.insert_solr_field_value(solr_doc, field_symbol, val )
84
+ ::Solrizer::Extractor.insert_solr_field_value(solr_doc, field_symbol, val.to_s )
85
85
  end
86
86
  end
87
87
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "4.6.0.rc1"
2
+ VERSION = "4.6.0.rc2"
3
3
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe ActiveFedora::SimpleDatastream do
4
4
 
5
5
  before do
6
- @sample_xml = "<fields><coverage>coverage1</coverage><coverage>coverage2</coverage><creation_date>fake-date</creation_date><mydate>fake-date</mydate><publisher>publisher1</publisher></fields>"
6
+ @sample_xml = "<fields><coverage>coverage1</coverage><coverage>coverage2</coverage><creation_date>2012-01-15</creation_date><mydate>fake-date</mydate><publisher>publisher1</publisher></fields>"
7
7
  @test_ds = ActiveFedora::SimpleDatastream.from_xml(@sample_xml )
8
8
  @test_ds.field :coverage
9
9
  @test_ds.field :creation_date, :date
@@ -19,13 +19,19 @@ describe ActiveFedora::SimpleDatastream do
19
19
  describe '#new' do
20
20
  describe "model methods" do
21
21
 
22
- [:coverage, :creation_date, :mydate, :publisher].each do |el|
23
- it "should respond to getters and setters for #{el} element" do
22
+ [:coverage, :mydate, :publisher].each do |el|
23
+ it "should respond to getters and setters for the string typed #{el} element" do
24
24
  value = "Hey #{el}"
25
25
  @test_ds.send("#{el.to_s}=", value)
26
26
  @test_ds.send(el).first.should == value #Looking at first because creator has 2 nodes
27
27
  end
28
28
  end
29
+
30
+ it "should set date elements" do
31
+ d = Date.parse('1939-05-23')
32
+ @test_ds.creation_date = d
33
+ @test_ds.creation_date.first.should == d
34
+ end
29
35
  end
30
36
  end
31
37
 
@@ -38,7 +44,7 @@ describe ActiveFedora::SimpleDatastream do
38
44
  <fields>
39
45
  <coverage>80%</coverage>
40
46
  <coverage>20%</coverage>
41
- <creation_date>fake-date</creation_date>
47
+ <creation_date>2012-01-15</creation_date>
42
48
  <mydate>fake-date</mydate>
43
49
  <publisher>charlie</publisher>
44
50
  </fields>')
@@ -49,7 +55,7 @@ describe ActiveFedora::SimpleDatastream do
49
55
  it "should have title" do
50
56
  solr = @test_ds.to_solr
51
57
  solr["publisher_t"].should == ["publisher1"]
52
- solr["creation_date_dt"].should == ["fake-date"]
58
+ solr["creation_date_dt"].should == ["2012-01-15"]
53
59
  end
54
60
  end
55
61
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0.rc1
4
+ version: 4.6.0.rc2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-10-12 00:00:00.000000000 Z
14
+ date: 2012-10-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rsolr
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ~>
38
38
  - !ruby/object:Gem::Version
39
- version: 1.6.0
39
+ version: 1.7.0.rc1
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 1.6.0
47
+ version: 1.7.0.rc1
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: solrizer
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -542,7 +542,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
542
542
  version: '0'
543
543
  segments:
544
544
  - 0
545
- hash: 190185801018639774
545
+ hash: 1839430800864093444
546
546
  required_rubygems_version: !ruby/object:Gem::Requirement
547
547
  none: false
548
548
  requirements: