hydra_attribute 0.2.0 → 0.3.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/README.md +74 -68
  2. data/cucumber.yml +1 -0
  3. data/features/attributes/create.feature +22 -0
  4. data/features/attributes/destroy.feature +18 -0
  5. data/features/attributes/update.feature +19 -0
  6. data/features/create.feature +47 -0
  7. data/features/define.feature +33 -0
  8. data/features/query_methods/group.feature +13 -14
  9. data/features/query_methods/order.feature +63 -52
  10. data/features/query_methods/select.feature +36 -37
  11. data/features/query_methods/where.feature +36 -38
  12. data/features/step_definitions/model_steps.rb +23 -19
  13. data/features/step_definitions/query_methods.rb +6 -2
  14. data/features/step_definitions/record_steps.rb +28 -10
  15. data/features/support/env.rb +12 -6
  16. data/features/support/schema.rb +62 -35
  17. data/features/support/world.rb +14 -5
  18. data/features/update.feature +114 -0
  19. data/gemfiles/3.1.gemfile.lock +10 -10
  20. data/gemfiles/3.2.gemfile.lock +10 -10
  21. data/lib/hydra_attribute/active_record/association.rb +77 -0
  22. data/lib/hydra_attribute/active_record/association_preloader.rb +82 -0
  23. data/lib/hydra_attribute/active_record/attribute_methods.rb +145 -37
  24. data/lib/hydra_attribute/active_record/migration.rb +21 -0
  25. data/lib/hydra_attribute/active_record/reflection.rb +16 -0
  26. data/lib/hydra_attribute/active_record/relation/query_methods.rb +73 -71
  27. data/lib/hydra_attribute/active_record/relation.rb +1 -24
  28. data/lib/hydra_attribute/active_record.rb +16 -2
  29. data/lib/hydra_attribute/association_builder.rb +44 -20
  30. data/lib/hydra_attribute/builder.rb +15 -13
  31. data/lib/hydra_attribute/configuration.rb +9 -30
  32. data/lib/hydra_attribute/entity_callbacks.rb +46 -0
  33. data/lib/hydra_attribute/hydra_attribute.rb +27 -0
  34. data/lib/hydra_attribute/migrator.rb +106 -0
  35. data/lib/hydra_attribute/railtie.rb +2 -0
  36. data/lib/hydra_attribute/version.rb +2 -2
  37. data/lib/hydra_attribute.rb +8 -6
  38. data/lib/rails/generators/hydra_attribute/install/templates/hydra_attribute.txt +4 -0
  39. data/spec/spec_helper.rb +1 -2
  40. metadata +42 -60
  41. data/features/attribute_methods.feature +0 -146
  42. data/features/define_attributes.feature +0 -56
  43. data/features/load_associations.feature +0 -40
  44. data/features/step_definitions/class_steps.rb +0 -32
  45. data/features/typecast_attributes.feature +0 -24
  46. data/lib/generators/hydra_attribute/install/templates/hydra_attribute.txt +0 -11
  47. data/lib/hydra_attribute/active_record/attribute_methods/before_type_cast.rb +0 -16
  48. data/lib/hydra_attribute/active_record/attribute_methods/read.rb +0 -13
  49. data/lib/hydra_attribute/attribute_builder.rb +0 -57
  50. data/lib/hydra_attribute/attribute_proxy.rb +0 -16
  51. data/lib/hydra_attribute/migration.rb +0 -27
  52. data/spec/hydra_attribute/active_record/relation/query_methods_spec.rb +0 -334
  53. data/spec/hydra_attribute/active_record/relation_spec.rb +0 -67
  54. data/spec/hydra_attribute/active_record/scoping_spec.rb +0 -23
  55. data/spec/hydra_attribute/active_record_spec.rb +0 -18
  56. data/spec/hydra_attribute/association_builder_spec.rb +0 -95
  57. data/spec/hydra_attribute/attribute_builder_spec.rb +0 -70
  58. data/spec/hydra_attribute/attribute_helpers_spec.rb +0 -70
  59. data/spec/hydra_attribute/builder_spec.rb +0 -39
  60. data/spec/hydra_attribute/configuration_spec.rb +0 -65
  61. data/spec/hydra_attribute_spec.rb +0 -20
  62. /data/lib/{generators → rails/generators}/hydra_attribute/install/USAGE +0 -0
  63. /data/lib/{generators → rails/generators}/hydra_attribute/install/install_generator.rb +0 -0
