remarkable_activerecord 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,15 @@
1
- # v3.0.0
1
+ * Allow all objects to be sent to have_scope (thanks to Szymon Nowak) [#53]
2
+
3
+ * Added support to sql options in association_matcher: select, conditions, include,
4
+ group, having, order, limit and offset. [#48]
5
+
6
+ * :source and :source_type are not supported by association matcher [#47]
7
+
8
+ * validate_inclusion_of became smarter since it now tests invalid values too [#36]
9
+
10
+ * Fixed three bugs in validate_uniqueness_of matcher [#42] [#40] [#37]
11
+
12
+ # v3.0
2
13
 
3
14
  [ENHANCEMENT] Added more options to associations matcher. Previously it was
4
15
  handling just :dependent and :through options. Now it deals with:
@@ -11,7 +11,7 @@ module Remarkable
11
11
 
12
12
  def is_scope?
13
13
  @scope_object = if @options[:with]
14
- subject_class.send(@scope_name, *@options[:with])
14
+ subject_class.send(@scope_name, @options[:with])
15
15
  else
16
16
  subject_class.send(@scope_name)
17
17
  end
@@ -7,6 +7,7 @@ describe 'have_scope' do
7
7
  @model = define_model :product, :title => :string, :category => :string do
8
8
  named_scope :recent, :order => 'created_at DESC'
9
9
  named_scope :latest, lambda {|c| {:limit => c}}
10
+ named_scope :since, lambda {|t| {:conditions => ['created_at > ?', t]}}
10
11
 
11
12
  def self.beginning(c)
12
13
  scoped(:offset => c)
@@ -48,10 +49,12 @@ describe 'have_scope' do
48
49
 
49
50
  it { should have_scope(:latest, :with => 10, :limit => 10) }
50
51
  it { should have_scope(:beginning, :with => 10, :offset => 10) }
52
+ it { should have_scope(:since, :with => Time.at(0), :conditions => ["created_at > ?", Time.at(0)]) }
51
53
 
52
54
  it { should_not have_scope(:null) }
53
55
  it { should_not have_scope(:latest, :with => 5, :limit => 10) }
54
56
  it { should_not have_scope(:beginning, :with => 5, :offset => 10) }
57
+ it { should_not have_scope(:since, :with => Time.at(0), :conditions => ["created_at > ?", Time.at(1)]) }
55
58
  end
56
59
 
57
60
  describe 'macros' do
@@ -60,10 +63,11 @@ describe 'have_scope' do
60
63
 
61
64
  should_have_scope :latest, :with => 10, :limit => 10
62
65
  should_have_scope :beginning, :with => 10, :offset => 10
66
+ should_have_scope :since, :with => Time.at(0), :conditions => ["created_at > ?", Time.at(0)]
63
67
 
64
68
  should_not_have_scope :null
65
69
  should_not_have_scope :latest, :with => 5, :limit => 10
66
70
  should_not_have_scope :beginning, :with => 5, :offset => 10
71
+ should_not_have_scope :since, :with => Time.at(0), :conditions => ["created_at > ?", Time.at(1)]
67
72
  end
68
73
  end
69
-
data/spec/spec_helper.rb CHANGED
@@ -11,8 +11,8 @@ require 'active_record'
11
11
 
12
12
  # Configure ActiveRecord connection
13
13
  ActiveRecord::Base.establish_connection(
14
- :adapter => 'sqlite3',
15
- :dbfile => 'memory'
14
+ :adapter => 'sqlite3',
15
+ :database => ':memory:'
16
16
  )
17
17
 
18
18
  # Load Remarkable core on place to avoid gem to be loaded
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remarkable_activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Brando
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-04-20 00:00:00 +02:00
14
+ date: 2009-04-22 00:00:00 +02:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -22,7 +22,7 @@ dependencies:
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 3.0.5
25
+ version: 3.0.6
26
26
  version:
27
27
  description: "Remarkable ActiveRecord: collection of matchers and macros with I18n for ActiveRecord"
28
28
  email: