bsm_models 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/bsm/model/sti_convertable.rb +3 -3
  2. metadata +11 -3
@@ -13,13 +13,13 @@ module Bsm::Model::StiConvertable
13
13
  module ClassMethods
14
14
 
15
15
  # @Override: Allow to specify a kind
16
- def new(attributes = nil, options = {}, &block)
16
+ def new(attributes = nil, *args, &block)
17
17
  kind = (attributes = attributes.with_indifferent_access).delete(:kind) if attributes.is_a?(Hash)
18
18
  klass = real_descendants.find {|k| k.kind == kind }
19
19
  return super unless klass
20
20
 
21
- klass.with_scope(current_scope) do
22
- klass.new(attributes, options, &block)
21
+ klass.with_scope(respond_to?(:current_scope) ? current_scope : current_scoped_methods) do # AR 3.0 compatibility
22
+ klass.new(attributes, *args, &block)
23
23
  end
24
24
  end
25
25
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsm_models
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dimitrij Denissenko
@@ -45,6 +45,14 @@ dependencies:
45
45
  - 0
46
46
  - 0
47
47
  version: 3.0.0
48
+ - - <=
49
+ - !ruby/object:Gem::Version
50
+ hash: 15
51
+ segments:
52
+ - 3
53
+ - 2
54
+ - 0
55
+ version: 3.2.0
48
56
  type: :runtime
49
57
  version_requirements: *id002
50
58
  description: ""