@@ -1,40 +1,64 @@
1
1
  module HydraAttribute
2
2
  class AssociationBuilder
3
+ attr_reader :klass, :type
3
4
 
4
5
  def initialize(klass, type)
5
6
  @klass, @type = klass, type
6
7
  end
7
8
 
9
+ class << self
10
+ def build(klass, type)
11
+ new(klass, type).build
12
+ end
13
+
14
+ def model_name(klass, type)
15
+ "Hydra#{type.to_s.capitalize}#{klass.model_name}"
16
+ end
17
+
18
+ def class_name(klass, type)
19
+ "::HydraAttribute::#{model_name(klass, type)}"
20
+ end
21
+
22
+ def table_name(klass, type)
23
+ "hydra_#{type}_#{klass.table_name}"
24
+ end
25
+
26
+ def association_name(type)
27
+ "hydra_#{type}_values".to_sym
28
+ end
29
+ end
30
+
8
31
  def build
9
- create_associated_model
10
- add_association_for_class
32
+ create_value_model
33
+ add_association
34
+ end
35
+
36
+ def create_value_model
37
+ value_model = ::HydraAttribute.const_set(model_name, Class.new(::ActiveRecord::Base))
38
+ value_model.table_name = table_name
39
+ value_model.belongs_to :entity, class_name: klass.model_name, autosave: false
40
+ value_model.belongs_to :hydra_attribute, class_name: 'HydraAttribute::HydraAttribute'
41
+ value_model.attr_accessible :hydra_attribute_id, :value
11
42
  end
12
43
 
13
- private
44
+ def add_association
45
+ klass.has_many association_name, class_name: class_name, foreign_key: :entity_id, autosave: false
46
+ end
14
47
 
15
- def create_associated_model
16
- const = config.associated_const_name(@type)
17
- unless namespace.const_defined?(const)
18
- klass = namespace.const_set(const, Class.new(::ActiveRecord::Base))
19
- klass.table_name = config.table_name(@type)
20
- klass.attr_accessible :name, :value
21
- klass.belongs_to :entity, polymorphic: true, touch: true, autosave: true
22
- end
48
+ def model_name
49
+ self.class.model_name(klass, type)
23
50
  end
24
51
 
25
- def add_association_for_class
26
- assoc = config.association(@type)
27
- unless @klass.reflect_on_association(assoc)
28
- @klass.has_many assoc, as: :entity, class_name: config.associated_model_name(@type), autosave: true, dependent: :delete_all
29
- end
52
+ def class_name
53
+ self.class.class_name(klass, type)
30
54
  end
31
55
 
32
- def config
33
- HydraAttribute.config
56
+ def table_name
57
+ self.class.table_name(klass, type)
34
58
  end
35
59
 
36
- def namespace
37
- config.use_module_for_associated_models ? HydraAttribute : Object
60
+ def association_name
61
+ self.class.association_name(type)
38
62
  end
39
63
  end
40
64
  end
@@ -3,23 +3,25 @@ module HydraAttribute
3
3
  attr_reader :klass
4
4
 
5
5
  def initialize(klass)
6
- @klass = klass
7
- @klass.class_eval do
8
- include ActiveRecord::Scoping
9
- include ActiveRecord::AttributeMethods
6
+ [
7
+ ActiveRecord::Scoping,
8
+ ActiveRecord::AttributeMethods,
9
+ EntityCallbacks
10
+ ].each do |m|
11
+ klass.send :include, m
10
12
  end
13
+
14
+ @klass = klass
11
15
  end
12
16
 
