Skip to content

Commit 2fa5f28

Browse files
committed
Updated entrails to be as simple as installing it as a plugin or calling require 'entrails' and then it automatically patches the classes without the need to call Entrails.apply
1 parent 57be38d commit 2fa5f28

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

History.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
=== 1.0.3 / 2008-06-21
2+
3+
* Removed the need to all Entrails.apply after load. Now it just automatically extends the base classes if
4+
they exist. If you want to run a single piece of Entrails, just require it before the Rails initializer.
5+
16
=== 1.0.2 / 2008-06-20
27

38
* Fixed the bug. Now its usable. I need to document though. This really should be version 0.x.x Oh well!

entrails.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Gem::Specification.new do |s|
22
s.name = %q{entrails}
3-
s.version = "1.0.2"
3+
s.version = "1.0.3"
44

55
s.specification_version = 2 if s.respond_to? :specification_version=
66

77
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
88
s.authors = ["Brendan Baldwin"]
9-
s.date = "2008-06-20"
9+
s.date = "2008-06-21"
1010
s.default_executable = %q{entrails}
1111
s.description = "This is a collection of extensions to Rails internals that I've found to be absolutely indispensible since I implimented them. The real action is happening in the following two files at the moment: http://github.com/brendan/entrails/tree/master/lib/entrails/active_record/better_conditions.rb http://github.com/brendan/entrails/tree/master/lib/entrails/active_record/find_by_association.rb"
1212
s.email = ["[email protected]"]

init.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
require 'entrails'
2-
Entrails.apply

lib/entrails.rb

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
module Entrails
2-
VERSION='1.0.2'
2+
VERSION='1.0.3'
33
AUTHORS=["Brendan Baldwin"]
44
55
DESCRIPTION=%q{This is a collection of extensions to Rails internals that I've found to be absolutely indispensible since I implimented them. The real action is happening in the following two files at the moment: http://github.com/brendan/entrails/tree/master/lib/entrails/active_record/better_conditions.rb http://github.com/brendan/entrails/tree/master/lib/entrails/active_record/find_by_association.rb}
66
FOLDER=File.expand_path(File.join(File.dirname(__FILE__),'..'))
77
MANIFEST=Dir.glob(File.join(FOLDER,'**','*')).map{|path|path[FOLDER.size+1..-1]}
88
HOMEPAGE="http://github.com/brendan/entrails"
9-
class << self
10-
def apply
11-
::ActiveRecord::Base.extend ::Entrails::ActiveRecord::BetterConditions
12-
::ActiveRecord::Base.extend ::Entrails::ActiveRecord::FindByAssociation
13-
end
14-
end
159
end
1610

1711
require 'entrails/active_record'
12+
13+
if defined?(ActiveRecord::Base)
14+
ActiveRecord::Base.extend Entrails::ActiveRecord::BetterConditions
15+
ActiveRecord::Base.extend Entrails::ActiveRecord::FindByAssociation
16+
end

spec/spec_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
require 'activesupport'
1212
end
1313

14-
require 'entrails'
14+
require 'entrails'

0 commit comments

Comments
 (0)