tiny_support 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3e71980b8e40a53737c62ec01d6b54a19cf26bc
4
- data.tar.gz: 526d6d3ce0f2053ae487b7a2124e21f68656a44e
3
+ metadata.gz: 6caf22f83da20d979bc233566082ab3cdfccfbfb
4
+ data.tar.gz: ce5f67000547082932accad4cb6f92adee6df28f
5
5
  SHA512:
6
- metadata.gz: e088ee6c667799429a036d83a5d748aa71ca339a7f0e0a01586dc8a3c4304ba0c7ac8da593239727f866fa4e24dadd868822df193cbb0cbd26fe7f94718c627f
7
- data.tar.gz: aee24a0c698f872cd284cf82c7b5c3d8b87fc8b4a33148c3a44628cf5d2e76b64b72ecb6503016441155de45c7658c351eb1e3095756c3684365372227c72836
6
+ metadata.gz: bda9c8094e9964784ad17c4d9e6381c2c82676fa5fd3d9a6e06e2bdb9e1fc5a8229dbbc62023ea1250d2f3a54906414fc417d883efc8ef9f2c1e2a2bbe422855
7
+ data.tar.gz: 41e08f999388a171af9ba6db097b820a6db55b98cf3c287d65cd95d07e11e57a26639a27706565e46921d0a5b1ba468ad9ea452dadda3767ce48aff0aac9b116
@@ -28,14 +28,19 @@ module TinySupport
28
28
  _configs = ::TinyUtil::Config.new(configs)
29
29
  self.class_variable_set("@@#{_class_config_name}", _configs)
30
30
 
31
- scope :status_of, ->(key) do
32
- where(:status => _configs.find_by_key(_key).value)
33
- end
31
+ # scope :status_of, ->(key) do
32
+ # where(:status => _configs.find_by_key(_key).value)
33
+ # end
34
34
 
35
35
  define_method :"#{field_name}" do
36
36
  _configs.find_by_value(send(:"#{field_name}_value"))
37
37
  end
38
38
 
39
+ define_method :"#{field_name}_display" do
40
+ _config = _configs.find_by_value(send(:"#{field_name}_value"))
41
+ _config.item
42
+ end
43
+
39
44
  define_method :"#{field_name}_key" do
40
45
  _configs.find_by_value(send(:"#{field_name}_value")).key
41
46
  end
@@ -52,4 +57,4 @@ module TinySupport
52
57
  end
53
58
  end
54
59
  end
55
- # *
60
+
@@ -9,8 +9,9 @@ module TinySupport
9
9
  include ::ActiveModel::Validations
10
10
  include ::ActiveModel::Validations::Callbacks
11
11
 
12
-
13
12
  include ::TinySupport::Configable
13
+
14
+ attr_reader :result
14
15
  end
15
16
 
16
17
  module ClassMethods
@@ -1,10 +1,10 @@
1
1
  module TinySupport
2
2
  module ActiveRecord
3
3
  class DisplayBase
4
- attr_reader :record
4
+ attr_reader :_origin_record
5
5
 
6
6
  def initialize record
7
- @record = record
7
+ @_origin_record = record
8
8
  end
9
9
  end
10
10
  end
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module TinySupport
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - happy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-23 00:00:00.000000000 Z
11
+ date: 2014-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails