Commit Graph

31 Commits

Author SHA1 Message Date
y-yagi 26a18c8cc9
Latest mongoid only supports Ruby >= 2.5 (#912)
Ref: https://github.com/mongodb/mongoid/pull/5058
2021-12-16 14:16:09 -06:00
Tobias Bühlmann 4edc462b61
Fix decoration spec (#895)
Co-authored-by: Tobias Bühlmann <buehlmann@creative-network.biz>
2021-01-14 12:59:46 -06:00
y-yagi 89ec4b70f4 Add support for Rails 6.0 to `ViewContext::BuildStrategy` (#866)
* Add support for Rails 6.0 to `ViewContext::BuildStrategy`

In Rails 6.0 the API for `ActionView::Base.new` is changing.
`ActionView::Base.new` now take arguments [1], otherwise you
will see the following deprecation warning:

```
DEPRECATION WARNING: ActionView::Base instances should be constructed with a lookup context, assignments, and a controller.
```

[1] e17fe52e0e

`ViewContext::BuildStrategy::Fast` does not have lookup context, so use `empty`
method instead of `new` to build instance.

* Bump a Rails version of dummy application

Also bump a sqlite version because Rails 6.0 requires upper sqlite
1.4.0.

* Add `ApplicationController` to dummy application

Because Action Text expects `ApplicationController` exists.
Ref: https://github.com/rails/rails/issues/35749#issuecomment-525083643

* Test against Rails 6.0 that only supported Ruby versions
2020-01-07 10:58:00 -06:00
Bruno Castro 6b3e9bc5c9 feat: Include ORM associations in CollectionDecorator (#845)
## Description
Include all QueryMethods from the ORM in CollectionDecorator. The default adapter is :active_record

* Why was this change required?
It was necessary to delegate or define a method of the ORM which you are using in your decorator to make an instance of CollectionDecorator able to call it.
* Is there something you aren't happy with or that needs extra attention?
In order to support other ORM associations, we'll need to write a method `allowed?` for each strategy at `lib/draper/query_methods/load_strategy.rb`

## Testing
1. Create a decorator for the model and its association
```ruby
class OrderHistoryDecorator < Draper::Decorator
  delegate_all
end

class OrderDecorator < Draper::Decorator
  delegate_all

  decorates_association :order_histories, with: OrderHistoryDecorator
end
```

2. Call any query method in the decorated instance
```ruby
pry(main)> Order.last.decorate.order_histories.includes(:user)
```

## References
* Issue #702 
* Issue #812
2019-02-25 10:44:19 -06:00
Sean Linsley a7e368f28f update version requirements
since Rails 5 proper has been released, and mintiest-rails 3 has been
as well.
2016-07-04 15:16:35 -05:00
Sean Linsley a9a91bfbb5 setup up Travis for Rails 5
- require Rails 5 since Rubygems doesn’t allow us to only require
activemodel-serializers-xml when Rails is version 5
- require Ruby 2.2 since that’s what Rails 5 requires
2016-07-04 14:49:26 -05:00
Steven Harman feb8576bae Fix Rails 4.0 and 4.1 requirements 2015-01-29 16:43:54 -05:00
Andrew Haines 78e1af49f8 Rails 4.0
Test against released Rails 4.0 and Rails 4.1 dev; use Rails 4.0 by
default in development.
2013-07-07 12:21:06 +01:00
Andrew Haines dc1246d5d4 Fix Rails 4.0 tests 2013-05-20 12:57:31 +01:00
Andrew Haines 5b412c21d6 Use https for RubyGems 2013-02-27 11:34:56 +00:00
Andrew Haines 273196f7f0 Update mongoid dependency 2013-02-15 09:55:12 +00:00
Andrew Haines 07263e5077 Revert changes to Gemfile
Don't force the use of guard, or especially the Mac-only fsevent.
2013-02-05 09:43:17 +00:00
Thomas Stratmann ddbecab92e reflect spec:all task in Guardfile 2013-02-03 20:03:00 +01:00
Andrew Haines d1b22caa59 Improve Devise integration 2013-01-25 17:42:56 +00:00
Andrew Haines 2c2aed69fb Unlock JRuby SQLite dependency 2013-01-24 01:47:05 +00:00
Andrew Haines 8b0150317d Basic mongoid integration spec 2013-01-21 13:39:19 +00:00
Andrew Haines 453980906c Enable testing against multiple Rails versions 2013-01-12 16:28:37 +00:00
Andrew Haines c2d1e7545b Lock jRuby sqlite3 dependency 2012-12-26 13:33:40 +00:00
Steve Klabnik 44b846716a use activerecord-jdbcsqlite3-adapter on jruby 2012-11-02 19:28:45 -07:00
Steve Klabnik 51fef48258 Cleaning up gemspec and Gemfile 2012-05-09 18:30:33 -04:00
Joey Butler 08e06e2051 Add redcarpet as a development dependency. 2012-03-17 18:18:30 -04:00
Mark Burns 93191523ba trailing whitespace 2012-03-03 14:01:19 +00:00
Jeff Casimir 7022065654 Updating dependencies 2012-01-16 16:26:07 -05:00
Jeff Casimir a581c0ec9a Bumping up to 3.1 for gem development 2012-01-16 07:16:57 -05:00
Jeff Casimir 6c10302cd3 Simplifying development dependencies 2011-10-07 16:37:36 -04:00
Alex Rothenberg 16e8868da1 added generator specs using the ammeter gem 2011-10-06 16:58:04 -04:00
Jeff Casimir 842dfbcf8c Basic YARD documentation 2011-09-01 01:17:12 -04:00
Jeff Casimir a6b5825a3c Making Rake requirement flexible for 1.9.3 compatibility 2011-08-28 00:08:46 -05:00
Jeff Casimir be24b433b4 Ruby-debug is not 1.9.3 compatible right now 2011-08-28 00:01:04 -05:00
Jeff Casimir 59515f5194 Reworking dependency handling in development 2011-08-27 23:51:30 -05:00
Jeff Casimir a3804b0662 Bring over generator structure from rails_decorators 2011-06-30 18:19:48 -04:00