13
- SUPPORT_TYPES.each do |type|
14
- class_eval <<-EOS, __FILE__, __LINE__ + 1
15
- def #{type}(*attributes)
16
- AssociationBuilder.new(klass, :#{type}).build
17
+ def self.build(klass)
18
+ new(klass).build
19
+ end
17
20
 
18
- attributes.each do |attribute|
19
- AttributeBuilder.new(klass, attribute, :#{type}).build
20
- end
21
- end
22
- EOS
21
+ def build
22
+ SUPPORT_TYPES.each do |type|
23
+ AssociationBuilder.build(klass, type)
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,37 +3,16 @@ module HydraAttribute
3
3
  def self.add_setting(name, default_value)
4
4
  attr_writer name
5
5
 
6
- define_method name do
7
- instance_variable_set("@#{name}", default_value) unless instance_variable_defined?("@#{name}")
8
- instance_variable_get("@#{name}")
9
- end
6
+ class_eval <<-EOS, __FILE__, __LINE__ + 1
7
+ def #{name}
8
+ @#{name} = #{default_value} unless defined?(@#{name})
9
+ @#{name}
10
+ end
10
11
 
11
- define_method "#{name}?" do
12
- send(name).present?
13
- end
14
- end
15
-
16
- add_setting :table_prefix, 'hydra_'
17
- add_setting :association_prefix, 'hydra_'
18
- add_setting :use_module_for_associated_models, true
19
-
20
- def table_name(type)
21
- "#{table_prefix}#{type}_attributes".to_sym
22
- end
23
-
24
- def association(type)
25
- "#{association_prefix}#{type}_attributes".to_sym
26
- end
27
-
28
- # Return string for compatibility with ActiveRecord 3.1.x
29
- def associated_model_name(type)
30
- klass = associated_const_name(type).to_s
31
- klass = "HydraAttribute::#{klass}" if use_module_for_associated_models?
32
- klass
33
- end
34
-
35
- def associated_const_name(type)
36
- "#{type.to_s.titlecase}Attribute".to_sym
12
+ def #{name}?
13
+ #{name}.present?
14
+ end
15
+ EOS
37
16
  end
38
17
  end
39
18
  end
@@ -0,0 +1,46 @@
1
+ module HydraAttribute
2
+ module EntityCallbacks
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ after_create :create_hydra_values
7
+ after_update :update_hydra_values
8
+ before_destroy :destroy_hydra_values
9
+ end
10
+
11
+ private
12
+
13
+ def create_hydra_values
14
+ created = false
15
+ each_hydra_value_model do |model|
16
+ model.entity_id = id
17
+ model.save
18
+ created = true
19
+ end
20
+ touch if created
21
+ end
22
+
23
+ def update_hydra_values
24
+ updated = false
25
+ each_hydra_value_model do |model|
26
+ if model.changed?
27
+ updated = true
28
+ model.save
29
+ end
30
+ end
31
+ touch if updated
32
+ end
33
+
34
+ def destroy_hydra_values
35
+ self.class.hydra_attribute_backend_types.each do |type|
36
+ AssociationBuilder.class_name(self.class, type).constantize.where(entity_id: id).delete_all
37
+ end
38
+ end
39
+
40
+ def each_hydra_value_model(&block)
41
+ self.class.hydra_attribute_backend_types.each do |type|
42
+ association(AssociationBuilder.association_name(type)).all_models.each(&block)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,27 @@
1
+ require 'active_support/core_ext/object/with_options'
2
+
3
+ module HydraAttribute
4
+ class HydraAttribute < ActiveRecord::Base
5
+ self.table_name = 'hydra_attributes'
6
+
7
+ with_options presence: true do |klass|
8
+ klass.validates :entity_type, inclusion: { in: lambda { |attr| [(attr.entity_type.constantize.name rescue nil)] } }
9
+ klass.validates :name, uniqueness: { scope: :entity_type }
10
+ klass.validates :backend_type, inclusion: SUPPORT_TYPES
11
+ end
12
+
13
+ before_destroy :delete_dependent_values
14
+ after_commit :reload_entity_attributes
15
+
16
+ private
17
+
18
+ def delete_dependent_values
19
+ value_class = AssociationBuilder.class_name(entity_type.constantize, backend_type).constantize
20
+ value_class.delete_all(hydra_attribute_id: id)
21
+ end
22
+
23
+ def reload_entity_attributes
24
+ entity_type.constantize.reset_hydra_attribute_methods
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,106 @@
1
+ module HydraAttribute
2
+ class Migrator
3
+
4
+ def initialize(migration)
5
+ @migration = migration
6
+ end
7
+
8
+ class << self
9
+ %w(create remove migrate rollback).each do |method|
10
+ class_eval <<-EOS, __FILE__, __LINE__ + 1
11
+ def #{method}(migration, *args, &block)
12
+ new(migration).#{method}(*args, &block)
13
+ end
14
+ EOS
15
+ end
16
+ end
17
+
18
+ def create(name, options = {}, &block)
19
+ create_entity(name, options, &block)
20
+ create_attribute unless attribute_exists?
21
+ create_values(name)
22
+ end
23
+
24
+ def drop(name)
25
+ drop_values(name)
26
+ drop_attributes unless values_exists?
27
+ drop_entity(name)
28
+ end
29
+
30
+ def migrate(name)
31
+ create_attribute unless attribute_exists?
32
+ create_values(name)
33
+ end
34
+
35
+ def rollback(name)
36
+ drop_values(name)
37
+ drop_attribute unless values_exists?
38
+ end
39
+
40
+ private
41
+
42
+ def create_entity(name, options = {})
43
+ create_table name, options do |t|
44
+ yield t if block_given?
45
+ end
46
+ end
47
+
48
+ def create_attribute
49
+ create_table :hydra_attributes do |t|
50
+ t.string :entity_type, limit: 32, null: false
51
+ t.string :name, limit: 32, null: false
52
+ t.string :backend_type, limit: 16, null: false
53
+ t.string :default_value
54
+ t.timestamps
55
+ end
56
+ add_index :hydra_attributes, [:entity_type, :name], unique: true, name: 'hydra_attributes_index'
57
+ end
58
+
59
+ def create_values(name)
60
+ SUPPORT_TYPES.each do |type|
61
+ table_name = value_table(name, type)
62
+ create_table table_name do |t|
63
+ t.integer :entity_id, null: false
64
+ t.integer :hydra_attribute_id, null: false
65
+ t.send type, :value
66
+ t.timestamps
67
+ end
68
+ add_index table_name, [:entity_id, :hydra_attribute_id], unique: true, name: "#{table_name}_index"
69
+ end
70
+ end
71
+
72
+ def drop_entity(name)
73
+ drop_table(name)
74
+ end
75
+
76
+ def drop_attribute
77
+ drop_table(:hydra_attributes)
78
+ end
79
+
80
+ def drop_values(name)
81
+ SUPPORT_TYPES.each do |type|
82
+ drop_table(value_table(name, type))
83
+ end
84
+ end
85
+
86
+ def value_table(name, type)
87
+ "hydra_#{type}_#{name}"
88
+ end
89
+
90
+ def attribute_exists?
91
+ table_exists?(:hydra_attributes)
92
+ end
93
+
94
+ def values_exists?
95
+ tables.any? do |table|
96
+ SUPPORT_TYPES.any? do |type|
97
+ table.start_with?("hydra_#{type}_")
98
+ end
99
+ end
100
+ end
101
+
102
+ def method_missing(symbol, *args, &block)
103
+ @migration.send(symbol, *args, &block)
104
+ end
105
+ end
106
+ end
@@ -3,6 +3,8 @@ module HydraAttribute
3
3
  initializer 'hydra_attribute.active_record' do
4
4
  ActiveSupport.on_load :active_record do
5
5
  extend ::HydraAttribute::ActiveRecord
6
+
7
+ ::ActiveRecord::Migration.send :include, ::HydraAttribute::ActiveRecord::Migration
6
8
  end
7
9
  end
8
10
  end
@@ -1,3 +1,3 @@
1
1
  module HydraAttribute
2
- VERSION = '0.2.0'
3
- end
2
+ VERSION = '0.3.0.beta1'
3
+ end
@@ -1,5 +1,5 @@
1
1
  module HydraAttribute
2
- SUPPORT_TYPES = [:string, :text, :integer, :float, :boolean, :datetime]
2
+ SUPPORT_TYPES = %w(string text integer float boolean datetime).freeze
3
3
 
4
4
  class << self
5
5
  def config
@@ -16,16 +16,18 @@ end
16
16
  require 'hydra_attribute/version'
17
17
  require 'hydra_attribute/configuration'
18
18
  require 'hydra_attribute/association_builder'
19
- require 'hydra_attribute/attribute_builder'
20
19
  require 'hydra_attribute/builder'
21
- require 'hydra_attribute/migration'
22
- require 'hydra_attribute/attribute_proxy'
20
+ require 'hydra_attribute/migrator'
21
+ require 'hydra_attribute/hydra_attribute'
22
+ require 'hydra_attribute/entity_callbacks'
23
23
  require 'hydra_attribute/active_record'
24
24
  require 'hydra_attribute/active_record/scoping'
25
+ require 'hydra_attribute/active_record/reflection'
26
+ require 'hydra_attribute/active_record/association'
27
+ require 'hydra_attribute/active_record/association_preloader'
28
+ require 'hydra_attribute/active_record/migration'
25
29
  require 'hydra_attribute/active_record/relation'
26
30
  require 'hydra_attribute/active_record/relation/query_methods'
27
31
  require 'hydra_attribute/active_record/attribute_methods'
28
- require 'hydra_attribute/active_record/attribute_methods/read'
29
- require 'hydra_attribute/active_record/attribute_methods/before_type_cast'
30
32
 
31
33
  require 'hydra_attribute/railtie' if defined?(Rails)
@@ -0,0 +1,4 @@
1
+ # Change default hydra_attribute configurations
2
+ HydraAttribute.setup do |config|
3
+
4
+ end
data/spec/spec_helper.rb CHANGED
@@ -7,11 +7,10 @@ ActiveRecord::Base.extend(HydraAttribute::ActiveRecord)
7
7
  require 'database_cleaner'
8
8
  RSpec.configure do |config|
9
9
  config.before do
10
- HydraAttribute.instance_variable_set(:@config, nil)
11
10
  DatabaseCleaner.start
12
11
  end
13
12
 
14
13
  config.after do
15
14
  DatabaseCleaner.clean
16
15
  end
17
- end
16
+ end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra_attribute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.3.0.beta1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kostyantyn Stepanyuk
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-12 00:00:00.000000000Z
12
+ date: 2012-07-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
16
- requirement: &2151761260 !ruby/object:Gem::Requirement
16
+ requirement: &2152234260 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2151761260
24
+ version_requirements: *2152234260
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &2151759920 !ruby/object:Gem::Requirement
27
+ requirement: &2152233160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2151759920
35
+ version_requirements: *2152233160
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: cucumber
38
- requirement: &2151757300 !ruby/object:Gem::Requirement
38
+ requirement: &2152232280 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2151757300
46
+ version_requirements: *2152232280
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sqlite3
49
- requirement: &2151755780 !ruby/object:Gem::Requirement
49
+ requirement: &2152231480 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2151755780
57
+ version_requirements: *2152231480
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: database_cleaner
60
- requirement: &2151753880 !ruby/object:Gem::Requirement
60
+ requirement: &2152230780 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2151753880
68
+ version_requirements: *2152230780
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: appraisal
71
- requirement: &2151747420 !ruby/object:Gem::Requirement
71
+ requirement: &2152229960 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2151747420
79
+ version_requirements: *2152229960
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rake
82
- requirement: &2151746260 !ruby/object:Gem::Requirement
82
+ requirement: &2152229020 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2151746260
90
+ version_requirements: *2152229020
91
91
  description: hydra_attribute is an implementation of EAV pattern for ActiveRecord
92
92
  models.
93
93
  email: kostya.stepanyuk@gmail.com
@@ -104,55 +104,49 @@ files:
104
104
  - LICENSE
105
105
  - README.md
106
106
  - Rakefile
107
- - features/attribute_methods.feature
108
- - features/define_attributes.feature
109
- - features/load_associations.feature
107
+ - cucumber.yml
108
+ - features/attributes/create.feature
109
+ - features/attributes/destroy.feature
110
+ - features/attributes/update.feature
111
+ - features/create.feature
112
+ - features/define.feature
110
113
  - features/query_methods/group.feature
111
114
  - features/query_methods/order.feature
112
115
  - features/query_methods/select.feature
113
116
  - features/query_methods/where.feature
114
- - features/step_definitions/class_steps.rb
115
117
  - features/step_definitions/model_steps.rb
116
118
  - features/step_definitions/query_methods.rb
117
119
  - features/step_definitions/record_steps.rb
118
120
  - features/support/env.rb
119
121
  - features/support/schema.rb
120
122
  - features/support/world.rb
121
- - features/typecast_attributes.feature
123
+ - features/update.feature
122
124
  - gemfiles/3.1.gemfile
123
125
  - gemfiles/3.1.gemfile.lock
124
126
  - gemfiles/3.2.gemfile
125
127
  - gemfiles/3.2.gemfile.lock
126
128
  - hydra_attribute.gemspec
127
- - lib/generators/hydra_attribute/install/USAGE
128
- - lib/generators/hydra_attribute/install/install_generator.rb
129
- - lib/generators/hydra_attribute/install/templates/hydra_attribute.txt
130
129
  - lib/hydra_attribute.rb
131
130
  - lib/hydra_attribute/active_record.rb
131
+ - lib/hydra_attribute/active_record/association.rb
132
+ - lib/hydra_attribute/active_record/association_preloader.rb
132
133
  - lib/hydra_attribute/active_record/attribute_methods.rb
133
- - lib/hydra_attribute/active_record/attribute_methods/before_type_cast.rb
134
- - lib/hydra_attribute/active_record/attribute_methods/read.rb
134
+ - lib/hydra_attribute/active_record/migration.rb
135
+ - lib/hydra_attribute/active_record/reflection.rb
135
136
  - lib/hydra_attribute/active_record/relation.rb
136
137
  - lib/hydra_attribute/active_record/relation/query_methods.rb
137
138
  - lib/hydra_attribute/active_record/scoping.rb
138
139
  - lib/hydra_attribute/association_builder.rb
139
- - lib/hydra_attribute/attribute_builder.rb
140
- - lib/hydra_attribute/attribute_proxy.rb
141
140
  - lib/hydra_attribute/builder.rb
142
141
  - lib/hydra_attribute/configuration.rb
143
- - lib/hydra_attribute/migration.rb
142
+ - lib/hydra_attribute/entity_callbacks.rb
143
+ - lib/hydra_attribute/hydra_attribute.rb
144
+ - lib/hydra_attribute/migrator.rb
144
145
  - lib/hydra_attribute/railtie.rb
145
146
  - lib/hydra_attribute/version.rb
146
- - spec/hydra_attribute/active_record/relation/query_methods_spec.rb
147
- - spec/hydra_attribute/active_record/relation_spec.rb
148
- - spec/hydra_attribute/active_record/scoping_spec.rb
149
- - spec/hydra_attribute/active_record_spec.rb
150
- - spec/hydra_attribute/association_builder_spec.rb
151
- - spec/hydra_attribute/attribute_builder_spec.rb
152
- - spec/hydra_attribute/attribute_helpers_spec.rb
153
- - spec/hydra_attribute/builder_spec.rb
154
- - spec/hydra_attribute/configuration_spec.rb
155
- - spec/hydra_attribute_spec.rb
147
+ - lib/rails/generators/hydra_attribute/install/USAGE
148
+ - lib/rails/generators/hydra_attribute/install/install_generator.rb
149
+ - lib/rails/generators/hydra_attribute/install/templates/hydra_attribute.txt
156
150
  - spec/spec_helper.rb
157
151
  homepage: https://github.com/kostyantyn/hydra_attribute
158
152
  licenses: []
@@ -169,12 +163,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
163
  required_rubygems_version: !ruby/object:Gem::Requirement
170
164
  none: false
171
165
  requirements:
172
- - - ! '>='
166
+ - - ! '>'
173
167
  - !ruby/object:Gem::Version
174
- version: '0'
175
- segments:
176
- - 0
177
- hash: -33625434151420815
168
+ version: 1.3.1
178
169
  requirements: []
179
170
  rubyforge_project:
180
171
  rubygems_version: 1.8.10
@@ -183,33 +174,24 @@ specification_version: 3
183
174
  summary: hydra_attribute is an implementation of EAV pattern for ActiveRecord models.
184
175
  test_files:
185
176
  - Appraisals
186
- - features/attribute_methods.feature
187
- - features/define_attributes.feature
188
- - features/load_associations.feature
177
+ - features/attributes/create.feature
178
+ - features/attributes/destroy.feature
179
+ - features/attributes/update.feature
180
+ - features/create.feature
181
+ - features/define.feature
189
182
  - features/query_methods/group.feature
190
183
  - features/query_methods/order.feature
191
184
  - features/query_methods/select.feature
192
185
  - features/query_methods/where.feature
193
- - features/step_definitions/class_steps.rb
194
186
  - features/step_definitions/model_steps.rb
195
187
  - features/step_definitions/query_methods.rb
196
188
  - features/step_definitions/record_steps.rb
197
189
  - features/support/env.rb
198
190
  - features/support/schema.rb
199
191
  - features/support/world.rb
200
- - features/typecast_attributes.feature
192
+ - features/update.feature
201
193
  - gemfiles/3.1.gemfile
202
194
  - gemfiles/3.1.gemfile.lock
203
195
  - gemfiles/3.2.gemfile
204
196
  - gemfiles/3.2.gemfile.lock
205
- - spec/hydra_attribute/active_record/relation/query_methods_spec.rb
206
- - spec/hydra_attribute/active_record/relation_spec.rb
207
- - spec/hydra_attribute/active_record/scoping_spec.rb
208
- - spec/hydra_attribute/active_record_spec.rb
209
- - spec/hydra_attribute/association_builder_spec.rb
210
- - spec/hydra_attribute/attribute_builder_spec.rb
211
- - spec/hydra_attribute/attribute_helpers_spec.rb
212
- - spec/hydra_attribute/builder_spec.rb
213
- - spec/hydra_attribute/configuration_spec.rb
214
- - spec/hydra_attribute_spec.rb
215
197
  - spec/spec_helper.rb