chanko 2.3.0 → 3.0.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/master_and_pr.yml +6 -30
- data/.gitignore +1 -1
- data/CHANGELOG.md +8 -1
- data/README.md +3 -43
- data/chanko.gemspec +3 -4
- data/gemfiles/Gemfile_rails_6.1.rb +2 -4
- data/gemfiles/Gemfile_rails_7.0.rb +6 -0
- data/gemfiles/Gemfile_rails_7.1.rb +6 -0
- data/lib/chanko/function.rb +4 -13
- data/lib/chanko/railtie.rb +0 -13
- data/lib/chanko/unit/extender/extension.rb +0 -2
- data/lib/chanko/unit/extender.rb +0 -1
- data/lib/chanko/unit.rb +0 -12
- data/lib/chanko/version.rb +1 -1
- data/lib/generators/chanko/unit/templates/unit.rb.erb +3 -28
- data/lib/generators/chanko/unit/unit_generator.rb +22 -13
- data/spec/chanko/function_spec.rb +2 -52
- data/spec/chanko/test_spec.rb +1 -14
- data/spec/chanko/unit_spec.rb +0 -63
- data/spec/dummy/app/units/entry_deletion/entry_deletion.rb +0 -16
- data/spec/dummy/app/views/units/example_unit +1 -0
- data/spec/dummy/config/application.rb +8 -13
- data/spec/fixtures/units/example_unit/example_unit.rb +2 -2
- metadata +13 -21
- data/gemfiles/Gemfile_rails_5.0.rb +0 -6
- data/gemfiles/Gemfile_rails_5.0.rb.lock +0 -203
- data/gemfiles/Gemfile_rails_5.1.rb +0 -6
- data/gemfiles/Gemfile_rails_5.1.rb.lock +0 -203
- data/gemfiles/Gemfile_rails_5.2.rb +0 -6
- data/gemfiles/Gemfile_rails_5.2.rb.lock +0 -209
- data/gemfiles/Gemfile_rails_6.0.rb +0 -8
- data/gemfiles/Gemfile_rails_6.0.rb.lock +0 -238
- data/gemfiles/Gemfile_rails_6.1.rb.lock +0 -241
- data/lib/chanko/unit/extender/active_record_class_methods.rb +0 -57
@@ -1,57 +0,0 @@
|
|
1
|
-
module Chanko
|
2
|
-
module Unit
|
3
|
-
class Extender
|
4
|
-
module ActiveRecordClassMethods
|
5
|
-
delegate(
|
6
|
-
:apply_modules,
|
7
|
-
:arel,
|
8
|
-
:array_of_strings?,
|
9
|
-
:build_arel,
|
10
|
-
:build_joins,
|
11
|
-
:build_select,
|
12
|
-
:build_where,
|
13
|
-
:create_with,
|
14
|
-
:custom_join_sql,
|
15
|
-
:eager_load,
|
16
|
-
:extending,
|
17
|
-
:from,
|
18
|
-
:group,
|
19
|
-
:having,
|
20
|
-
:includes,
|
21
|
-
:joins,
|
22
|
-
:limit,
|
23
|
-
:lock,
|
24
|
-
:offset,
|
25
|
-
:order,
|
26
|
-
:preload,
|
27
|
-
:readonly,
|
28
|
-
:reorder,
|
29
|
-
:reverse_order,
|
30
|
-
:reverse_sql_order,
|
31
|
-
:scope,
|
32
|
-
:select,
|
33
|
-
:where,
|
34
|
-
:to => :@mod
|
35
|
-
)
|
36
|
-
|
37
|
-
%w[belongs_to has_many has_one].each do |method_name|
|
38
|
-
class_eval <<-EOS
|
39
|
-
def #{method_name}(*args, &block)
|
40
|
-
label = args.shift.to_s
|
41
|
-
name = @prefix + label
|
42
|
-
options = args.extract_options!
|
43
|
-
options = options.reverse_merge(:class_name => label.singularize.camelize)
|
44
|
-
args << options
|
45
|
-
@mod.#{method_name}(name.to_sym, *args, &block)
|
46
|
-
end
|
47
|
-
EOS
|
48
|
-
end
|
49
|
-
|
50
|
-
def scope(*args, &block)
|
51
|
-
name = @prefix + args.shift.to_s
|
52
|
-
@mod.scope(name, *args)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|