Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple shared directory via config #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

merqlove
Copy link

@merqlove merqlove commented Jan 8, 2016

Works well in my case.
Able to configure/reconfigure after or before default environment seed.

Sprig.configure do |config|
  config.shared_directory = 'shared'
end

Yes, ideally we need something with merge functional. But currently i found this case pretty useful.

@ltk
Copy link
Contributor

ltk commented Jan 12, 2016

Thanks @merqlove. Can you describe how you use this? Do you have apps where you want all your seeds to be the same for all your environments?

@merqlove
Copy link
Author

@ltk Yeah, currently i have app where i have 100% identical seed. Later it will be splitted into two or more, but for now i want DRY :)

Seems that next iteration can fail if process depends on shared model.
But single call or call for different models works fine.

Example:

include Sprig::Helpers

Sprig.configure do | config|
  config.shared_directory = 'shared'
end

sprig [IdReservation, Genre, User, User::Profile, User::ProfileAvatar, User::Purse, SupportTicket, Page, Block,
       BlockPlace, Broadcast::Trailer, Broadcast::Trailer::Video, Broadcast, Broadcast::Background, Broadcast::Poster,
       Broadcast::Subscription, Broadcast::Ticket, Chat, SocialNetwork, SocialLink, Statistic]

# ...
# Sprig.configure do | config|
#  config.shared_directory = nil
# end

# sprig[Something]
#

@merqlove
Copy link
Author

Rebased with master

@coveralls
Copy link

coveralls commented Aug 27, 2016

Coverage Status

Coverage increased (+0.007%) to 98.967% when pulling 99be7d4 on merqlove:master into e095326 on vigetlabs:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants