stipend 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  module Stipend
2
2
  module Overrides
3
- def override_inherited_model_name(overridden_model_name)
3
+ def override_inherited_model_name(overridden_model_name_class)
4
4
  class_eval <<-SOMETEXT
5
5
  def self.inherited(child)
6
6
  child.instance_eval do
7
7
  def model_name
8
- '#{overridden_model_name}'
8
+ ::#{overridden_model_name_class}.model_name
9
9
  end
10
10
  end
11
11
 
@@ -1,3 +1,3 @@
1
1
  module Stipend
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -1,25 +1,25 @@
1
1
  require 'spec_helper'
2
2
 
3
- class OverridesTestType < ActiveRecord::Base
3
+ class TestType < ActiveRecord::Base
4
4
  include Stipend
5
5
 
6
- override_inherited_model_name OverridesTestType.model_name
6
+ override_inherited_model_name TestType
7
7
  end
8
8
 
9
- class OverridesAlphaTestType < OverridesTestType
9
+ class AlphaTestType < TestType
10
10
  end
11
11
 
12
12
  describe Stipend::Overrides do
13
13
  describe '.override_inherited_model_name' do
14
- let(:alpha_type) { OverridesAlphaTestType.new(:foo => 1, :bar => 'qux') }
14
+ let(:alpha_type) { AlphaTestType.new(:foo => 1, :bar => 'qux') }
15
15
 
16
16
  describe '#model_name' do
17
17
  it 'is always the model name of the base class' do
18
- alpha_type.class.model_name.should eql 'OverridesTestType'
18
+ alpha_type.class.model_name.should eql 'TestType'
19
19
  end
20
20
 
21
21
  it 'is always the model name of the base class' do
22
- OverridesTestType.model_name.should eql 'OverridesTestType'
22
+ TestType.model_name.should eql 'TestType'
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stipend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: